Errors and limits

What each code means and how many requests you can make.

An error always returns the same shape: a stable code, for your program to act on, and a message for a person to read. Handle the code, never the text: the message can change, the code cannot.

json
{
  "error": {
    "code": "device_offline",
    "message": "Device dev_oppo_cph2577 has been offline since 14:02.",
    "requestId": "req_01H8X2K9"
  }
}

HTTP statuses

StatusMeaningWhat to do
200acceptednothing
400the request is malformedfix the body; retrying will not help
401invalid or revoked keycreate a new key
402no messages left on the planwait for renewal or change plan
404the device does not existcheck the deviceId in /devices
409the device is offlinewait, or send through another one
429too many requestswait for what Retry-After says
5xxfailure on our sideretry with increasing backoff

Error codes

CodeWhen it happens
invalid_numberthe number is not in E.164, or does not exist
message_too_longabove 1530 characters
device_offlinethe chosen phone is not connected
device_not_foundthe deviceId does not belong to the account
quota_exceededthis month's messages have run out
rate_limitedabove 60 requests per minute
invalid_keythe key was revoked, or never existed

Limits

LimitValue
API requests60 per minute per key
Sending per phoneroughly 40 messages per minute
Queue per phone5000 messages
Body size256 kB

The real limit is the phone's, not the API's

The API accepts 60 requests per minute, but an Android phone sends roughly 40 messages per minute. Accepting faster only grows the queue: for 10,000 messages count on about four hours on one phone, or split them across several.