{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/copper-financial/json-schema/copper-financial-custom-field-definition-schema.json",
  "title": "CustomFieldDefinition",
  "description": "Custom fields are available on all main objects: Leads, People, Companies, Opportunities, Projects, and Tasks. Custom fields can have various data types including text, dropdown, date, currency, percentage, etc.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/copper-financial-custom-fields-api-openapi.yml#/components/schemas/CustomFieldDefinition",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Unique identifier for the custom field definition"
    },
    "name": {
      "type": "string",
      "description": "Name of the custom field"
    },
    "canonical_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Canonical name for the custom field"
    },
    "data_type": {
      "type": "string",
      "description": "Data type of the custom field",
      "enum": [
        "String",
        "Text",
        "Dropdown",
        "MultiSelect",
        "Date",
        "Checkbox",
        "Float",
        "URL",
        "Percentage",
        "Currency",
        "Connect"
      ]
    },
    "available_on": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "lead",
          "person",
          "company",
          "opportunity",
          "project",
          "task"
        ]
      },
      "description": "Array of entity types this field is available on"
    },
    "options": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The option ID"
          },
          "name": {
            "type": "string",
            "description": "The option name/value"
          },
          "rank": {
            "type": "integer",
            "description": "The display order of the option"
          }
        }
      },
      "description": "Available options for Dropdown and MultiSelect field types"
    },
    "currency": {
      "type": [
        "string",
        "null"
      ],
      "description": "Currency code for Currency field types"
    }
  },
  "required": [
    "id",
    "name",
    "data_type",
    "available_on"
  ]
}