Errors
Errors use HTTP status codes and always have the same body:
{ "error": { "code": "invalid_request", "message": "Publish this agent before it can call.", "param": "agent_id", "request_id": "req_01JG..." }}Branch on code, which is stable. message is written for people and may change. param
is present when one field is the problem.
| HTTP | Code | Meaning | What to do |
|---|---|---|---|
| 400 | invalid_request |
A field is missing or wrong | Fix the field named in param |
| 401 | unauthenticated |
No key, or a bad or revoked key | Check the Authorization header |
| 402 | wallet_empty |
No plan minutes or wallet balance left | Top up the wallet |
| 403 | forbidden |
Not allowed, or the workspace is suspended | Contact support if suspended |
| 404 | not_found |
No such object in this workspace | Check the ID and which workspace the key belongs to |
| 409 | conflict |
The object changed, or already exists | Fetch it again, then retry |
| 413 | payload_too_large |
An upload is too big | Send a smaller file |
| 422 | outside_calling_hours |
Outbound call to +91 outside 09:00–21:00 IST |
Try again within calling hours |
| 422 | provider_rejected |
The phone provider refused (credentials, caller ID, KYC) | Check the number and provider setup |
| 429 | rate_limited |
Too many requests, or a new workspace’s daily outbound calls are used up | Wait, then retry; for outbound calls, try again tomorrow (IST) |
| 500 | internal_error |
Something failed on our side | Retry later; quote request_id if it persists |
| 502 | provider_unavailable |
The phone provider is down or timed out | Safe to retry |