{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/popp/json-schema/popp-custom-field-schema.json",
  "title": "CustomField",
  "description": "A custom field definition for an organization. Custom fields let you add your own typed, filterable attributes to candidate profiles.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/popp-custom-fields-beta-api-openapi.yml#/components/schemas/CustomField",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Field ID",
      "description": "Unique identifier for the custom field."
    },
    "organizationId": {
      "type": "string",
      "format": "uuid",
      "title": "Organization ID",
      "description": "The organization the field belongs to."
    },
    "fieldKey": {
      "type": "string",
      "title": "Field Key",
      "description": "Your stable key for the field, unique among the organization's active fields (e.g. \"clearanceLevel\")."
    },
    "label": {
      "type": "string",
      "title": "Label",
      "description": "Human-readable display name for the field."
    },
    "type": {
      "type": "string",
      "enum": [
        "TEXT",
        "TEXT_ARRAY",
        "NUMBER",
        "DATE",
        "BOOLEAN"
      ],
      "title": "Type",
      "description": "The field's data type. Immutable after creation."
    },
    "hasFixedOptions": {
      "type": "boolean",
      "title": "Has Fixed Options",
      "description": "When true, values are constrained to `allowedValues` (a dropdown). When false, the field accepts free input."
    },
    "allowedValues": {
      "type": [
        "array",
        "null"
      ],
      "title": "Allowed Values",
      "description": "The permitted values when `hasFixedOptions` is true; null or omitted otherwise.",
      "items": {
        "type": "string"
      }
    },
    "displayAs": {
      "type": "string",
      "enum": [
        "DATE",
        "AGE"
      ],
      "title": "Display As",
      "description": "How the value is displayed. `AGE` shows a `DATE` field as a whole-number age in years; the stored value is still the date. `DATE` for every other field."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "When the field was created (ISO 8601)."
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At",
      "description": "When the field was last updated (ISO 8601)."
    }
  },
  "required": [
    "id",
    "organizationId",
    "fieldKey",
    "label",
    "type",
    "hasFixedOptions",
    "allowedValues",
    "displayAs",
    "createdAt",
    "updatedAt"
  ],
  "additionalProperties": false
}