Errors and retries

Every API error uses a consistent JSON structure and includes a request ID.

Error structure

JSON
{
  "success": false,
  "request_id": "req_example1234567890",
  "error": {
    "code": "invalid_token",
    "message": "Invalid or expired bearer token."
  }
}

Common errors

HTTPCodeWhat to do
400missing_credentialsSend both api_key and api_secret.
401invalid_credentialsCheck that the credentials belong to the selected environment.
401missing_tokenAdd the Bearer token to the Authorization header.
401invalid_tokenRequest a new token and retry once.
401inactive_api_keyThe API key is disabled. Contact Voyced.
403scope_deniedThe key lacks the required permission. Check capabilities or contact Voyced.
403customer_context_missingThe key is not linked to a customer. Contact Voyced.
404not_foundCheck the endpoint path.
404number_not_foundUse a number returned by the telephone-number list.
429rate_limitedWait, then retry with increasing delays.
5xxrequest_failed or server_errorRecord the request ID, retry safely and check service status.
502connection_test_failedThe credentials worked, but the customer connection check did not pass. Keep the request ID and contact Voyced.
503balance_unavailableThe call credit balance is not available for this customer profile. Do not treat this as a zero balance.
502follow_me_unavailableVoyced could not read Follow-Me for the number. Retry safely, then use the request ID if it continues.
503account_reference_unavailableFollow-Me cannot currently be read for that telephone number.

Safe retry rules

  • Do not retry 400 or 403 responses without changing the request or permissions.
  • For 401, request a new token and retry once.
  • For 429, wait before retrying and reduce the request rate.
  • For 5xx, use increasing delays and a retry limit.
  • Keep the Voyced request ID in your error log, but remove credentials and personal data.