Skip to content

Endpoints

Endpoints

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

POST/api/v6/sms/bulk

https://developers.hablame.co/api/v6/sms/bulk

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.

Create your API key

Authentication and permissions

  • Send your API key in the Authorization header 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

NameTypeDescription and rules
AuthorizationRequiredstring

Your API key with the Bearer scheme.

Example:Bearer hk_TU_API_KEY

Content-TypeRequiredstring

Type of the body you send.

Fixed value:application/json

Idempotency-KeyOptionalstring

Optional and recommended idempotency key (1 to 255 characters from A-Za-z0-9_-; we recommend a UUID v4), unique per organization. Without it, every request is a new send that goes out and is charged: if your program retries without a key, the message can go out and be charged twice, and that is your responsibility. It is valid for as long as the bulk send record lives: 95 days from when we received it, regardless of your message history. If you repeat the send with the same key and the same body, you get the same response without sending or charging again; with another body, 422 IDEMPOTENCY_KEY_REUSED; while the first one is still in progress, 409 IDEMPOTENCY_IN_PROGRESS. See the idempotency guide.

Pattern:^[A-Za-z0-9_-]+$Minimum length:1Maximum length:255Example:5f3b2c10-9a7e-4b2d-8c1f-0a1b2c3d4e5f

Request body

Content type:application/jsonRequired

A field that does not exist is rejected with 400: a misspelled clientReff cannot pass as stored.

NameTypeDescription and rules
textOptionalstring

Form (a): the common text, with {{nombre}}-style variables (optional spaces inside the braces). A variable a destination does not carry is a 422 SMS_MISSING_VARIABLE for the whole request.

recipientsRequiredarray<object>

From 1 to 100,000 destinations.

recipients[].toRequiredstring

Mobile number in Colombia: the ten digits (3001234567) or with the country code (573001234567, +573001234567). A number written with another country’s code is rejected without charge if that country is not enabled for your account; to enable it, talk to customer service.

Maximum length:20Example:3001234567

recipients[].textOptionalstring

Form (b): this destination’s text.

Example:Tu código es 482913. Vence en 5 minutos.

recipients[].variablesOptionalobject

Form (a): this destination’s variable values.

recipients[].clientRefOptionalstring

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:36Example:pedido-2026-000123

fromOptionalstring

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 422 SMS_SENDER_NOT_ALLOWED, without charge. The message list (GET /api/v6/sms/messages) says which one it went out with. It applies to the whole bulk send.

Example:890123

controlsOptionalobject

The marketing controls, on by default: schedule (the allowed marketing time window), rne (the do-not-contact registry, the official list of people who do not want marketing) and localOptOut (the opt-outs of your own list). Send them as false only if you have each recipient’s express authorization. A message a control stops does not go out: it ends as blocked (you see it in its query and in the sms.final_status notification) and it is charged, like a sent one. In Cloud you find it in Stopped messages.

controls.scheduleOptionalboolean

Honor the marketing time window.

Default value:true

controls.rneOptionalboolean

Check the do-not-contact registry.

Default value:true

controls.localOptOutOptionalboolean

Honor your own opt-outs.

Default value:true

schedulePolicyOptionalstring

What to do with what arrives outside the marketing window, with the schedule control on: wait (it goes out when the window opens) or reject (it does not go out: it ends as blocked and it is charged, like everything a control stops).

Allowed values:wait rejectDefault value:wait

certifiedOptionalboolean

Optional, false if you do not send it. With true the message carries your rate’s certificate surcharge (once per message, apart from the priority one) and in Cloud you can download a signed PDF with what the carrier reported about the delivery, with a code and a QR that anyone can verify. It does not change how the message is sent: the carrier’s delivery receipt is always requested. It applies to every destination of the bulk send: each one carries its surcharge.

Default value:falseExample:true

campaignIdOptionalstring

The campaign this bulk send joins: the campaignId the first one’s 202 returned. Without it, the bulk send opens a new campaign. This way a send of one million destinations is ten bulk sends with a single progress (GET /api/v6/sms/campaigns/{campaignId}). A campaign from another organization, or one that does not exist, is a 422 SMS_CAMPAIGN_NOT_FOUND; one with its 1,000 bulk sends, 422 SMS_CAMPAIGN_FULL.

Pattern:^cmp_[0-9a-f]{32}$

