{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cogram-com/json-schema/cogram-com-contact-company-link-list-v1-schema.json",
  "title": "ContactCompanyLinkListV1",
  "description": "Paginated list of proposed contact-to-company links.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cogram-com-directory-api-openapi.yml#/components/schemas/ContactCompanyLinkListV1",
  "properties": {
    "data": {
      "items": {
        "$ref": "#/$defs/ContactCompanyLinkV1"
      },
      "type": "array",
      "title": "Data"
    },
    "total": {
      "type": "integer",
      "title": "Total",
      "description": "Total matches across all pages, not just this page."
    },
    "page": {
      "type": "integer",
      "title": "Page"
    },
    "page_size": {
      "type": "integer",
      "title": "Page Size"
    }
  },
  "type": "object",
  "required": [
    "data",
    "total",
    "page",
    "page_size"
  ],
  "$defs": {
    "CompanyRefV1": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "CompanyRefV1",
      "description": "A company named in a proposed link."
    },
    "ContactCompanyLinkV1": {
      "properties": {
        "contact_id": {
          "type": "string",
          "title": "Contact Id"
        },
        "primary_email": {
          "type": "string",
          "title": "Primary Email"
        },
        "first_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "First Name"
        },
        "last_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Name"
        },
        "domain": {
          "type": "string",
          "title": "Domain",
          "description": "Domain of `primary_email`, lowercased."
        },
        "company": {
          "$ref": "#/$defs/CompanyRefV1",
          "description": "The company that would be linked: the oldest non-archived company listing `domain` in its email domains."
        },
        "also_claiming": {
          "items": {
            "$ref": "#/$defs/CompanyRefV1"
          },
          "type": "array",
          "title": "Also Claiming",
          "description": "Other non-archived companies listing `domain`, in the order they lost to `company`. Normally empty; when it is not, review before applying — the domain is on more than one company."
        }
      },
      "type": "object",
      "required": [
        "contact_id",
        "primary_email",
        "first_name",
        "last_name",
        "domain",
        "company",
        "also_claiming"
      ],
      "title": "ContactCompanyLinkV1",
      "description": "One contact with no company, and the company its email domain points at."
    }
  }
}