{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/osis-co/json-schema/osis-co-send-contact-card-request-schema.json",
  "title": "SendContactCardRequest",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/osis-co-openapi.json#/components/schemas/SendContactCardRequest",
  "type": "object",
  "properties": {
    "to": {
      "type": "string",
      "description": "Phone number to send to. Required unless you set contact_id or conversation_id. Use E.164, or set default_country for a local number."
    },
    "contact_id": {
      "type": "string",
      "description": "A contact you already have. Required unless you set to or conversation_id."
    },
    "conversation_id": {
      "type": "string",
      "description": "A conversation to send in. Required unless you set to or contact_id."
    },
    "agent_id": {
      "type": "string",
      "description": "Send this hosted agent's saved card. Any of name, phone, email, organization, note, or photo you leave out comes from the agent's card."
    },
    "name": {
      "type": "string",
      "description": "The name on the card. Required unless you set agent_id. Cut off at 80 characters."
    },
    "phone": {
      "type": "string",
      "description": "The phone number on the card, in E.164 format. Required unless you set agent_id."
    },
    "email": {
      "type": "string",
      "description": "An email for the card. With agent_id, defaults to the agent's email."
    },
    "organization": {
      "type": "string",
      "description": "A company name for the card."
    },
    "note": {
      "type": "string",
      "description": "A note for the card."
    },
    "photo_url": {
      "type": "string",
      "description": "An HTTPS link to a JPEG, PNG, or GIF, up to 200,000 bytes.",
      "format": "uri"
    },
    "photo_base64": {
      "type": "string",
      "description": "A JPEG, PNG, or GIF as base64 or a data:image/...;base64, URL. Up to 200,000 bytes."
    },
    "caption": {
      "type": "string",
      "description": "Text to send with the card. Leave it out to send just the card."
    },
    "channel": {
      "type": "string",
      "enum": [
        "auto",
        "sms",
        "imessage",
        "whatsapp"
      ],
      "default": "auto"
    },
    "default_country": {
      "type": "string",
      "description": "Country code, only needed if the number is local and has no country code."
    },
    "idempotency_key": {
      "type": "string",
      "description": "Same as the Idempotency-Key header. If you send both, the header wins."
    },
    "line_e164": {
      "type": "string",
      "description": "For WhatsApp: the number to send from, with WhatsApp turned on. Alias: from."
    }
  },
  "allOf": [
    {
      "anyOf": [
        {
          "required": [
            "to"
          ]
        },
        {
          "required": [
            "contact_id"
          ]
        },
        {
          "required": [
            "conversation_id"
          ]
        }
      ]
    },
    {
      "anyOf": [
        {
          "required": [
            "agent_id"
          ]
        },
        {
          "required": [
            "name",
            "phone"
          ]
        }
      ]
    }
  ]
}