Documentation menu

Errors & status codes

The API uses standard HTTP status codes and returns a clear JSON error on failure.

Error shape

example
{
  "error": "Insufficient credit"
}

Validation errors also include an issues array describing each problem.

Status codes

CodeMeaningWhat to do
200SuccessRead the body.
202Accepted and scheduledThe message will send at its scheduled time.
400Invalid requestCheck the issues array and fix the payload.
401Bad API keyCheck the key and the Authorization header.
402Insufficient creditTop up your balance.
404Not foundThe id does not exist, or is not yours.
409ConflictFor example, cancelling a message that already sent.
429Rate limitedBack off and retry after a short wait.
502Upstream errorA network or provider failed. Credit for a failed send is refunded.

Retrying safely

On a timeout or 5xx, retrying a send is safe only if you passed an idempotencyKey. The same key returns the original message instead of sending again. See Send an SMS.