Skip to content

Endpoints

Endpoints

Name

Send a marketing SMS

One marketing or informational message per call, with the same quota as the priority route: it honors the marketing controls and does not pay the priority charge.

HTTP method and path

POST/api/v6/sms/marketing

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

What happens when you run it

  • Sends a message to a third party.
  • The call is charged to your organization.

What it does

For systems that can only send one message per call. The body is the priority one plus the marketing controls (controls, on by default) and schedulePolicy. The differences from the priority route: it is not exempt from the time window, the do-not-contact registry or the opt-outs; it goes out behind the codes (a marketing peak never delays a login code); and it is charged as a normal message of your rate, without the priority charge.

Many recipients with the same text? The bulk send takes up to 100,000 in a single request.

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: 2,000 requests per second.

  • In addition, each IP has its own window of 2,400 requests per second for this route, separate from the priority one and from the other routes (429 RATE_DDOS_EXCEEDED).

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 7 days and per route: the same key on priority and on marketing are two different sends. 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

Only these six fields are accepted.

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

textRequiredstring

The message. The platform splits it: one SMS carries up to 160 GSM-7 characters (153 per part when split) or 70 in Unicode (67 per part). ñ is GSM-7; accents on á, í, ó, ú and emojis force Unicode. Up to 255 parts; more is a 422 without charge.

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

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.

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.

Default value:falseExample:true

Example
{
  "to": "3001234567",
  "text": "Esta semana 2x1 en tu tienda. Responde SALIR para no recibir más.",
  "clientRef": "promo-octubre-000123",
  "controls": { "horario": true, "rne": true, "localOptOut": true },
  "schedulePolicy": "wait"
}

Successful responses

202

Received and charged. With the same Idempotency-Key and the same body, it is the first response.

Response example
{
  "success": true,
  "data": {
    "id": "0192f0c4-7a1b-7c3d-8e9f-001122334455",
    "status": "accepted",
    "segments": 1,
    "encoding": "GSM-7",
    "cost": { "amountMicro": 30000000, "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 message (4-G).

data.idAlways presentstring

Message identifier (UUID v7). Use it to query.

Example:0192f0c4-7a1b-7c3d-8e9f-001122334455

data.statusAlways presentstring

Always accepted.

Fixed value:accepted

data.segmentsAlways presentinteger

Parts the message goes out in: the ones charged.

Example:1

data.encodingAlways presentstring

The alphabet: GSM-7 or Unicode (UCS-2).

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 (SMS_INVALID_CLIENT_REF), your organization has no rate (SMS_NO_TARIFF), or the number or the text cannot be sent: empty (SMS_EMPTY_DESTINATION, SMS_EMPTY_TEXT), a number over 20 characters (SMS_DESTINATION_TOO_LONG) or without digits (SMS_DESTINATION_NO_DIGITS), a number from a country not enabled for your account (SMS_FOREIGN_DESTINATION) or a text that does not fit in 255 parts (SMS_TOO_LONG), or the from is not among the allowed ones (SMS_SENDER_NOT_ALLOWED). Not charged.
  • 413The body is over 128 KiB (SMS_PAYLOAD_TOO_LARGE). Nothing was sent or charged.

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; if the send sees the suspension first, SMS_ACCOUNT_NOT_ACTIVE), your organization is not enabled for the SMS API v6 yet (SMS_ORGANIZATION_NOT_ENABLED) or the sending account could not be identified (SMS_ACCOUNT_NOT_IDENTIFIED). A suspended organization, or one with SMS turned off, can still query its messages. 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_ACCOUNT_NOT_ACTIVE

    SMS is not active for your organization.

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

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

This endpoint does not declare responses of this kind.

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 message could not be built (INTERNAL_SERVER_ERROR). Retry with the same Idempotency-Key and the same body: if it had already been received, you get its 202 without a new charge.

Other responses

  • 402No balance, or a spend limit of your organization does not let it through (SMS_INSUFFICIENT_FUNDS in both cases: if it is a limit, adjust it in the limits; topping up does not fix it). Nothing was sent or charged.
  • 409The first request with that Idempotency-Key is still in progress (IDEMPOTENCY_IN_PROGRESS): wait Retry-After and retry with the same key.

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.

A 202 is not a delivery

The 202 says the send was received and charged: stored on disk and replicated before answering you. It does not say it reached the phone. How each message ended (delivered, failed or blocked) reaches you in the sms.final_status notification, if you have a webhook that receives it, and it is queried with GET /api/v6/sms/messages/{id}, in its delivery block.

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.

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