{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/customer-io/main/json-schema/customer-io-identify-person-schema.json",
  "title": "Person: Identify",
  "description": "Add or update a person.",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/customer-io-track-v2-api-openapi.yml#/components/schemas/identify_person",
  "allOf": [
    {
      "$ref": "#/$defs/person_common"
    },
    {
      "type": "object",
      "required": [
        "action"
      ],
      "properties": {
        "action": {
          "type": "string",
          "description": "Indicates that the operation will `identify` the the item of the specified `type`.",
          "enum": [
            "identify"
          ]
        },
        "timestamp": {
          "type": "integer",
          "description": "The Unix timestamp for when the attribute update occurred. This can be used to control the order of attribute updates when multiple requests are sent in rapid succession."
        },
        "attributes": {
          "type": "object",
          "description": "Attributes that you want to add or update for this person. You can pass properties that aren't defined below to set custom attributes; the defined properties are reserved in the Customer.io Track API.",
          "properties": {
            "cio_subscription_preferences": {
              "$ref": "#/$defs/cio_subscription_preferences"
            },
            "_update": {
              "type": "boolean",
              "default": false,
              "description": "If `true`, update only existing people and prevent accidental profile creation. If no person matches the identifiers, the request does nothing."
            }
          },
          "additionalProperties": {
            "x-additionalPropertiesName": "additional attributes",
            "description": "Custom properties that you want to set as attributes on this person."
          }
        },
        "cio_relationships": {
          "$ref": "#/$defs/object_relationships"
        }
      }
    }
  ],
  "$defs": {
    "cio_id": {
      "x-scalar-ignore": true,
      "type": "string",
      "description": "A unique identifier set by Customer.io, used to reference a person if you want to update their identifiers."
    },
    "cio_subscription_preferences": {
      "x-scalar-ignore": true,
      "description": "A person's [subscription center](/journeys/channels/subscriptions/center/) preferences. Use JSON dot notation, such as `cio_subscription_preferences.topics.topic_<id>`, to update one topic without replacing others.",
      "type": "object",
      "properties": {
        "topics": {
          "type": "object",
          "description": "Contains active topics in your workspace, named `topic_<id>`.",
          "additionalProperties": {
            "x-additionalPropertiesName": "topic_<id>",
            "description": "Boolean preference for a topic named `topic_<id>`; `true` subscribes, `false` unsubscribes, and empty or missing values use the topic default. Find topic IDs with [getTopics](#tag/subscription-center/getTopics).",
            "type": "boolean"
          }
        }
      }
    },
    "not_nullable_customer_id": {
      "x-scalar-ignore": true,
      "type": "string",
      "description": "The ID of a customer profile, analogous to a \"person\" in the UI."
    },
    "not_nullable_email_address": {
      "x-scalar-ignore": true,
      "type": "string",
      "description": "The email address of the customer."
    },
    "object_identifiers": {
      "x-scalar-ignore": true,
      "type": "object",
      "properties": {
        "identifiers": {
          "description": "The identifiers for a particular object. You can use either the `object_type_id` and `object_id` (where `object_type_id` represents the type of object and the `object_id` is the individual identifier for the object) or the `cio_object_id`.",
          "oneOf": [
            {
              "title": "Object ID",
              "type": "object",
              "required": [
                "object_type_id",
                "object_id"
              ],
              "properties": {
                "object_type_id": {
                  "$ref": "#/$defs/object_type_id"
                },
                "object_id": {
                  "type": "string",
                  "description": "The unique identifier for an object. If you use an `object_id` that already exists, we'll update the object accordingly."
                }
              }
            },
            {
              "title": "CIO Object ID",
              "type": "object",
              "required": [
                "cio_object_id"
              ],
              "properties": {
                "cio_object_id": {
                  "type": "string",
                  "description": "A unique value that Customer.io sets for an object when you create it. This ID is immutable."
                }
              }
            }
          ]
        }
      }
    },
    "object_relationships": {
      "x-scalar-ignore": true,
      "type": "array",
      "description": "Each object in the array represents a relationship you want to add to, or remove from, a person.",
      "items": {
        "allOf": [
          {
            "$ref": "#/$defs/object_identifiers"
          },
          {
            "type": "object",
            "properties": {
              "relationship_attributes": {
                "$ref": "#/$defs/relationship_attributes"
              }
            }
          }
        ]
      }
    },
    "object_type_id": {
      "x-scalar-ignore": true,
      "type": "string",
      "description": "The object type an object belongs to—like \"Companies\" or \"Accounts\". Object type IDs are string-formatted integers that begin at `1` and increment for each new type."
    },
    "person_common": {
      "x-scalar-ignore": true,
      "type": "object",
      "required": [
        "type",
        "identifiers"
      ],
      "properties": {
        "type": {
          "description": "The operation modifies a person in Customer.io",
          "type": "string",
          "enum": [
            "person"
          ]
        },
        "identifiers": {
          "description": "The person you want to perform an action for—one of `id`, `email`, `phone`, or `cio_id`. You cannot pass multiple identifiers. You can use `email` and `phone` only if they're enabled as identifiers in your [workspace settings](/accounts/workspaces/overview/#migrate-workspace).",
          "oneOf": [
            {
              "title": "id",
              "type": "object",
              "required": [
                "id"
              ],
              "properties": {
                "id": {
                  "$ref": "#/$defs/not_nullable_customer_id"
                }
              }
            },
            {
              "title": "email",
              "type": "object",
              "required": [
                "email"
              ],
              "properties": {
                "email": {
                  "$ref": "#/$defs/not_nullable_email_address"
                }
              }
            },
            {
              "title": "phone",
              "type": "object",
              "required": [
                "phone"
              ],
              "properties": {
                "phone": {
                  "type": "string",
                  "description": "A person's phone number, in [E.164 format](https://en.wikipedia.org/wiki/E.164) (a leading `+` followed by up to 15 digits). Available only when `phone` is enabled as an identifier in your workspace."
                }
              }
            },
            {
              "title": "cio_id",
              "type": "object",
              "required": [
                "cio_id"
              ],
              "properties": {
                "cio_id": {
                  "$ref": "#/$defs/cio_id"
                }
              }
            }
          ]
        }
      }
    },
    "relationship_attributes": {
      "x-scalar-ignore": true,
      "type": "object",
      "description": "The attributes associated with a relationship. Passing null or an empty string removes the attribute from the relationship.\n",
      "additionalProperties": {
        "x-additionalPropertiesName": "Relationship Attributes"
      }
    }
  }
}