Skip to navigation

Send message

Sends an SMS message to a recipient using a mask of the account. The send is asynchronous: the API responds 202 Accepted immediately with a message_id; the message status (SENT, or an error status such as FAILED) is notified later through the status webhook, correlated by that message_id.

When the text contains characters outside the GSM-7 alphabet (accents, ñ, emoji), send has_accents: true so the message is encoded in UCS-2; this reduces the maximum size per segment. When a complement is sent, a trackable short link is generated and automatically appended to the end of the text before sending.

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.

tostringRequiredformat: "^\+?\d{8,15}$"

Destination number; the mask decides how it is read. National mask: 10 digits, also accepted with the Mexico country code 52/+52 or 521/+521 (for example, 525555555555, +5215555555555), which is removed before sending. International mask (is_international: true in GET /v1/sms/masks): E.164 with or without +, always with the country code.

textstringRequired
Text of the message.
has_accentsbooleanOptionalDefaults to false

Send true when the text contains accents, ñ, or other characters outside the GSM-7 alphabet. The message is encoded in UCS-2, which reduces the maximum size per segment.

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

Response

Message accepted and queued for delivery. Store message_id: it is the key to correlate the status webhooks of this send.

statusCodeintegerOptional
message"ACCEPTED"Optional
Initial status of the send.
message_idstringOptionalformat: "uuid"

Send identifier. Store it: it is the key to correlate the status webhooks of this send.

Errors

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