Errors come in a few JSON shapes, depending on the call and on where the request was refused. Branch on the HTTP status and, for reseller calls, on the stable code; never on the human-readable message, which is translated into the account’s language.
Error envelopes
Each operation in the reference lists, per status, the codes it can return and which body shape it uses; the body names link here.
ResellerError
Every coded refusal of a reseller call (/reseller/…):
{
"error": {
"code": "insufficient_credit",
"message": "Insufficient credit for this operation. Nothing was charged.",
"required": 12.2,
"available": 3.0,
"currency": "EUR"
}
}
Some codes add context next to code and message: fields, required, available, currency, required_years, allowed_years, registrar_message, retry_after. The codes are listed below.
ClientError
Refusals of the Domain management calls (/client/domains/…): the account or permission is wrong, the domain is not yours, or the registry refused or could not be reached.
{
"success": false,
"message": "The registrar could not be reached."
}
The same shape answers the IP-whitelist check with status 403 on Domain management calls: "IP not allowed" (the call comes from outside the whitelist) or "IP whitelist misconfigured" (the whitelist cannot be read, so every call is refused until you fix it in the client area). Reseller calls answer the same refusals as a ResellerError with code ip_not_allowed or ip_whitelist_misconfigured.
ValidationError
Invalid input on a Domain management call answers 422 with one list of messages per field:
{
"message": "The nameservers field must have at least 2 items.",
"errors": {
"nameservers": ["The nameservers field must have at least 2 items."]
}
}
MessageError
Answers produced before the call reaches the API logic carry only a message:
{
"message": "Unauthenticated."
}
Responses outside the envelopes
These answers never carry an error code, on any route:
Status | Body | Meaning |
|---|---|---|
401 | MessageError | The token is missing, invalid or expired. |
403 "IP not allowed" | ClientError | Domain management calls only: the token is restricted to other IP addresses. Reseller calls answer ip_not_allowed instead (see IP whitelist). |
403 "IP whitelist misconfigured" | ClientError | Domain management calls only: the token’s IP whitelist cannot be read, so every call is refused (fail-closed) until you fix it in the client area. Reseller calls answer ip_whitelist_misconfigured instead. |
429 | MessageError | Rate limit exceeded; wait the seconds in the Retry-After header (see Rate limits). |
500 | MessageError | An unexpected server error outside the coded refusals. On a money-moving call its Idempotency-Key stays locked ( 409 idempotency_in_progress): contact SupportHost with the key and do not retry with a new one; we release it after checking that nothing was charged (see A key stuck in progress). |
404 on every /reseller/… path | MessageError | The reseller service is not enabled on this server. A domain you do not own is different: a 404 with error.code not_found. |
Reseller error 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. |
ip_not_allowed | 403 | The call comes from an address outside the token’s IP whitelist (see IP whitelist). |
ip_whitelist_misconfigured | 403 | The token’s IP whitelist cannot be read, so every call is refused. Fix it in the client area. |
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. |
New codes may be added over time: treat an unknown code like the generic meaning of its HTTP status.