Reference

Error Codes

Every error response from Sendexa includes an HTTP status code and a machine-readable code field you can branch on.

Error Response Format
JSON
{
"success": false,
"message": "The phone number is not valid.",
"code": "INVALID_PHONE_NUMBER",
"requestId": "req_abc123",
"errors": [
{ "field": "to", "message": "Must be a valid E.164 or local phone number." }
]
}

errors[] is only present on 400 validation responses. Include requestId in any support ticket.

HTTP Status Codes
CodeStatusMeaning
200OKRequest succeeded.
201CreatedResource created successfully.
400Bad RequestValidation failed — check the errors array in the response body.
401UnauthorizedMissing or invalid Authorization header.
403ForbiddenCredentials are valid but the API key lacks permission for this action.
404Not FoundThe requested resource (message ID, call ID, etc.) does not exist.
409ConflictAction conflicts with current resource state (e.g. OTP already verified).
422Unprocessable EntityRequest is well-formed but semantically invalid (e.g. unsupported country).
429Too Many RequestsRate limit exceeded. Respect the Retry-After header.
500Internal Server ErrorUnexpected server error. Retry with backoff; contact support if persistent.
503Service UnavailableThe API or an upstream carrier is temporarily unavailable.
Error Codes by Category
Auth
INVALID_CREDENTIALS401API key or secret is incorrect.
MISSING_AUTH_HEADER401Authorization header is absent.
EXPIRED_TOKEN401The token has expired — rotate your credentials.
INSUFFICIENT_PERMISSIONS403This key is not allowed to perform the requested action.
Validation
VALIDATION_ERROR400One or more fields failed validation. See errors[].
MISSING_REQUIRED_FIELD400A required field is absent from the request body.
INVALID_PHONE_NUMBER400The phone number is not a valid E.164 or local number.
INVALID_EMAIL_ADDRESS400The email address is malformed.
MESSAGE_TOO_LONG400SMS message exceeds the maximum character limit.
OTP
OTP_EXPIRED400The OTP session has expired.
OTP_INVALID_PIN400The PIN entered does not match.
OTP_MAX_RETRIES_REACHED400Too many failed verification attempts for this session.
OTP_ALREADY_VERIFIED409This OTP session was already successfully verified.
Messaging
MESSAGE_FAILED422The carrier rejected or could not deliver the message.
UNSUPPORTED_COUNTRY422The destination country is not supported on your plan.
SENDER_ID_NOT_APPROVED422The sender ID / from name is not approved for this route.
INSUFFICIENT_BALANCE402Your wallet balance is too low to send this message.
Resource
RESOURCE_NOT_FOUND404The message ID, call ID, or OTP ID does not exist.
Rate Limit
RATE_LIMIT_EXCEEDED429You have exceeded the rate limit for this endpoint.
Webhooks
INVALID_WEBHOOK_PAYLOAD400Webhook body is not valid JSON or is missing event field.
Server
INTERNAL_ERROR500Unexpected server error. Retry with exponential backoff.
SERVICE_UNAVAILABLE503Temporary outage. Check status.sendexa.co.