Skip to main content

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 the error_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
Common error code patterns:

Retry Strategies

Do NOT retry client errors (400, 401, 403, 404). These indicate problems with your request that will not resolve automatically.
Retry these status codes:
  • 429 Rate Limited: Wait until X-RateLimit-Reset timestamp, then retry
  • 500 Internal Error: Exponential backoff (1s, 2s, 4s, 8s…)
  • 503 Service Unavailable: Exponential backoff
Implementation example:
Node.js
Python

Idempotency

Prevent duplicate message sends by using the batch_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:
  1. Check HTTP status code category (4xx vs 5xx)
  2. Read the error field in the response body
  3. For message-level failures, check error_code and error_message
  4. Search error codes via /error-codes/search
  5. Verify phone numbers are in E.164 format
  6. Check account balance and active status
  7. Review rate limit headers
  8. Test with a known-good number (e.g., your own phone)