{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/companyenrich/json-schema/companyenrich-company-workforce-response2-schema.json",
  "title": "CompanyWorkforceResponse2",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/companyenrich-openapi.json#/components/schemas/CompanyWorkforceResponse2",
  "required": [
    "companyId",
    "domain",
    "observedEmployeeCount",
    "departmentHeadcount",
    "unclassifiedHeadcount",
    "historyFrom",
    "historyTo"
  ],
  "type": "object",
  "properties": {
    "companyId": {
      "type": "string",
      "description": "The CompanyEnrich ID of the company",
      "format": "uuid"
    },
    "domain": {
      "type": "string",
      "description": "The canonical company domain"
    },
    "observedEmployeeCount": {
      "type": "integer",
      "description": "The observed number of distinct current employees in the people dataset",
      "format": "int32"
    },
    "employeeCountRange": {
      "$ref": "#/$defs/NullableOfCompanyEmployees"
    },
    "departmentHeadcount": {
      "$ref": "#/$defs/CompanyWorkforceDepartmentResponse"
    },
    "unclassifiedHeadcount": {
      "type": "integer",
      "description": "Observed headcount that could not be classified by department",
      "format": "int32"
    },
    "historyFrom": {
      "type": "string",
      "description": "The inclusive first month of the returned 12-month history window",
      "format": "date"
    },
    "historyTo": {
      "type": "string",
      "description": "The exclusive end of the returned 12-month history window",
      "format": "date"
    },
    "history": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/CompanyWorkforceHistoryResponse"
      },
      "description": "Workforce change points within the history window, newest first. A point at the start carries forward the last known earlier headcount when available."
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Pass this cursor with the company ID or domain to GET /v2/companies/workforce to fetch the preceding year for 1 credit. Omitted when no older history is available. Expires 30 minutes after the first page."
    }
  },
  "$defs": {
    "CompanyWorkforceDepartmentResponse": {
      "type": "object",
      "properties": {
        "cSuite": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed c-suite headcount",
          "format": "int32"
        },
        "productManagement": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed product management headcount",
          "format": "int32"
        },
        "engineeringTechnical": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed engineering and technical headcount",
          "format": "int32"
        },
        "design": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed design headcount",
          "format": "int32"
        },
        "education": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed education headcount",
          "format": "int32"
        },
        "finance": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed finance headcount",
          "format": "int32"
        },
        "humanResources": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed human resources headcount",
          "format": "int32"
        },
        "informationTechnology": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed information technology headcount",
          "format": "int32"
        },
        "legal": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed legal headcount",
          "format": "int32"
        },
        "marketing": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed marketing headcount",
          "format": "int32"
        },
        "medicalHealth": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed medical and health headcount",
          "format": "int32"
        },
        "operations": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed operations headcount",
          "format": "int32"
        },
        "sales": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed sales headcount",
          "format": "int32"
        },
        "consulting": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Observed consulting headcount",
          "format": "int32"
        }
      },
      "description": "Observed headcount grouped by department"
    },
    "CompanyWorkforceHistoryResponse": {
      "required": [
        "date",
        "observedEmployeeCount",
        "departmentHeadcount",
        "unclassifiedHeadcount"
      ],
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "description": "The first day of the snapshot month",
          "format": "date"
        },
        "observedEmployeeCount": {
          "type": "integer",
          "description": "The observed number of distinct employees in the people dataset",
          "format": "int32"
        },
        "employeeCountRange": {
          "$ref": "#/$defs/NullableOfCompanyEmployees"
        },
        "departmentHeadcount": {
          "$ref": "#/$defs/CompanyWorkforceDepartmentResponse"
        },
        "unclassifiedHeadcount": {
          "type": "integer",
          "description": "Observed headcount that could not be classified by department",
          "format": "int32"
        }
      }
    },
    "NullableOfCompanyEmployees": {
      "enum": [
        "1-10",
        "11-50",
        "51-200",
        "201-500",
        "501-1K",
        "1K-5K",
        "5K-10K",
        "over-10K",
        null
      ],
      "description": "The estimated employee count range",
      "nullable": true
    }
  }
}