Getting Started

Error Handling

Understand TryVox API error responses and codes.

TryVox uses conventional HTTP status codes and structured error responses to indicate the success or failure of API requests. For step-by-step fixes, see Troubleshooting.

Error Response Format

Error responses share one JSON structure:

{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "answer_url is required",
    "request_id": "c7d0e1f2-..."
  }
}

Error Object Fields

  • code — Machine-readable error code. Branch on this, not on message.
  • message — Human-readable description. Wording can change.
  • request_id — Present on most errors. Include it when you contact support.
  • details — Optional array of { "field", "reason" } objects for field-level validation failures.

Some errors carry extra fields alongside code and message — for example KYC_REQUIRED includes kyc_status, required_next_action, and redirect_to, and 409 "in use" errors list the affected numbers.

Common Error Codes

These codes are returned across the API. Individual endpoint pages list the codes specific to them.

Authentication and access

CodeHTTP StatusMeaning
UNAUTHORIZED401No credentials were sent
INVALID_CREDENTIALS401Auth ID / Auth Token wrong, or the Basic auth header is malformed
INVALID_TOKEN401Dashboard session token is invalid or expired
FORBIDDEN403The credentials can't access this resource — e.g. the {auth_id} in the URL isn't your account
ACCOUNT_SUSPENDED403The account (or your team membership) is not active
ACCOUNT_MANAGER_REQUIRED403Only the account owner or a team admin can use this feature
KYC_REQUIRED403KYC must be approved first. Applies to number purchases and configuration, SIP trunk setup, and every /v1/voice and /v1/applications request.

Request and resource

CodeHTTP StatusMeaning
VALIDATION_FAILED400The request is missing a field, has an invalid value, or the resource is in the wrong state for the action (e.g. a call action on a call that isn't answered)
NOT_FOUND404The resource doesn't exist on your account
ALREADY_EXISTS409The resource already exists (e.g. a number already owned by an account)
INSUFFICIENT_BALANCE402Your wallet balance doesn't cover the charge

Capacity

CodeHTTP StatusMeaning
RATE_LIMITED429Your account's concurrent-call limit is reached, or a call couldn't be admitted within the calls-per-second window. This is call capacity, not an HTTP request limit.

Server

CodeHTTP StatusMeaning
INTERNAL_ERROR500Unexpected error
BAD_GATEWAY502The gateway couldn't reach the service handling the request
SERVICE_UNAVAILABLE502 or 503A dependency is unavailable (e.g. no media server for a call)

Request Rate Limits

TryVox does not currently apply per-key HTTP request rate limits and does not send a Retry-After header. The 429 you can receive comes from call capacity — your account's concurrent-call and calls-per-second limits — not from request volume. See Capacity for how those limits work.

Write clients that back off on 429 anyway: request limits may be introduced, and call capacity frees up as calls end.

Retrying

  • Retry with backoff: 429, 500, 502, 503.
  • Don't retry unchanged: 400, 401, 402, 403, 404, 409 — fix the request, credentials, balance, or KYC status first.
  • A 201 from Make a Call means the call was queued, not connected. Retrying it places a second call.

Best Practices

  1. Check the HTTP status and code before parsing the rest of the body
  2. Log request_id with every failure
  3. Back off and retry transient errors (429, 500, 502, 503)
  4. Validate inputs client-side — for example E.164 formatting, which the API does not always check

Next Steps

On this page