latestOpenAPI 3.1.0MIT2026-08-177111141.8 KB

c4c26e52b406

Messages

Send a batch of messages

Send a message to multiple recipients. Parameter variables can be included in all string fields and customized with recipient specific values. Each recipient in the request will generate a message and subsequent delivery reports based on the channel used.

post/v1/projects/{project_id}/messages

Request body

app_idstring required

The ID of the app sending the message.

processing_strategy'DEFAULT' | 'DISPATCH_ONLY'

Overrides the app's Processing Mode. Default value is DEFAULT.

batch_metadataobject

Custom metadata that will be attached to the batch itself and returned in the response. This metadata can later be used to manage the batch. For example, you can use the metadata to cancel it. Note: batchId is a reserved field that should not be included in this object, as it will be automatically added by the API. The maximum length of this map, when parsed as a JSON string, cannot exceed 2048 characters.

message_metadataobject

Optional metadata that will be associated with the messages generated by the batch. Returned in the metadata field of a Message Delivery Receipt. This map is converted to a JSON string for compatibility with the Conversation API. See Conversation API metadata for details. The maximum length of this map, when parsed as a JSON string, cannot exceed 1024 characters.

conversation_metadataobject

Metadata that will be associated with the conversation of each message in the batch. This metadata will be included in delivery receipts and can be used to correlate MO (mobile originated) messages with the original batch. See Conversation API metadata reference for details.

send_afterstring date-time

Specifies when the batch should be sent. If not provided, it defaults to the current time and sends immediately. The value must be in UTC. If the scheduled time is less than 1 minute from the API call, it will be used as-is (with second-level precision). For times further in the future, the value will be rounded up to the next five-minute mark. The maximum allowed delay is 7 days. The final send_after value is returned in the response.

callback_urlstring

Overwrites the default callback url for delivery receipts for messages in this batch. Note that you may define a secret_for_overridden_callback_urls at the app level; this secret will be used to sign the contents of delivery receipts when the default callback URL is overridden by this property. The REST URL should be of the form: http://host[:port]/path or https://host[:port]/path

channel_priority_orderConversationChannel[]

Defines the channels to use for message delivery and the order in which they will be attempted. See Conversation API reference for details.

ttlstring

The timeout allotted for sending the message, expressed in seconds. Passed to channels which support it and emulated by the Conversation API for channels without ttl support but with message retract/unsend functionality. Channel failover will not be performed for messages with an expired TTL.

The format is an integer with the suffix s (for seconds). Valid integer range is 3 to 315,576,000,000 (inclusive). Example values include 10s (10 seconds) and 86400s (24 hours).

channel_propertiesobject

Channel-specific properties. The key in the map must point to a valid channel property and the maximum allowed property value length is 1024 characters.

correlation_idstring

An arbitrary identifier that will be propagated to callbacks related to this message, including MO messages from the recipient. The MO callbacks will always use the last correlation_id available in the conversation, similar to how conversation_metadata works. Only applicable to messages sent with the CONVERSATION processing mode. Up to 128 characters long.

Example request

{
  "message": {
    "card_message": {
      "choices": [
        {
          "call_message": {
            "phone_number": "+15551231234",
            "title": "Message text"
          }
        }
      ]
    }
  },
  "recipient_and_params": [
    {
      "recipient": {
        "identified_by": {
          "channel_identities": [
            {
              "channel": "WHATSAPP"
            }
          ]
        }
      }
    }
  ],
  "send_after": "2025-01-01T12:34:56Z",
  "channel_priority_order": [
    "WHATSAPP"
  ]
}

Response

OK

batch_idstring

The ID of the batch sent. This ID will be present in the metadata field of all the delivery receipts for messages generated from this batch request, with the key batchId.

send_afterstring date-time

Time at which the batch of messages will be sent to the recipients.

Example response

{
  "batch_id": "01GCA8RWNW9FVGVSYS1BMKRW80",
  "send_after": "2022-11-28T12:46:59Z"
}