{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendraven-ai/json-schema/sendraven-ai-contact-schema.json",
  "title": "Contact",
  "description": "A person, stored once per workspace and keyed on the address; audience_ids lists every list they are on. serializeContact in api-server/src/serialize.ts.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sendraven-ai-audiences-api-openapi.yml#/components/schemas/Contact",
  "type": "object",
  "required": [
    "id",
    "email",
    "first_name",
    "last_name",
    "audience_ids",
    "tags",
    "attributes",
    "unsubscribed",
    "unsubscribed_at",
    "last_opened_at",
    "last_clicked_at",
    "last_sent_at",
    "last_active_at",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "The id every contact path takes, not the address."
    },
    "email": {
      "type": "string",
      "format": "email",
      "description": "Trimmed and lower-cased. Unique within the workspace."
    },
    "first_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "audience_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "description": "Every audience this person is on. Can be empty: leaving the last list does not delete the contact."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Lower-cased, spaces turned into hyphens. Empty when none."
    },
    "attributes": {
      "type": "object",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          }
        ]
      },
      "description": "Custom property values by key. Empty object when none."
    },
    "unsubscribed": {
      "type": "boolean",
      "description": "Opted out of marketing. Campaigns and segments skip anyone with true; transactional mail still reaches them."
    },
    "unsubscribed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "last_opened_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "From open tracking. A security scanner's automated opens are not counted."
    },
    "last_clicked_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "From click tracking. A security scanner's automated clicks are not counted."
    },
    "last_sent_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Last time a message to this address was accepted for delivery. Read by exclude_unengaged_days."
    },
    "last_active_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Last activity in your product, as you set it. Read by engaged_within_days. Never moves backwards."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the person was first added to the workspace."
    }
  }
}