SMS API errors, status codes and rate limits
What each code means and how many requests you can make.
Last updated
Errors always have the same shape. Program against code, never against message: the text can change, the code cannot.
{
"error": {
"code": "device_not_found",
"message": "Device dev_oppo_cph2577 not found.",
"requestId": "req_01H8X2K9"
}
}HTTP statuses
| Status | Meaning | What to do |
|---|---|---|
| 200 | accepted | nothing |
| 400 | the request is malformed | fix the body; retrying will not help |
| 401 | invalid or revoked key | create a new key |
| 402 | no messages left on the plan | wait for renewal or change plan |
| 403 | the account is blocked, or the recipient opted out | check the code; retrying will not help |
| 404 | the device, message or conversation does not exist | check the id |
| 409 | the Idempotency-Key was used with a different body | use a new key for a new request |
| 429 | too many requests | slow down; the limit resets every minute |
| 5xx | failure on our side | retry with the same Idempotency-Key |
Error codes
| Code | When it happens |
|---|---|
| validation_error | a field is missing or malformed |
| invalid_number | the number is not valid |
| message_too_long | above 10,000 characters |
| device_not_found | the deviceId does not belong to the account |
| not_found | the message or conversation does not exist, on GET /messages/:id and /conversations/:id (404) |
| quota_exceeded | this cycle's messages have run out |
| account_blocked | the account was blocked (403); if you think this is a mistake, write to hello@droidsender.com |
| recipient_opted_out | the recipient replied STOP; do not retry (403) |
| idempotency_conflict | the Idempotency-Key was already used with a different body (409) |
| rate_limited | above the request limit for this account |
| invalid_key | the key was revoked, or never existed |
Limits
| Limit | Value |
|---|---|
| API requests | 60 per minute per key, multiplied by the phones connected to the account (up to 3000) |
| Sending per phone | about 30 one-part messages per minute; on most phones Android allows about 30 SMS parts per minute, so a 3-part message counts as 3 |
| Messages per cycle | your plan's quota; every response tells you what is left |
| Message length | up to 10,000 characters (about 66 SMS in GSM-7) |
| reference field | 200 characters |