Example
{
  "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.

Response example
{
  "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

NameTypeDescription and rules
successAlways presentboolean

dataAlways presentobject

A received bulk send: what was admitted, rejected and reserved.

data.batchIdAlways presentstring

Bulk send identifier. Use it to query its progress.

Example:bat_3f1c0a9b2d7e4c58a6b1e0f9d2c3b4a5

data.campaignIdAlways presentstring

The bulk send’s campaign: the one you sent in campaignId or, if you did not send one, the one this bulk send opens. Send it in the next bulk sends to add them to it.

Example:cmp_9d4b2e7a1c3f5086b2a4d6e8f0a1b3c5

data.statusAlways presentstring

Always accepted.

Fixed value:accepted

data.recipientsAlways presentinteger

Destinations in the request.

data.acceptedAlways presentinteger

Admitted destinations: the ones charged.

data.rejectionsAlways presentarray<object>

Destinations rejected on receipt, with their index in recipients (from 0) and their reason. Not charged. Never null: without rejections it is empty.

data.rejections[].indexAlways presentinteger

Index in recipients.

data.rejections[].reasonAlways presentstring

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:empty_destination destination_too_long destination_no_digits foreign_destination too_long empty_text

data.segmentsAlways presentinteger

Parts of everything admitted.

data.encodingsAlways presentobject

How many admitted messages go in each alphabet.

data.encodings.gsm7Always presentinteger

In GSM-7.

data.encodings.ucs2Always presentinteger

In Unicode.

data.costAlways presentobject

What was charged (or reserved, in a bulk send), in micros of your organization’s currency: 1 unit = 1,000,000 micros.

data.cost.amountMicroAlways presentinteger

Amount in micros.

Example:30000000

data.cost.currencyAlways presentstring

ISO 4217 currency code.

Example:COP

metaAlways presentobject

Response metadata.

meta.requestIdAlways presentstring

Unique request identifier (16 hexadecimal characters). It matches the X-Request-Id header. Quote it when contacting support.

Example:b9b1704baffab211

meta.clientIpAlways presentstring

IP the API saw your request come from. Useful if your API key only accepts certain networks.

Example:203.0.113.45

meta.timestampAlways presentstring

Date and time the response was built (ISO 8601 with offset).

Format:date-timeExample:2026-06-04T19:43:59+00:00

meta.responseTimeMsAlways presentnumber

Time (ms) the server took to process the request.

Example:4.24

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
NameTypeDescription and rules
successAlways presentboolean

Fixed value:false

metaAlways presentobject

Response metadata.

meta.requestIdAlways presentstring

Unique request identifier (16 hexadecimal characters). It matches the X-Request-Id header. Quote it when contacting support.

Example:b9b1704baffab211

meta.clientIpAlways presentstring

IP the API saw your request come from. Useful if your API key only accepts certain networks.

Example:203.0.113.45

meta.timestampAlways presentstring

Date and time the response was built (ISO 8601 with offset).

Format:date-timeExample:2026-06-04T19:43:59+00:00

meta.responseTimeMsAlways presentnumber

Time (ms) the server took to process the request.

Example:4.24

errorAlways presentobject

error.codeAlways presentstring

Stable UPPER_SNAKE_CASE identifier. Clients branch on this value.

Example:AUTH_REQUIRED

error.legacyCodeinteger

Legacy v5 numeric code, only when a bridge exists. Omitted for codes born in v6.

Example:40002

error.typeAlways presentstring

URL to the error documentation.

Format:uriExample:https://developers.hablame.co/docs/v6/errors/auth-required

error.messageAlways presentstring

Human readable text, in English. It is for the developer log, not the end user: do not parse it.

error.detailsAlways presentarray<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-Key is missing or has another shape.
  • 422The Idempotency-Key was 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 the from is not among the allowed ones (SMS_SENDER_NOT_ALLOWED). Not charged.
  • 413The body is over 30 MiB. Split the send into several bulk sends.

Authentication

  • 401Invalid or missing credentials.
  • 401AUTH_REQUIRED

    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>`.

  • 401AUTH_INVALID_KEY

    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 a 503 or 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.
  • 403AUTH_SERVICE_NOT_ALLOWED

    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.

  • 403AUTH_IP_NOT_ALLOWED

    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.

  • 403ACCOUNT_NOT_ACTIVE

    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.

  • 403SMS_ACCOUNT_NOT_IDENTIFIED

    The send’s account could not be identified.

  • 403SMS_ACCOUNT_NOT_ACTIVE

    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. Wait Retry-After.
  • 429RATE_TPS_EXCEEDED

    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.

  • 429RATE_DDOS_EXCEEDED

    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

Internal errors and availability

  • 503The send could not be received or confirmed in time (SERVICE_UNAVAILABLE). A 503 does 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 after Retry-After with the same Idempotency-Key and the same body: if it had already been received, you get its 202 without 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 this 500 always comes back. Send it again with a new Idempotency-Key.

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; wait Retry-After and retry with the same key. SMS_BULK_ABANDONED and SMS_CURRENCY_MISMATCH are final for that key (they always come back the same, without Retry-After) and nothing was charged: the abandoned one is sent again with a new key; the currency one is not fixed by retrying.

See it in the error catalog

Special considerations

  • Supports the Idempotency-Key header: 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 /api/v6/sms/bulk/{batchId}.

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.code, 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.

Related documentation

Need help?

Was this page helpful?

See all support channels

Ask for help about this: this endpoint

We build a message with the details that help us look into your case. Read it, complete it and send it yourself: nothing is sent on its own.

The message never carries your API key or passwords.

Your cookie preferences

You decide what we measure. You can change your choice at any time. Rejecting takes no feature away from the documentation.

Privacy policy