{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendraven-ai/json-schema/sendraven-ai-import-contact-schema.json",
  "title": "ImportContact",
  "description": "One contact as the API accepts it (contactSchema in api-server/src/contact-input.ts). Adding is an upsert on the address: an existing person joins the list, names are overwritten only by a non-empty value, tags are added (never removed) and attributes merge key by key.",
  "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/ImportContact",
  "type": "object",
  "required": [
    "email"
  ],
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "description": "Stored trimmed and lower-cased."
    },
    "first_name": {
      "type": "string",
      "maxLength": 120
    },
    "last_name": {
      "type": "string",
      "maxLength": 120
    },
    "tags": {
      "type": "array",
      "maxItems": 50,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 60
      },
      "description": "Added to the person's existing tags. Lower-cased and trimmed; whitespace runs become a hyphen."
    },
    "attributes": {
      "type": "object",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          }
        ]
      },
      "propertyNames": {
        "minLength": 1,
        "pattern": "^(?!\\$)[^.\\u0000]+$"
      },
      "description": "Custom property values by key; each value a string, number or boolean. Keys cannot be empty, contain \".\" or a null character, or start with \"$\"; such a key is refused with 422 (message starting \"attributes:\") before anything is written. Each value is coerced to the type of its declared contact property (GET /v1/contact-properties). A key with no declared property creates one with type string, and its value is then stored as a string (5 becomes \"5\"): declare number and boolean properties before importing."
    },
    "status": {
      "type": "string",
      "enum": [
        "subscribed",
        "unsubscribed",
        "bounced",
        "complained"
      ],
      "default": "subscribed",
      "description": "Standing with the previous sender. unsubscribed sets the flag and writes a marketing-scoped suppression; bounced and complained set the flag and suppress all mail. Any of the three also cancels pending scheduled sends and ends active automation enrolments. An add never resubscribes: subscribed leaves an already-unsubscribed contact as it is."
    },
    "unsubscribed": {
      "type": "boolean",
      "description": "true is a synonym for status: unsubscribed. Ignored when status is sent."
    },
    "last_active_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the person was last active in your product, with a time zone. Counted by a segment's engaged_within_days. Kept only if later than the stored value; more than a day ahead is refused."
    }
  }
}