{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getmattered/json-schema/getmattered-comp-intelligence-response-schema.json",
  "title": "CompIntelligenceResponse",
  "description": "Successful API response",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getmattered-jobs-api-openapi.yml#/components/schemas/CompIntelligenceResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "companyCompReputation": {
          "type": "object",
          "properties": {
            "signals": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Signals that indicate comp positioning (funding, size, industry, benefits mentioned)"
            },
            "tier": {
              "type": "string"
            }
          },
          "required": [
            "signals",
            "tier"
          ],
          "additionalProperties": false
        },
        "geographicFactors": {
          "type": "object",
          "properties": {
            "costOfLivingAdjustment": {
              "type": [
                "string",
                "null"
              ],
              "description": "How location affects comp, or null if remote"
            },
            "locationTier": {
              "type": "string"
            },
            "remotePolicy": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "costOfLivingAdjustment",
            "locationTier",
            "remotePolicy"
          ],
          "additionalProperties": false
        },
        "levelAnalysis": {
          "type": "object",
          "properties": {
            "compBand": {
              "type": "string",
              "description": "Typical comp band for this level in this industry"
            },
            "detectedLevel": {
              "type": "string",
              "description": "Seniority level detected from JD (Junior, Mid, Senior, Staff, Principal, etc.)"
            },
            "levelJustification": {
              "type": "string",
              "description": "Why this level was detected (years req, scope, reporting structure)"
            }
          },
          "required": [
            "compBand",
            "detectedLevel",
            "levelJustification"
          ],
          "additionalProperties": false
        },
        "marketDemand": {
          "type": "object",
          "properties": {
            "level": {
              "type": "string"
            },
            "reasoning": {
              "type": "string"
            },
            "trendDirection": {
              "type": "string"
            }
          },
          "required": [
            "level",
            "reasoning",
            "trendDirection"
          ],
          "additionalProperties": false
        },
        "negotiationInsights": {
          "type": "object",
          "properties": {
            "counterOfferScript": {
              "type": "string",
              "description": "How to respond to a below-target offer"
            },
            "initialResponseScript": {
              "type": "string",
              "description": "How to answer \"what are your salary expectations?\""
            },
            "leveragePoints": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Specific advantages the candidate has for negotiation"
            },
            "riskFactors": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Things that might limit negotiation leverage"
            }
          },
          "required": [
            "counterOfferScript",
            "initialResponseScript",
            "leveragePoints",
            "riskFactors"
          ],
          "additionalProperties": false
        },
        "salaryRange": {
          "type": "object",
          "properties": {
            "currency": {
              "type": "string"
            },
            "high": {
              "type": [
                "number",
                "null"
              ]
            },
            "low": {
              "type": [
                "number",
                "null"
              ]
            },
            "median": {
              "type": [
                "number",
                "null"
              ]
            },
            "source": {
              "type": "string",
              "description": "How this range was estimated (JD signals, role level, industry benchmarks)"
            }
          },
          "required": [
            "currency",
            "high",
            "low",
            "median",
            "source"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "companyCompReputation",
        "geographicFactors",
        "levelAnalysis",
        "marketDemand",
        "negotiationInsights",
        "salaryRange"
      ]
    },
    "meta": {
      "$ref": "#/$defs/ResponseMetadata"
    },
    "success": {
      "type": "boolean",
      "enum": [
        true
      ]
    }
  },
  "required": [
    "data",
    "success"
  ],
  "additionalProperties": false,
  "$defs": {
    "ResponseMetadata": {
      "type": "object",
      "properties": {
        "duration": {
          "type": "number",
          "minimum": 0,
          "description": "Request duration in milliseconds"
        },
        "performance": {
          "type": "object",
          "properties": {
            "dbQueries": {
              "type": "integer",
              "minimum": 0
            },
            "totalDbTime": {
              "type": "number",
              "minimum": 0
            }
          },
          "description": "Performance metrics (preview/local only)"
        },
        "requestId": {
          "type": "string",
          "description": "Unique request identifier"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp"
        },
        "version": {
          "type": "string",
          "description": "API version"
        }
      }
    }
  }
}