Skip to navigation

Send batch

Sends SMS messages to up to 250 recipients in a single request, with the same text for the whole batch or a text per number. The send is asynchronous: the API validates the request, responds 202 Accepted immediately with a batch_id and one message_id per number (in the order of the request), and processes the numbers in the background.

text, has_accents and complement at the root are the batch defaults; each item of messages can override any of them. An item’s complement replaces the batch one entirely (link and ttl_events are not merged), and every number with a complement gets its own short link.

Numbers are validated against the mask in the background, so an invalid number does not reject the batch: it is reported with status INVALID_FORMAT (does not match the mask format), INVALID_SOURCE (not found in the numbering plan or not a mobile number) or OUTPUT_NOT_FOUND (no output for its operator).

webhook_mode selects the notifications: INDIVIDUAL (default) sends the regular status webhook per number, with an extra batch_id; BATCH sends a single batchStatus webhook once every number has a send result.

Authentication

x-api-keystring

Account authentication key. The App-Key must have the SMS channel enabled; it cannot be used against the endpoints of other channels.

OR
AuthorizationBearer

OAuth 2.0 access token issued by POST /api/oauth/token (client-credentials). Takes precedence over x-api-key when both are sent. See the Authentication section.

Request

This endpoint expects an object.
maskstringRequired

Sender mask identifier obtained through GET /v1/sms/masks. Applies to the whole batch.

messageslist of objectsRequired
textstringOptional

Default text of the batch. Required when any item of messages does not carry its own text.

has_accentsbooleanOptionalDefaults to false

Default encoding of the batch (see SendMessageRequest).

complementobjectOptional
Appends a trackable short link to the end of the message. The link is shortened and added to the text automatically before sending.
webhook_modeenumOptionalDefaults to INDIVIDUAL

INDIVIDUAL: the regular messageStatus webhook per number, with batch_id. BATCH: a single batchStatus webhook for the whole batch.

Allowed values:

Response

Batch accepted and queued. Store batch_id and the message_id of each number: they are the keys to correlate the webhooks.

statusCodeintegerOptional
message"ACCEPTED"Optional
batch_idstringOptional

Batch identifier; it comes in the webhooks of the batch.

webhook_modeenumOptional
Allowed values:
totalintegerOptional
Numbers received in the batch.
messageslist of objectsOptional
One entry per number, in the order of the request.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
413
Content Too Large Error
429
Too Many Requests Error
500
Internal Server Error