Developers
SMS API, one key and JSON
Hook texting into your app, shop or booking tool. Requests go through the same row checks, price list and opt-out list as the web send screen, so API sends show up in the same send history and credit history.
20,000Numbers in one batch
120Calls per minute
JSONBoth directions

Quick start
From key to first text
- 01Issue a key on the API page of your account. It begins with sn_.
- 02Attach it to each call as the header Authorization: Bearer <key>.
- 03Ask POST /api/v1/quote what a batch will cost, then hand the same batch to POST /api/v1/messages.
Base URL
https://smsnumber.online/api/v1
Endpoints
Endpoint index
| Call | Purpose |
|---|---|
GET /api/v1/balance | How much credit is left, as a USD string |
GET /api/v1/countries | Every destination with its per-SMS price, readable without a key |
POST /api/v1/quote | Dry run: cost, parts and the rows that would be dropped |
POST /api/v1/messages | Queue a batch now, or for later through schedule_at |
GET /api/v1/messages | Your latest batches, paged with limit and offset |
GET /api/v1/messages/{id} | One batch with its counts per destination |
POST /api/v1/messages/{id}/cancel | Call off a booked batch before it starts and get the credit back |
Sending
Posting a batch
Pass the to field as a JSON array or as text with one number per line. Rows that start with + are read as international; for rows without it, pass a two-letter country code such as us or kr.
| Field | What goes in |
|---|---|
to | The batch: an array, or text with one number per line. At most 20,000 rows |
text | What recipients read. At most 10 parts per row |
country | Optional. Two-letter country code for rows that lack + |
schedule_at | Optional. A zoned ISO timestamp such as 2026-12-01T09:00:00Z, or Unix seconds, between 5 minutes and 30 days out |
client_ref | Optional. Your own label for the batch, 64 characters or fewer |
Reply · 201201 Created
{
"ok": true,
"campaign": {
"id": "K7Q2M9XD4TPA",
"status": "sending",
"recipients": 2,
"parts": 1,
"encoding": "GSM-7",
"cost": "0.0112",
"countries": [
{ "country": "US", "recipients": 1, "cost": "0.0044" },
{ "country": "GB", "recipients": 1, "cost": "0.0068" }
]
},
"rejected": [],
"duplicates": 0,
"opted_out": 0,
"balance": "48.9888"
}POST /api/v1/messages
curl -X POST https://smsnumber.online/api/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": ["+14155550142", "+447400123456"],
"text": "Your order #A2847 has shipped."
}'POST /api/v1/quote
curl -X POST https://smsnumber.online/api/v1/quote \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "to": ["+14155550142", "+819012345678"], "text": "Hello" }'Reply · 200200 OK
{
"ok": true,
"recipients": 2,
"parts": 1,
"encoding": "GSM-7",
"cost": "0.0131",
"balance": "49.00",
"countries": [
{ "country": "JP", "recipients": 1, "price": "0.0087", "cost": "0.0087" },
{ "country": "US", "recipients": 1, "price": "0.0044", "cost": "0.0044" }
],
"rejected": [],
"duplicates": 0,
"opted_out": 0
}Errors
Error codes
| Code | HTTP | When it happens |
|---|---|---|
unauthorized | 401 | The key is absent or not recognized |
rate_limited | 429 | This key made too many calls in the last minute |
bad_request | 400 | The request body is not readable JSON |
empty_text | 400 | text is blank |
too_long | 400 | text needs more than 10 parts |
no_numbers | 400 | Every row was dropped by the checks |
too_many | 400 | The batch holds more than 20,000 rows |
bad_time | 400 | schedule_at is outside the allowed window |
low_balance | 402 | Credit does not cover the batch |
unavailable | 503 | Sending is paused for now; no credit was used |
not_found | 404 | No batch with that id on your account |
not_scheduled | 409 | The batch has already started or was called off |
Limits and house rules
- Each key may make 120 calls per minute.
- Money comes back as a USD string, for example "0.0047".
- Batch ids are random 12-character codes rather than counters.
- Row checks and the opt-out list behave exactly as on the web screen.