Error codes
Error codes #
| Code | Description |
|---|---|
400 |
Bad request. Check your parameters. |
401 |
Unauthorized. The API key is missing, invalid or disabled, or your IP address is not allowed. A malformed Authorization header returns 400. |
402 |
Not enough credits for a paid send (SMS, SMS OTP). Nothing is charged. |
404 |
Resource not found |
429 |
Too many requests: you hit the rate limit |
500 |
Internal server error |
An error returns {"message", "code", "trace"}. In production, a refusal (4xx) carries a fixed message for its status, such as "Resource not found" (404) or "Invalid request" (400), and a server error (5xx) the message "An internal error occurred". Rely on the HTTP status and the code field (VALIDATION_ERROR, UNAUTHORIZED, INSUFFICIENT_CREDITS, NOT_FOUND…). An authentication refusal (401, UNAUTHORIZED) says why: "Authorization header is missing.", "Invalid authorization header.", "The token is actually disabled.", "This key is not allowed on this API" (a logs key), "Your account is not verified." or "Your IP address is not allowed.". Some 400 refusals say why as well: "Token is malformed." and "The content type must be application/json" (BAD_REQUEST), "At least one event block (email, sms, mobile_push, messaging, real_time, web_push, webhook) must be provided." on POST /v1/notify/send (BAD_REQUEST), and on the WhatsApp endpoints (code OK) "Instance cannot send messages. Check status, billing, or daily limit.", "Create WhatsApp Instance API is not enabled for this organization." and the limits on latitude, longitude, buttons (1 to 3), sections (1 to 10) and rows (10 in all). A message that would quote a value you sent (a media type, the position of a button or a row) stays "Invalid request". Refusals for missing credits (402), an unknown resource on a send (404), an unknown sender name, an invalid or unsupported recipient number, or an organization with no country set (400) keep their real message.
Exception: the OTP endpoints return their 400 and 404 errors as {"message"}, with the real message.
Not enough credits: POST /v1/sms/send and POST /v1/otp/send (SMS) answer 402. Nothing is charged and nothing is created. The SMS body carries "code": "INSUFFICIENT_CREDITS"; the OTP body is {"message"}. WhatsApp and Notify sends do not take credits per call.