Envelope
All errors use the same envelope. Stack traces are never returned to clients. A validation error adds a details field. Quote request_id when you contact us.
error envelope402
{
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Insufficient available balance",
"request_id": "req_01hx..."
}
}Codes
Branch on code, not on the message text. OTP codes are on the OTP page.
CodeHTTPWhen
VALIDATION_ERRORHTTP 400A field is missing or has the wrong type. details lists the fields.
INVALID_PHONE_NUMBERHTTP 400The number is not a valid phone number.
INVALID_SENDER_IDHTTP 400The sender_id is not 3–11 letters, numbers or spaces.
SENDER_NOT_APPROVEDHTTP 400A LIVE send from a sender name not approved for your account.
INVALID_API_KEYHTTP 401The key is unknown, revoked or malformed.
UNAUTHENTICATEDHTTP 401No key or session was sent.
MFA_REQUIREDHTTP 401Console sign-in needs the authenticator code.
INSUFFICIENT_BALANCEHTTP 402The wallet cannot cover a LIVE send. TEST sends are free and never get this error.
TEST_KEY_LIVE_FORBIDDENHTTP 403A TEST key asked for a LIVE send.
IDEMPOTENCY_CONFLICTHTTP 409The Idempotency-Key was already used with a different body.
RATE_LIMITEDHTTP 429A per-minute quota is used up. Wait for Retry-After.