Name
Send a bulk SMS
Up to 100,000 destinations in one request, with a common text with variables or one text per destination. All or nothing against your balance.
HTTP method and path
/ api/ v6/ sms/ bulkhttps:
What happens when you run it
- Sends a message to a third party.
- The call is charged to your organization.
What it does
The body has two forms, never both at once: (a) a common text with {{nombre}}-style variables and, on each destination, its variables; or (b) a text on each destination. Each destination may carry its clientRef. Plus the marketing controls and schedulePolicy, which apply to the whole bulk send.
All or nothing against your balance. Each destination is validated and priced, and the cost of everything admitted is reserved at once: without balance for all of it, 402 and none is sent. A destination that is not valid (empty, no digits, a country not enabled for your account, a text that does not fit) is rejected on its own, with its index in rechazados, and the rest go on. What later cannot be charged (a number that cannot be identified, no rate) goes back to your balance within minutes.
Availability and prerequisites
- Published and available in the production API v6.
- Every path starts at
https:./ / developers. hablame. co - You need a Hablame API key to call it.
Authentication and permissions
- Send your API key in the
Authorizationheader with the Bearer scheme.
Who can call it: An API key with the sms service enabled.
Limits and operational notes
Usage limit: 60 requests per minute.
- Up to 100,000 destinations and 30 MiB per request. 100,001 is an error for the whole request, without charge.
Path parameters
This endpoint has no path parameters.
Query parameters
This endpoint has no query parameters.
HTTP headers
| Name | Type | Description and rules |
|---|---|---|
AuthorizationRequired | string | Your API key with the Bearer scheme. Example: |
Content-TypeRequired | string | Type of the body you send. Fixed value: |
Idempotency-KeyOptional | string | Optional and recommended idempotency key (1 to 255 characters from Pattern: |
Request body
Content type:application/jsonRequired
A field that does not exist is rejected with 400: a misspelled clientReff cannot pass as stored.
| Name | Type | Description and rules |
|---|---|---|
textOptional | string | Form (a): the common text, with |
recipientsRequired | array<object> | From 1 to 100,000 destinations. |
recipients[].Required | string | Mobile number in Colombia: the ten digits ( Maximum length: |
recipients[].Optional | string | Form (b): this destination’s text. Example: |
recipients[].Optional | object | Form (a): this destination’s variable values. |
recipients[].Optional | string | Your reference, optional: up to 36 characters (the length of a UUID). It is stored with the message and returned in the query. Do not write personal data (names, IDs, phone numbers): it is kept with the message record, which Hablame keeps for 5 years. Maximum length: |
fromOptional | string | Optional: the sender you want it to go out with, one of the ones allowed for your organization. Without it, it goes out with the default one of your list (or one from it), or with the Hablame shared code if your organization has no list. If you ask for one that is not on your list, your organization’s rule decides: it goes out with one from the list or it is rejected with Example: |
controlsOptional | object | The marketing controls, on by default: |
controls.Optional | boolean | Honor the marketing time window. Default value: |
controls.Optional | boolean | Check the do-not-contact registry. Default value: |
controls.Optional | boolean | Honor your own opt-outs. Default value: |
schedulePolicyOptional | string | What to do with what arrives outside the marketing window, with the Allowed values: |
certifiedOptional | boolean | Optional, Default value: |
campaignIdOptional | string | The campaign this bulk send joins: the Pattern: |
{
"text": "Hola {{nombre}}, tu pedido sale hoy.",
"recipients": [
{ "to": "3001234567", "variables": { "nombre": "Ana" }, "clientRef": "pedido-1" },
{ "to": "3012345678", "variables": { "nombre": "Luis" }, "clientRef": "pedido-2" }
]
}Successful responses
202
Bulk send received: the record and the object were written and what was admitted, reserved. With the same Idempotency-Key and the same body, it is the first response, with the same rejections.
{
"success": true,
"data": {
"batchId": "bat_3f1c0a9b2d7e4c58a6b1e0f9d2c3b4a5",
"campaignId": "cmp_9d4b2e7a1c3f5086b2a4d6e8f0a1b3c5",
"status": "accepted",
"recipients": 3,
"accepted": 2,
"rejections": [{ "index": 2, "reason": "foreign_destination" }],
"segments": 2,
"encodings": { "gsm7": 2, "ucs2": 0 },
"cost": { "amountMicro": 60000000, "currency": "COP" }
},
"meta": {
"requestId": "5d0f3a9c7b2e41a8",
"clientIp": "203.0.113.10",
"timestamp": "2026-10-26T10:30:00-05:00",
"responseTimeMs": 8.2
}
}The example values are illustrative.
Response fields
| Name | Type | Description and rules |
|---|---|---|
successAlways present | boolean | |
dataAlways present | object | A received bulk send: what was admitted, rejected and reserved. |
data.Always present | string | Bulk send identifier. Use it to query its progress. Example: |
data.Always present | string | The bulk send’s campaign: the one you sent in Example: |
data.Always present | string | Always Fixed value: |
data.Always present | integer | Destinations in the request. |
data.Always present | integer | Admitted destinations: the ones charged. |
data.Always present | array<object> | Destinations rejected on receipt, with their index in |
data.Always present | integer | Index in |
data.Always present | string | Empty, too long, no digits, a country not enabled for your account, a text that does not fit in 255 parts, or an empty text. Allowed values: |
data.Always present | integer | Parts of everything admitted. |
data.Always present | object | How many admitted messages go in each alphabet. |
data.Always present | integer | In GSM-7. |
data.Always present | integer | In Unicode. |
data.Always present | object | What was charged (or reserved, in a bulk send), in micros of your organization’s currency: 1 unit = 1,000,000 micros. |
data.Always present | integer | Amount in micros. Example: |
data.Always present | string | ISO 4217 currency code. Example: |
metaAlways present | object | Response metadata. |
meta.Always present | string | Unique request identifier (16 hexadecimal characters). It matches the Example: |
meta.Always present | string | IP the API saw your request come from. Useful if your API key only accepts certain networks. Example: |
meta.Always present | string | Date and time the response was built (ISO 8601 with offset). Format: |
meta.Always present | number | Time (ms) the server took to process the request. Example: |
Error codes
Every error response has the same shape: success set to false and an error object whose code says what happened. They are grouped here by kind, with the codes this endpoint can return.
Shape of an error response
| Name | Type | Description and rules |
|---|---|---|
successAlways present | boolean | Fixed value: |
metaAlways present | object | Response metadata. |
meta.Always present | string | Unique request identifier (16 hexadecimal characters). It matches the Example: |
meta.Always present | string | IP the API saw your request come from. Useful if your API key only accepts certain networks. Example: |
meta.Always present | string | Date and time the response was built (ISO 8601 with offset). Format: |
meta.Always present | number | Time (ms) the server took to process the request. Example: |
errorAlways present | object | |
error.Always present | string | Stable UPPER_SNAKE_CASE identifier. Clients branch on this value. Example: |
error. | integer | Legacy v5 numeric code, only when a bridge exists. Omitted for codes born in v6. Example: |
error.Always present | string | URL to the error documentation. Format: |
error.Always present | string | Human readable text, in English. It is for the developer log, not the end user: do not parse it. |
error.Always present | array<object> | Structured context (validation issues, affected resource). Empty array when there is no extra context. |
Validation
- 400Invalid body (malformed JSON or a field that does not exist), or the
Idempotency-Keyis missing or has another shape. - 422The
Idempotency-Keywas already used with another body (IDEMPOTENCY_KEY_REUSED), the reference does not fit, the text does not fit in 255 parts, the number is not valid or thefromis not among the allowed ones (SMS_SENDER_NOT_ALLOWED). Not charged. - 413The body is over 30 MiB. Split the send into several bulk sends.
The idempotency key does not match the format.
The key already exists, but with a different body.
The body is not valid for this send.
The
clientRefcannot be stored.Your organization has no SMS rate in its currency.
The sender is not among the ones allowed for your organization.
The body is too large.
The bulk send has more than 100,000 destinations.
The bulk send has no destinations.
A destination lacks a variable of the common text.
422SMS_NO_DESTINATION_ADMITTED
No destination of the bulk send could be admitted.
The campaign already has its 1,000 bulk sends.
Authentication
- 401Invalid or missing credentials.
No Bearer token was sent, and every call requires one.
Message the API returns: Authentication is required. Send your API key as `Authorization: Bearer <token>`.
The API key is not recognized: wrong format, revoked or expired.
Message the API returns: The provided API key is invalid or has expired. Please verify the value sent in the `Authorization: Bearer` header.
Permissions
- 403The API key does not have the SMS service (
sms) or SMS is turned off for your organization (AUTH_SERVICE_NOT_ALLOWED), the key cannot be used from the request network, the organization is suspended or not active (ACCOUNT_NOT_ACTIVE,SMS_ACCOUNT_NOT_ACTIVE), or your organization is not enabled for the SMS API v6 yet (SMS_ORGANIZATION_NOT_ENABLED). This request was not sent or charged; if it is the retry of a send that got a503or a timeout, the first one may have been received and charged: do not resend it through another route and, once it is resolved, retry with the same key.
The key is not allowed to use the service behind this endpoint.
Message the API returns: This API key is not authorized to use the requested service.
The key only works from certain networks and your IP is not one of them.
Message the API returns: This API key cannot be used from this IP address. The address we saw is in `meta.clientIp`: call from one of the networks allowed for the key, or use a key that allows this one.
Your organization is suspended or closed.
Message the API returns: The organization associated with this API key is not active. Please contact support.
403SMS_ORGANIZATION_NOT_ENABLED
Your organization is not enabled for the SMS API v6 yet.
The send’s account could not be identified.
SMS is not active for your organization.
Usage limits
- 429Your organization’s quota (
RATE_TPS_EXCEEDED) or your IP’s (RATE_DDOS_EXCEEDED) was exceeded. WaitRetry-After.
You exceeded your organization quota for this endpoint.
Message the API returns: You have exceeded the allowed request rate for this endpoint. Please wait before retrying.
Unusually high volume from your source IP.
Message the API returns: Too many requests from this IP within a short window. Please wait before retrying.
Resource not found
There is no campaign with that
campaignId(yet).
Internal errors and availability
- 503The send could not be received or confirmed in time (
SERVICE_UNAVAILABLE). A503does not mean it was not sent: if the wait ran out or it could not be confirmed, the send may have been received and charged. Retry afterRetry-Afterwith the sameIdempotency-Keyand the same body: if it had already been received, you get its202without a new charge; if not, it is received on that attempt, only once. With another key or through another route it is another send and it is charged. - 500The bulk send could not be received (
SMS_BULK_NOT_RECEIVED) and nothing was charged. It is final for that key: with it this500always comes back. Send it again with a newIdempotency-Key.
Generic 503: a service we depend on is not responding.
The bulk send could not be received.
Other responses
- 402No balance (
SMS_INSUFFICIENT_FUNDS) or a spend limit of your organization does not let it through (SMS_SPEND_LIMIT_REACHED: adjust it in the limits, topping up does not fix it). No destination was admitted or charged. - 409It depends on
error..code IDEMPOTENCY_IN_PROGRESS: the first request with that key is still in progress; waitRetry-Afterand retry with the same key.SMS_BULK_ABANDONEDandSMS_CURRENCY_MISMATCHare final for that key (they always come back the same, withoutRetry-After) and nothing was charged: the abandoned one is sent again with a new key; the currency one is not fixed by retrying.
The first request with that key is still in progress.
There is no balance for the send.
A spend limit of your organization does not let the send through.
The send’s currency is not your organization’s.
That bulk send was left half-received and was discarded.
Special considerations
- Supports the
Idempotency-Keyheader: if a request is cut off and you repeat it with the same key, it is not duplicated. The details are in the idempotency guide.
It goes out right away
There are no scheduled sends: everything goes out as soon as it is received. Progress is queried with GET /.
Retry with the same key
If the response does not reach you (a timeout) or a 503 arrives, the send may have been received and charged: do not assume it was lost. Retry with the same Idempotency-Key and the same body: if the first one had already been received, you get its response without sending or charging another one. With a new key or through another route, the retry is another send and it is charged. 409 IDEMPOTENCY_IN_PROGRESS and 429 ask you to wait and retry with the same key. A 4xx rejection says nothing was sent or charged in THAT request. If it arrives when retrying after a 503 or a timeout, it says nothing about the first attempt, which may have been received and charged: for example, a 403 because your organization was suspended or the key lost the service. Do not resend it through another route. Once it is resolved, retry with the same key: within its validity you get the first one’s 202 if it had been received.
Three responses are final for that key
With the same Idempotency-Key they always come back the same, so retrying with it does not help. Branch on error., not only on the HTTP status. 409 SMS_BULK_ABANDONED (the bulk send was cut off halfway through being received and was discarded) and 500 SMS_BULK_NOT_RECEIVED (it could not be stored): nothing was charged and it is sent again with a new key. 409 SMS_CURRENCY_MISMATCH: nothing was charged and retrying does not fix it, not even with another key; write to us.