Error codes
Errors always have the same shape. code is stable and meant for programs, message is text for humans (German or English depending on Accept-Language).
{ "error": { "code": "invalid_receiver", "message": "Invalid receiver number.", "index": 1 } }
index only appears with receivers and names the receiver that failed. With 500 the response contains an error_id; quote it when you contact help@curl-sms.com.
401 and 402
| Code |
HTTP |
Meaning and fix |
unauthorized |
401 |
Key missing, wrong or revoked. Check the Authorization: Bearer cs_… header. |
insufficient_balance |
402 |
Included SMS and balance are not enough. Top up your balance. Nothing is ever billed afterwards. |
spend_limit |
402 |
The monthly spend limit is reached. Raise the limit or wait for the next period. |
403: destination or account blocked, account not verified
| Code |
Meaning and fix |
destination_blocked |
Not a mobile number (landline, special, premium or short code). |
free_zone_only |
The Free plan only sends to zone 1 (EU/EEA, Switzerland, UK). |
stop_listed |
The receiver opted out with STOP. Nothing is sent to this number any more. |
suspended |
The account is suspended, for example because of a high failure rate. Write to help@curl-sms.com. |
verification_required |
Live sending needs a complete profile first: name, address, date of birth (18 or older) and a mobile number confirmed by SMS code. Complete your profile. Test keys work without a profile. |
404, 409, 413
| Code |
HTTP |
Meaning |
not_found |
404 |
The SMS does not exist or belongs to the other mode (a live key does not see test SMS and vice versa). |
not_cancelable |
409 |
The SMS is being sent right now (dispatched). |
idempotency_in_progress |
409 |
A request with this Idempotency-Key is still running. Wait briefly and retry. |
payload_too_large |
413 |
The request is larger than 1 MiB. |
| Code |
Meaning |
invalid_json |
The body is not valid JSON. |
invalid_receiver |
The number is invalid, or receiver and receivers were given together. |
ambiguous_receiver |
The number is digits only without +, 00 or a leading 0 (e.g. 4915123456789) and therefore ambiguous. Send it as +4915123456789, 004915123456789 or 015123456789. |
too_many_receivers |
More than 100 receivers. |
body_empty |
No text. |
body_invalid_utf8 |
The text is not valid UTF-8. |
body_too_long |
More than 10 SMS parts. |
send_at_out_of_range |
send_at is not an RFC 3339 time or more than one year ahead. |
invalid_idempotency_key |
The key has more than 255 characters or invisible characters. |
idempotency_key_mismatch |
The same Idempotency-Key was already used with a different body. |
invalid_cursor |
since is not a cursor from next_cursor. |
429 and 500
| Code |
HTTP |
Meaning and fix |
rate_limited |
429 |
More than 10 requests per second with this key. Wait for Retry-After. |
daily_limit |
429 |
The plan's daily limit is reached. It also applies with balance and resets at midnight (Europe/Berlin). |
internal |
500 |
An error on our side. Retry, ideally with an Idempotency-Key. |
Error codes of an SMS
If an SMS fails after it was accepted, it becomes failed and error_code names the reason. With failed the amount is refunded automatically; the message then carries "refunded": true and price stays the original amount.
error_code |
Status |
Meaning and fix |
send_unknown |
failed |
The outcome is unknown: the SMS may have been delivered. Do not resend automatically; check with the receiver first. The amount is refunded. |
send_failed:cms_<n> |
failed |
The mobile network rejected the SMS (<n> is the network error, for example cms_1 = number not assigned). Check the number. |
send_failed |
failed |
The gateway could not send the SMS, no further detail. |
modem_error |
failed |
Error at the gateway's modem. Send again later. |
encode_error |
failed |
The SMS could not be encoded (for example an invalid number). |
delivery_failed:<n> |
failed |
The network reports that the SMS could not be delivered (<n> is the delivery report status, for example 69 = invalid number). |
dispatch_timeout |
failed |
No gateway confirmed the SMS in three attempts. Send again. |
no_body |
failed |
The text is missing (after deletion). |
parts_mismatch |
failed |
The part count does not match the text. Send again. |
queue_timeout |
expired |
The SMS waited more than 24 hours for a gateway and was not sent. The amount is refunded. |
An expired SMS without error_code only lacked the delivery report after 72 hours; it counts as sent.