Sending messages
POST https://sms.bizmakers.app/v1/messages with Authorization: Bearer <key>.
{
"to": "5123 4567",
"body": "Hello",
"kind": "transactional",
"idempotency_key": "order-1042",
"metadata": {"order": 1042}
}
| Field | Notes |
|---|---|
to |
Mauritian mobile. 5123 4567, 51234567, +230 5123 4567 all work. Anything else: 422 country_not_allowed. |
body |
Up to 1600 characters. Long texts are split into parts by the phone. Emoji or accents use more parts. |
template + params (+ locale) |
Instead of body: a saved template, see below. |
kind |
transactional or notification (default, expires after 24 h), bulk (72 h), otp (highest priority, 5 min; prefer /v1/otp). notification and bulk end with an opt-out link. |
device_id |
Send from this phone only (its id is on the console's Phones page). Default: any online phone, least busy first. |
ttl_seconds |
30 s to 7 days. A message not sent in time becomes expired, never sent late. |
scheduled_at |
RFC 3339 time to send later. |
priority |
0 (first) to 9. |
idempotency_key |
Or the Idempotency-Key header, max 128 chars. Same key + same content returns the first message (200, header Idempotent-Replay: true); same key + different content is 409 idempotency_conflict. Use it for every retry-able send. |
sim_slot |
0 or 1 to force a SIM on a dual-SIM phone. With several phones, combine it with device_id. Usually leave it out. |
metadata |
Any JSON object; returned with the message and in webhooks. |
Message states
scheduled → queued → dispatched → sent → delivered, or failed (with error_code), expired, canceled.
delivered needs the carrier's delivery report; some numbers never send one, so sent can be final.
Reading and cancelling
GET /v1/messages/{id}: the message with itseventshistory.GET /v1/messages?state=&kind=&to=&limit=&before=: newest first, 50 per page; passnext_beforefrom the answer asbeforefor the next page.POST /v1/messages/{id}/cancel: only while stillqueued/scheduled(409 not_cancelableafter).GET /v1/usage: messages in the last 24 h / 30 days and your project's quotas.
Templates
curl -X PUT https://sms.bizmakers.app/v1/templates/ticket -H "Authorization: Bearer $ESEMES_KEY" -H "Content-Type: application/json" \
-d '{"locale": "en", "body": "Your ticket {{.ticket}}: {{.url}}"}'
Then send {"to": "...", "template": "ticket", "params": {"ticket": "T-1042", "url": "https://..."}}. A missing
variable is an error (never sends "GET /v1/templates, DELETE /v1/templates/{key}?locale=en.