Every error, on every call, is one JSON envelope with the matching HTTP status. Branch on the stable code; never on message, which is English text for logs and people and may change. Errors are always JSON, whatever Accept header you send.
The error envelope
{
"error": {
"code": "insufficient_credit",
"message": "Insufficient credit for this operation. Nothing was charged.",
"required": 12.2,
"available": 3.0,
"currency": "EUR"
}
}
code— always present. Stable and machine-readable: the value to branch on.message— always present. English, human-readable; never parse it.fields— only on validation failures (422 invalid_request, and the resellerinvalid_contact): each field with its messages.retry_after— seconds to wait, on429 rate_limited,503 service_unavailableand409 idempotency_in_progress.- Other named context on some codes:
permissionandabilityon a refused token;required,available,currency,required_years,allowed_years,registrar_messageon reseller refusals.
Each operation in the reference lists, per status, the codes it can return.
Codes every call can meet
Status | Code | Meaning |
|---|---|---|
401 | unauthenticated | The token is missing, invalid or expired. |
403 | forbidden | Missing permission: the token’s user lacks the permission this call needs ( permission names it). Never used for a domain whose status blocks the change; that is domain_not_active. |
403 | domain_not_active | The domain’s status doesn’t allow this change right now ( domain_status names it): nameservers, contacts, lock, EPP code, release, WHOIS privacy, auto-renew and DNSSEC changes. |
403 | ip_not_allowed, ip_whitelist_misconfigured | The token’s IP whitelist refused the caller, or cannot be read (see IP whitelist). |
403 | client_token_required, token_not_api_enabled, token_not_client_scoped, client_access_revoked, client_cancelled | The token cannot act on an account (see 401 and 403). |
404 | not_found | The resource does not exist or belongs to another account. |
404 | endpoint_not_found | There is no endpoint at this path, or the feature is not enabled. |
405 | method_not_allowed | Wrong HTTP method for this endpoint. |
422 | invalid_request | Validation failed; fields names each problem. |
422 | unprocessable | The request is valid but was refused in the current state. |
429 | rate_limited | Rate limit exceeded: wait retry_after seconds (also in the Retry-After header). |
500 | server_error | Unexpected error on our side. On a money-moving call, see A key stuck in progress. |
502 | upstream_error | A registrar or provider did not complete the call. |
503 | service_unavailable | Temporarily unavailable: retry shortly. |
Validation errors
A 422 invalid_request lists every problem in fields, keyed by field name; the reseller invalid_contact does the same for the registrant and the extra fields:
{
"error": {
"code": "invalid_request",
"message": "The request is not valid.",
"fields": {
"nameservers": ["At least 2 nameservers are required."]
}
}
}
Reseller codes
Reseller calls (/reseller/…) use the same envelope and add their own codes:
Code | Status | Meaning |
|---|---|---|
not_reseller | 403 | The account is not enabled for the reseller API. |
credit_disabled | 403 | Credit is disabled for the account, so reseller calls are refused. |
forbidden | 403 | The token’s user lacks the permission this call needs. |
insufficient_credit | 402 | Your credit does not cover the operation. Nothing was charged. Adds required, available and currency. |
not_found | 404 | The domain does not exist or is not yours. |
operation_in_progress | 409 | Another request for this domain is still running. Retry shortly. |
renewal_in_progress | 409 | A renewal for this domain is already in progress. |
restore_required | 409 | The domain is in redemption: restore it, then renew it. |
idempotency_in_progress | 409 | The first request with this Idempotency-Key has not finished. Retry after retry_after seconds. |
invalid_request | 422 | The request is not valid. fields names each problem. |
invalid_contact | 422 | The registrant or the extra fields are not valid. fields names each field to fix. |
invalid_domain | 422 | The domain name is malformed. |
tld_not_sellable | 422 | The TLD is not sold to you for this operation (see GET /reseller/pricing). |
invalid_years | 422 | The term is not allowed for this TLD or domain. May add allowed_years or required_years. |
domain_unavailable | 422 | The name cannot be registered. |
domain_not_registered | 422 | Transfer of a name that is not registered: register it instead. Nothing was charged. |
domain_not_renewable | 422 | The domain cannot be renewed through the API in its current state. |
domain_not_restorable | 422 | Only a domain in redemption can be restored. |
registration_data_missing | 422 | The nameservers or the registrant data needed to register are missing. |
registrar_error | 422 | The registry refused the operation at once; any amount charged was refunded automatically, renew and restore included. May add registrar_message. |
invalid_idempotency_key | 422 | The Idempotency-Key is not 1–255 printable ASCII characters. |
idempotency_key_reused | 422 | This Idempotency-Key was already used for a different operation, domain or body. |
registrar_unknown | 424 | The registry did not confirm the outcome. The charge was not refunded while SupportHost reconciles it: do not retry with a new Idempotency-Key. |
operation_failed | 500 | The operation failed before the registry was contacted; the amount charged was refunded. |
whois_unavailable | 503 | The availability lookup is temporarily unavailable. Retry after retry_after seconds. |
Retrying
429 rate_limited,503 service_unavailable: waitretry_afterseconds, then retry.409 idempotency_in_progress: the first request with thatIdempotency-Keyis still running; retry afterretry_afterwith the same key.500 server_erroronregister,transfer,reneworrestore: do not retry with a new key — contact SupportHost (see A key stuck in progress).- Any other code: fix the request or the account state first; retrying unchanged gets the same answer.
New codes may be added over time: treat an unknown code like the generic meaning of its HTTP status.