Error Handling
The Voicy API uses conventional HTTP status codes to indicate success or failure of requests.Error Response Format
All error responses follow this format:HTTP Status Codes
Success Codes
| Code | Meaning | When Used |
|---|---|---|
| 200 | OK | Successful GET, POST, PATCH requests |
| 201 | Created | Successful resource creation (create-phone-call) |
| 204 | No Content | Successful DELETE requests |
Client Error Codes
| Code | Meaning | Common Causes |
|---|---|---|
| 400 | Bad Request | Invalid JSON, missing required fields, invalid phone number format |
| 401 | Unauthorized | Invalid API key, expired token, missing Authorization header |
| 403 | Forbidden | API key doesn’t have access to the requested resource |
| 404 | Not Found | Call ID doesn’t exist or belongs to another account |
| 422 | Unprocessable Entity | Request is valid but cannot be processed |
| 429 | Too Many Requests | Rate limit exceeded |
Server Error Codes
| Code | Meaning | What To Do |
|---|---|---|
| 500 | Internal Server Error | Retry with exponential backoff, contact support if persistent |
| 502 | Bad Gateway | Temporary issue, retry after a few seconds |
| 503 | Service Unavailable | Service is temporarily down, retry later |