{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rubiconnect/json-schema/rubiconnect-send-message-request-schema.json",
  "title": "SendMessageRequest",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rubiconnect-messages-api-openapi.yml#/components/schemas/SendMessageRequest",
  "type": "object",
  "required": [
    "agentId"
  ],
  "properties": {
    "recipient": {
      "type": "string",
      "description": "Destination phone number in E.164 format. Required for single send if contactsUrl is not specified."
    },
    "contactsUrl": {
      "type": "string",
      "description": "Pre-signed HTTPS CSV or JSONL URL to stream contacts from with zero database persistence."
    },
    "urlFormat": {
      "type": "string",
      "enum": [
        "csv",
        "jsonl"
      ],
      "description": "Format of contactsUrl file.",
      "default": "csv"
    },
    "agentId": {
      "type": "string",
      "description": "The registered agent identifier."
    },
    "text": {
      "type": "string",
      "description": "Plain text message content. Mutually exclusive with mediaUrl and templateId."
    },
    "mediaUrl": {
      "type": "string",
      "description": "Public URL pointing to a media attachment. Mutually exclusive with text and templateId."
    },
    "templateId": {
      "type": "string",
      "description": "The pre-configured rich template ID. Mutually exclusive with text and mediaUrl."
    },
    "contentVariables": {
      "type": "object",
      "description": "Key-value pair map to interpolate variables inside messages or templates.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "allowSmsFallback": {
      "type": "boolean",
      "description": "Whether to fallback to SMS if recipient handset lacks RCS capability.",
      "default": false
    },
    "callbackUrl": {
      "type": "string",
      "description": "Custom webhook URL to receive status callbacks specifically for this message."
    }
  }
}