Error response format
Error fields
| Field | Type | Description |
|---|---|---|
type | string | Error category (see table below) |
code | string | Stable error code for programmatic handling |
message | string | Human-readable explanation including the value that failed |
retryable | boolean | Whether the request can be retried |
request_id | string | Unique ID for this request — include in support tickets |
doc_url | string | Link to documentation about this error |
param | string | The parameter that caused the error (if applicable) |
suggestion | string | What to do next (may include endpoint names) |
errors | array | Field-level errors for validation failures |
retry_after_seconds | integer | Seconds to wait before retrying (rate limits only) |
Error types
| Type | HTTP Status | When |
|---|---|---|
authentication_error | 401 | Invalid, missing, or expired API key |
permission_error | 403 | Valid key but insufficient scope |
validation_error | 400 | Bad input, missing params, wrong format |
not_found_error | 404 | Resource doesn’t exist |
conflict_error | 409 | Duplicate or state conflict |
rate_limit_error | 429 | Too many requests (always retryable: true) |
server_error | 500 | Internal failure |
Request ID
Every response includes arequest_id (format: req_ + 12 alphanumeric characters). You can also send your own via the X-Request-Id header — the API will use it instead of generating one.
Validation errors
When multiple fields fail validation, theerrors array lists each one:
Phone number format
All phone numbers must be in E.164 format:+ followed by country code and number, no spaces or dashes.
Idempotency
All write endpoints (POST, PUT, DELETE) support an optionalIdempotency-Key header to safely retry requests.
How it works
- Send a unique
Idempotency-Keyheader with your write request (e.g., a UUID) - If the request succeeds (2xx), the response is stored for 1 hour
- If you send the same key again to the same endpoint, the API returns the stored response with an
Idempotency-Replayed: trueheader — the operation is not re-executed - If the request fails (4xx/5xx), the key is not consumed — you can retry with the same key until the request succeeds
Example
Key reuse across endpoints
Using the same idempotency key for a different endpoint or HTTP method returns a409 error with code IDEMPOTENCY_KEY_REUSE.
Response headers
| Header | Description |
|---|---|
Idempotency-Key | Echoed back on all requests that include the header |
Idempotency-Replayed | Set to true when the response is replayed from cache |