{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/copper-financial/main/json-schema/copper-financial-company-schema.json",
  "title": "Company",
  "x-generated": "2026-10-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/copper-financial-openapi.json#/components/schemas/Company",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Unique identifier for the company"
    },
    "name": {
      "type": "string",
      "description": "The name of the company"
    },
    "address": {
      "type": [
        "object",
        "null"
      ],
      "description": "An encapsulation of the company's street, city, state, postal code, and country",
      "properties": {
        "street": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "postal_code": {
          "type": "string"
        },
        "country": {
          "type": "string"
        }
      }
    },
    "assignee_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Unique identifier of the user that will be the owner of the company"
    },
    "contact_type_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The unique identifier of the contact type of the company"
    },
    "details": {
      "type": [
        "string",
        "null"
      ],
      "description": "Description of the company"
    },
    "email_domain": {
      "type": [
        "string",
        "null"
      ],
      "description": "The domain to which email addresses for the company belong. This is a unique key for companies - no two records can have the same domain name."
    },
    "phone_numbers": {
      "type": "array",
      "description": "An array of phone numbers belonging to the company",
      "items": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "description": "A phone number"
          },
          "category": {
            "type": "string",
            "description": "The category of the phone number"
          }
        }
      }
    },
    "primary_contact_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The unique identifier of the person who is the primary contact for this company"
    },
    "socials": {
      "type": "array",
      "description": "An array of social profiles belonging to the company",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "The URL of a social profile"
          },
          "category": {
            "type": "string",
            "description": "The category of the social profile"
          }
        }
      }
    },
    "tags": {
      "type": "array",
      "description": "An array of the tags associated with the company",
      "items": {
        "type": "string"
      }
    },
    "websites": {
      "type": "array",
      "description": "An array of websites belonging to the company",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "The URL of a website"
          },
          "category": {
            "type": "string",
            "description": "The category of the website"
          }
        }
      }
    },
    "custom_fields": {
      "type": "array",
      "description": "An array of custom field values belonging to the company. When custom_field_computed_values query parameter is true, each field will include a computed_value with human-readable labels for Dropdown and Multi-select fields.",
      "items": {
        "type": "object",
        "properties": {
          "custom_field_definition_id": {
            "type": "integer",
            "description": "The id of the custom field definition for which this custom field stores a value"
          },
          "value": {
            "description": "The value (number, string, option id, or timestamp) of this custom field",
            "nullable": true
          },
          "computed_value": {
            "description": "The human-readable value of this custom field. For Dropdown/Multi-select fields, this contains the option label(s) instead of IDs. Only present when custom_field_computed_values=true is specified.",
            "nullable": true
          }
        }
      }
    },
    "interaction_count": {
      "type": "integer",
      "description": "The number of interactions with this company"
    },
    "date_created": {
      "type": "integer",
      "description": "A Unix timestamp representing the time at which this company was created"
    },
    "date_modified": {
      "type": "integer",
      "description": "A Unix timestamp representing the time at which this company was last modified"
    }
  },
  "required": [
    "id",
    "name"
  ]
}