{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/clearpolicy-app/json-schema/clearpolicy-app-person-schema.json",
  "title": "Person",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/clearpolicy-app-api-openapi.json#/components/schemas/Person",
  "type": "object",
  "required": [
    "id",
    "organization_id",
    "first_name",
    "last_name",
    "name",
    "email",
    "source",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "The ULID of the person."
    },
    "organization_id": {
      "type": "string",
      "description": "The ULID of the organization."
    },
    "first_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The person's first name, if provided."
    },
    "last_name": {
      "type": "string",
      "description": "The person's last name."
    },
    "name": {
      "type": "string",
      "description": "The full name assembled from first_name and last_name."
    },
    "email": {
      "type": "string",
      "format": "email",
      "description": "The email address of the person."
    },
    "phone": {
      "type": [
        "string",
        "null"
      ],
      "description": "The phone number in international format, or null."
    },
    "source": {
      "type": "string",
      "enum": [
        "oauth",
        "web",
        "system",
        "planning_center"
      ],
      "description": "How the person was created."
    },
    "source_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "An external identifier from the originating system, or null."
    },
    "archived_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the person was archived, or null if active."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the person was created."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the person was last updated."
    }
  }
}