error code, a human-readable message, and optional details for validation issues. Use error (not message) for programmatic handling.
Success
| Status | Use |
|---|---|
| 200 | OK — body per route |
| 201 | Created — Location header may be set |
Client errors
| Status | When | What to do |
|---|---|---|
| 400 | Validation failure | Read details for field-level errors; fix and retry |
| 401 | Missing or invalid API key | Check the Authorization header; rotate the key if compromised |
| 402 | Insufficient free balance | Top up; read required_amount and topup_url |
| 403 | Policy violation, agent not approved, or test phone number mismatch | Fix the agent state or the target number; do not retry blindly |
| 404 | Unknown resource or device not RCS-capable | Verify ids and environment; for RCS, the device may not support RCS |
| 409 | Conflict — duplicate or wrong state | Re-read the resource; avoid blind retries |
| 422 | Semantic validation | Fix domain-specific rules described in the body |
| 429 | Rate limit | Honor retry_after; back off with jitter |
Server errors
| Status | When |
|---|---|
| 500 | Unexpected internal error |
| 503 | Dependency temporarily unavailable |
Error envelope
Machine-readable error code. Stable across versions — use this for conditionals.
Human-readable explanation. Safe to log; do not use for programmatic branching.
Present on validation errors (400, 422). Each item includes
field and message.402 — Insufficient balance
The most actionable error: the free balance is below the hold amount needed for the operation.Immediately spendable balance. This is what the check runs against.
Currently held for in-flight operations.
Exact shortfall — add at least this amount to complete the operation.
Direct link to the billing top-up flow in the dashboard.
403 — Test Agent phone number
Test Agent sends return a generic 403 when the target number is not the verified phone number. The response does not reveal whether the number belongs to another account.Related
- Conventions — idempotency, rate limits, and retry patterns
- Billing API — proactive balance checks before large sends
- Our philosophy — why errors are designed to be actionable