{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prospectapis/json-schema/prospectapis-company-schema.json",
  "title": "Company",
  "description": "A cited company record. Every field carries its source and basis; a field no source supports is null.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prospectapis-companies-api-openapi.yml#/components/schemas/Company",
  "type": "object",
  "required": [
    "company_id",
    "domain",
    "sources"
  ],
  "properties": {
    "company_id": {
      "type": "string",
      "format": "uuid"
    },
    "domain": {
      "type": "string"
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "allOf": [
        {
          "$ref": "#/$defs/CompanyField"
        }
      ],
      "nullable": true
    },
    "hq": {
      "allOf": [
        {
          "$ref": "#/$defs/CompanyField"
        }
      ],
      "nullable": true,
      "description": "Headquarters (country, region, city) with its source."
    },
    "founded_year": {
      "allOf": [
        {
          "$ref": "#/$defs/CompanyField"
        }
      ],
      "nullable": true
    },
    "industry": {
      "allOf": [
        {
          "$ref": "#/$defs/CompanyField"
        }
      ],
      "nullable": true,
      "description": "Industry label and code, marked inferred when classified."
    },
    "employee_band": {
      "allOf": [
        {
          "$ref": "#/$defs/CompanyField"
        }
      ],
      "nullable": true,
      "description": "Headcount band where a source states it (an open-role count is a hiring signal, never headcount)."
    },
    "social": {
      "allOf": [
        {
          "$ref": "#/$defs/CompanyField"
        }
      ],
      "nullable": true,
      "description": "Social links (x, linkedin) resolved from the company's own site."
    },
    "funding": {
      "type": [
        "object",
        "null"
      ],
      "description": "A rollup of the funding rounds we hold for this domain (total raised, rounds count, last round)."
    },
    "hiring": {
      "allOf": [
        {
          "$ref": "#/$defs/CompanyField"
        }
      ],
      "nullable": true,
      "description": "A careers URL; an open-role count is labelled a hiring signal, never headcount."
    },
    "sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CompanySource"
      }
    },
    "retrieved_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "$defs": {
    "CompanyField": {
      "type": "object",
      "description": "One profile field with its provenance. `source` indexes into the record's `sources`; `basis` is `stated` (a page states the value) or `inferred` (classified from a page). A field no source supports is null, never guessed.",
      "required": [
        "value",
        "source"
      ],
      "properties": {
        "value": {
          "description": "The field's value (type depends on the field), or null."
        },
        "source": {
          "type": "integer",
          "description": "The id of the entry in `sources` this value was read from."
        },
        "basis": {
          "type": "string",
          "enum": [
            "stated",
            "inferred"
          ],
          "description": "Whether a page states the value or it was classified from a page."
        }
      }
    },
    "CompanySource": {
      "type": "object",
      "required": [
        "id",
        "url",
        "kind"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "kind": {
          "type": "string",
          "description": "The kind of source, for example `site`, `jsonld`, `funding`, `linkedin` or `sec`."
        },
        "retrieved_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}