HTTP Status Codes
Error Response Format
All errors return a JSON object with a human-readable message:Common Errors
Message-Level Errors
Some requests succeed with HTTP 200 but individual messages may fail. Check theerror_code and error_message fields on each Message object.
Example: Bulk send with partial failures
Error Code Categories
Search for specific error codes to understand failure reasons:cURL
Node.js
Python
Retry Strategies
Retry these status codes:- 429 Rate Limited: Wait until
X-RateLimit-Resettimestamp, then retry - 500 Internal Error: Exponential backoff (1s, 2s, 4s, 8s…)
- 503 Service Unavailable: Exponential backoff
Node.js
Python
Idempotency
Prevent duplicate message sends by using thebatch_id parameter for deduplication:
Node.js
Messages with identical
batch_id values sent within 24 hours are treated as duplicates and only processed once.Debugging Checklist
When troubleshooting API errors:- Check HTTP status code category (4xx vs 5xx)
- Read the
errorfield in the response body - For message-level failures, check
error_codeanderror_message - Search error codes via
/error-codes/search - Verify phone numbers are in E.164 format
- Check account balance and active status
- Review rate limit headers
- Test with a known-good number (e.g., your own phone)