The send batch messages endpoint allows sending a batch up to 100 messages to a channel. The messages are accepted for validation and processed asynchronously. Messages that fail validation are rejected, and the failure is attached to the message. The response will return a batch ID which can be used to retrieve the messages that were in the batch.
Authorizations
HTTPRequired
Uses the Authorization header: 'AccessKey ' followed by your access key token (e.g., 'Authorization: AccessKey AbCdEfGhIjKlMnOpQrStUvWxYzAbCdEfGhIj')
Path parameters
workspaceIdstring · uuidRequired
The ID of the workspace
channelIdstring · uuidRequired
The ID for a channel
Body
Array of messages to send to a channel. The batch can contain up to 100 messages.
Responses
202
Messages were accepted to be validated asynchronously and then processed.
application/json
400
The specified amount of messages in the batch is invalid.
In this example, we're sending multiple SMS messages to different receivers using variations of content.
Batch messages can be monitored using Retrieving messages endpoints by providing the batchID returned in the response. This allows you to check if any messages within the batch failed. Messages with a rejected status will emit events, containing detailed failure codes, enabling you to identify and address issues efficiently. For more details on how to subscribe to these events, refer to the Notifications API documentation.