{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentisend-com/json-schema/agentisend-com-post-contacts-body-schema.json",
  "title": "PostContactsBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentisend-com-contacts-api-openapi.yml#/components/schemas/PostContactsBody",
  "properties": {
    "audience_id": {
      "description": "A segment on this account. The contact is added to it. A value that is not an audience id is accepted and adds nothing.",
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    },
    "consent": {
      "description": "Optional consent provenance for this address. Stored, shown and exported; never a reason to refuse.",
      "properties": {
        "at": {
          "description": "When they agreed, as UTC. Defaults to now.",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
          "type": "string"
        },
        "double_opt_in_confirmed_at": {
          "description": "When a confirmation email or click completed double opt-in.",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
          "type": "string"
        },
        "ip": {
          "description": "The IP address the agreement was captured from, if known.",
          "maxLength": 64,
          "type": "string"
        },
        "source": {
          "description": "Where and how the person agreed — for example \"signup form\" or \"imported list, existing customer\".",
          "maxLength": 200,
          "minLength": 1,
          "type": "string"
        },
        "text": {
          "description": "The exact wording they agreed to, if it is on file.",
          "maxLength": 2000,
          "type": "string"
        }
      },
      "required": [
        "source"
      ],
      "type": "object"
    },
    "email": {
      "description": "The contact address. An existing address is updated.",
      "format": "email",
      "maxLength": 320,
      "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
      "type": "string"
    },
    "first_name": {
      "anyOf": [
        {
          "maxLength": 1000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Given name. Null clears it."
    },
    "last_name": {
      "anyOf": [
        {
          "maxLength": 1000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Family name. Null clears it."
    },
    "properties": {
      "additionalProperties": {},
      "description": "Named values stored on the contact. A new name is created.",
      "propertyNames": {
        "type": "string"
      },
      "type": "object"
    },
    "segments": {
      "description": "Segments to add the contact to. Each must be a segment on this account.",
      "items": {
        "properties": {
          "id": {
            "description": "The segment id.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "maxItems": 100,
      "type": "array"
    },
    "status": {
      "description": "active, or unsubscribed to stop marketing mail.",
      "enum": [
        "active",
        "unsubscribed"
      ],
      "type": "string"
    },
    "topics": {
      "description": "Topic subscriptions to record for the contact. Each must be a topic on this account.",
      "items": {
        "properties": {
          "id": {
            "description": "The topic id.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "subscription": {
            "description": "opt_in subscribes the contact. opt_out unsubscribes them.",
            "enum": [
              "opt_in",
              "opt_out"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "subscription"
        ],
        "type": "object"
      },
      "maxItems": 100,
      "type": "array"
    },
    "unsubscribed": {
      "description": "true stops marketing mail to this address.",
      "type": "boolean"
    }
  },
  "required": [
    "email"
  ],
  "type": "object"
}