SMS API

A small, predictable REST API for global SMS

Send one message per call, get a message ID back right away, and follow every status change by API or signed webhooks.

200+
countries and regions
1 call
per message, JSON over HTTPS
24 h
webhook retries with backoff
50 req/s
per API key

How it works

  1. 1

    Create an API key

    Pick only the scopes it needs, and optionally an IP allowlist and an expiry date.

  2. 2

    Send with an Idempotency-Key

    Retry safely after a timeout: the same key never sends or charges twice.

  3. 3

    Track delivery

    Query the message or subscribe to webhook events from accepted to delivered.

What you get

Idempotent by design

Every send carries an Idempotency-Key. Replays return the original response byte for byte.

Scoped API keys

Per-key scopes, IP allowlists and expiry. Keys are shown once and stored only as a hash.

Signed webhooks

HMAC-signed events, at-least-once delivery, ordered by event_sequence, replayable from the console.

Status you can trust

Accepted, submitted and delivered are separate facts. Late receipts correct the status and tell you.

Know the cost first

Estimate encoding, segments and price before sending, or cap them with max_unit_price and max_segments.

Templates & sender IDs

Send approved templates with variables, and use registered sender IDs where countries require them.

Multi-route delivery

Routes are chosen per country and operator, with automatic failover when a route rejects a message.

Projects for teams

Separate keys, messages and webhooks per project; invite teammates with fixed roles.

Send your first message

curl https://api.lemsg.com/v1/messages \
  -H "Authorization: Bearer $LEMSG_API_KEY" \
  -H "Idempotency-Key: login-7f3a9c" \
  -H "Content-Type: application/json" \
  -d '{"to": "+6591234567", "text": "Your code is 482913"}'

A 202 means the message was accepted and its cost reserved — not that it was delivered.

Frequently asked questions

Does a 202 response mean the SMS was delivered?

No. 202 means we accepted the message and reserved its cost. Delivery is confirmed only by the delivered status, which you can query or receive as a webhook.

What happens if my request times out?

Send the same request again with the same Idempotency-Key. If the first one went through you get its original response; nothing is sent or charged twice.

How is a long message billed?

Per segment. A segment holds 160 GSM-7 characters (153 in multipart messages) or 70 Unicode characters (67 in multipart). A message can be up to 10 segments.

Is there a machine-readable API description?

Yes. The OpenAPI file at lemsg.com/openapi.yaml describes every endpoint, field and error code, so you can generate a client in your language.

Start with SMS API today

Create an account, top up and send — pay only for what you use.