Errors
The one shape every error takes, how to branch on it, and every error code the API can answer with what to do about each.
Every failed request answers with the same shape, whatever went wrong. Your code
branches on code, which never changes for a condition; message is for a
person to read and can be reworded.
The error object
{
"error": {
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "A field has the wrong type or is out of range.",
"param": "items[0].hostname",
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#parameter_invalid"
}
}| Field | What it is |
|---|---|
type | The group the code belongs to. The SDKs raise one error class per type. |
code | The stable, machine-readable reason. Branch on this. |
message | A fixed sentence for a person. It never repeats your request back. |
param | The field the error is about, as a path into your request, or null. |
requestId | The same value as the X-Request-Id header, which every response carries. Quote it to support. |
docUrl | A link to this code's entry below. |
Types and statuses
| Type | Status |
|---|---|
authentication_error | 401 |
permission_error | 403 |
invalid_request_error | 400, 405, 413, 415 and 422 |
not_found_error | 404 |
conflict_error | 409, 410 and 423 |
payment_error | 402 |
idempotency_error | the status its code lists below |
rate_limit_error | 429 |
api_error | 500 and 503 |
An object outside your token's account answers exactly as an unknown id does,
404 not_found, so ids from other accounts cannot be probed.
A response you should retry carries Retry-After, in seconds. A 429 also
carries the RateLimit-* headers; see Rate limits.
Every error code
The full catalogue, generated from the API contract. Each code links here from
the docUrl of its error.
authentication_error4 codes
token_expired401UnauthorizedThe API token has expired.
What to do Make a new token in the panel.
token_invalid401UnauthorizedThe API token is not valid.
What to do Check the token, or make a new one in the panel.
token_missing401UnauthorizedNo API token was sent. Send it as Authorization: Bearer <token>.
What to do Send your token in the Authorization header.
token_revoked401UnauthorizedThe API token was revoked.
What to do Make a new token. If you did not revoke it, review your account's security log.
permission_error6 codes
api_access_disabled403ForbiddenAPI access is paused for this account.
What to do Contact support.
api_ordering_disabled403ForbiddenOrdering through the API is switched off for this account.
What to do The account owner can switch it on in the panel, under API settings.
forbidden403ForbiddenYour role on this service does not allow this action.
What to do Ask the account owner for access, or use the owner's token.
ip_not_allowed403ForbiddenThis request came from an address outside the token's IP allowlist.
What to do Call from an allowed address, or change the allowlist in the panel.
scope_missing403ForbiddenThis API token does not have the scope this operation needs.
What to do Make a token with the scope named in the reference for this operation.
ssh_keys_not_allowed403ForbiddenOnly the account owner can pass SSH keys to a reinstall.
What to do Reinstall without sshKeyIds, or use the owner's token.
invalid_request_error34 codes
cursor_invalid400Bad requestThe cursor is malformed, has expired, or belongs to a list with other filters.
What to do Start the list again without a cursor.
invalid_json400Bad requestThe request body is not valid JSON.
What to do Send a JSON body.
metadata_invalid400Bad requestmetadata takes at most 20 keys of up to 40 characters, each with a string value of up to 500 characters.
What to do Fix the keys or values.
parameter_invalid400Bad requestA field has the wrong type or is out of range.
What to do Fix the field named in param. The reference gives each field's rules.
parameter_missing400Bad requestA required field is missing.
What to do Send the field named in param.
parameter_unknown400Bad requestThe request has a field this operation does not take.
What to do Remove the field named in param.
version_invalid400Bad requestClouduxe-Version does not name an API version.
What to do Send a version listed in the changelog, or omit the header to use your token's version.
method_not_allowed405Method not allowedThis path does not take this HTTP method.
What to do Check the method in the reference.
request_too_large413Too largeThe request body is larger than 1 MiB.
What to do Send a smaller body. Upload files through createAttachment.
unsupported_media_type415Unsupported media typeThe request body must be application/json.
What to do Send Content-Type: application/json.
billing_currency_unknown422UnprocessableThe account has no billing currency yet.
What to do Add a billing address in the panel.
confirmation_mismatch422Unprocessableconfirm must equal the service's id.
What to do Send the service's own id in confirm.
coupon_invalid422UnprocessableThis coupon does not exist or does not apply to this order.
What to do Remove or change couponCode.
firewall_rule_limit422UnprocessableThis server already has 15 firewall rules.
What to do Remove or merge rules first.
firewall_value_refused422UnprocessableThe protection service refused one of the rule's values.
What to do Check the rule's limits in the reference.
hostname_invalid422UnprocessableThe hostname must be a valid DNS name of at most 253 characters.
What to do Send DNS labels of letters, digits and hyphens joined by dots.
ip_address_invalid422UnprocessableSend one IPv4 address.
What to do Send a single dotted IPv4 address.
ip_is_infrastructure422UnprocessableThat address serves this server's protection and cannot be blocked or removed.
What to do No action is possible for this address.
ip_is_own_address422UnprocessableThat is this server's own address.
What to do Do not block your own server.
ip_range_unsupported422UnprocessableAddress ranges are not supported here. Send one IPv4 address.
What to do Send single addresses.
option_invalid422UnprocessableAn option is missing, unknown, or not offered on this plan.
What to do Use the option groups in the plan's orderForm.
origin_invalid422UnprocessableThe proxy origin must be one of this account's own servers.
What to do Send a service id, or an IPv4 address of one of your servers.
plan_change_not_allowed422UnprocessableThis plan is not an allowed change for this service.
What to do Pick a plan from GET /v1/services/{serviceId}/plan-options.
quote_incomplete422UnprocessableThe price cannot be fixed until the account's billing details are complete.
What to do Complete the billing address (for an Indian account, its GST state) in the panel.
ssh_key_invalid422UnprocessableThe public key is not one accepted OpenSSH public key line.
What to do Send ssh-ed25519, ecdsa-sha2-nistp256, -nistp384 or -nistp521, or ssh-rsa of at least 2048 bits.
ssh_key_unknown422UnprocessableAn SSH key id is not in this account's key library.
What to do Use ids from GET /v1/ssh-keys.
too_many_ssh_keys422UnprocessableToo many SSH keys for one request.
What to do Send at most 10 key ids.
webhook_url_refused422UnprocessableThe webhook URL must be https on port 443 or 8443, with a public DNS name that is not a Clouduxe host.
What to do Use a public https URL on your own domain.
not_found_error1 code
not_found404Not foundNo such object, or it is not visible to this token.
What to do Check the id, and that the token belongs to the right account.
conflict_error28 codes
account_closed409ConflictThis account is closed.
What to do No action is possible on a closed account.
cancellation_final409ConflictThe paid period has ended, so the cancellation can no longer be undone.
What to do Order a new service if you need one.
coupon_exhausted409ConflictThis coupon has no uses left.
What to do Order again without couponCode.
currency_not_offered409ConflictThe target plan is not offered in this service's currency.
What to do Open a support ticket.
firewall_not_available409ConflictProtection is not set up for this server yet.
What to do Retry later, or contact support.
firewall_preset_covered409ConflictEvery rule of this preset is already covered.
What to do No action is needed.
firewall_rule_exists409ConflictA rule with this protocol and first port already exists.
What to do Edit it instead.
firewall_rule_overlap409ConflictThe rule's ports overlap another rule of the same protocol.
What to do Edit the existing rule instead.
firewall_would_block_all409ConflictThis change would leave no enabled rule while the default policy denies, which blocks every port.
What to do Enable another rule first, or set the default policy to allow.
ip_already_listed409ConflictThat address is already on this list.
What to do No action is needed, or remove it first to change it.
out_of_stock409ConflictThis plan is sold out.
What to do Pick another plan or region, or try again later.
plan_change_open409ConflictA plan change for this service is already paid and waiting to be applied.
What to do Wait for its plan_change action to finish.
plan_change_too_soon409ConflictThis service had a plan change request in the last 10 minutes.
What to do Retry after Retry-After seconds.
previous_change_pending409ConflictAn earlier plan change is waiting for the server's next power cycle.
What to do Restart the server, wait for the change to apply, then try again.
protection_not_available409ConflictThis service has no protection data to show: it is not a protected server, or protection is not set up yet.
What to do For a protected proxy, ask support. Otherwise retry once the service is active.
reinstall_in_doubt409ConflictA recent reinstall's outcome is unknown, so another is refused for up to 15 minutes.
What to do Check the server, then retry after Retry-After seconds.
renewal_in_progress409ConflictA renewal for the next period is already paid, so the plan cannot change through the API.
What to do Open a support ticket.
service_building409ConflictA build or reinstall is running on this server.
What to do Wait for its action to finish.
service_ended409ConflictThis service has ended, so its cancellation cannot change.
What to do No action is possible on an ended service.
service_not_ready409ConflictThis service is still being set up.
What to do Wait for the service.provisioned event, then retry.
termination_pending409ConflictThis service is already being terminated.
What to do No action is needed.
terms_outdated409ConflictUpdated terms of service must be accepted before ordering.
What to do The account owner accepts them in the panel.
ticket_closed409ConflictThis ticket is closed.
What to do Open a new ticket.
webhook_endpoint_limit409ConflictThis account already has 10 webhook endpoints.
What to do Delete an endpoint you no longer use.
This address recently changed hands, and its firewall is being reset.
What to do Retry in a few minutes.
This service is suspended, cancelled or terminated.
What to do Pay any overdue invoice, or contact support.
Actions on this server are paused while its ownership is re-checked.
What to do Retry later, or contact support.
payment_error2 codes
The wallet holds no credit in this order's currency. Credit is never converted.
What to do Add credit in the order's currency in the panel.
Wallet credit in the order's currency does not cover the total. Nothing was ordered.
What to do Add credit in the panel, then try again.
idempotency_error4 codes
idempotency_key_invalid400Bad requestIdempotency-Key must be 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen.
What to do Use a UUID.
idempotency_key_required400Bad requestThis request needs an Idempotency-Key header.
What to do Send a new unique key, such as a UUID, for each logical request.
idempotency_in_progress409ConflictA request with this Idempotency-Key is still running.
What to do Retry after Retry-After seconds with the same key.
idempotency_mismatch422UnprocessableThis Idempotency-Key was already used with a different request.
What to do Use a new key for a new request.
rate_limit_error3 codes
action_limit_reached429Too many requestsThis service has reached its limit for this action.
What to do Retry after Retry-After seconds.
order_limit_reached429Too many requestsThis account has ordered its hourly maximum of services.
What to do Retry after Retry-After seconds, or ask support to raise the limit.
rate_limited429Too many requestsToo many requests.
What to do Retry after Retry-After seconds. The RateLimit headers show the window.
api_error10 codes
internal_error500Server errorAn unexpected error occurred. It has been logged with this request id.
What to do Retry once. If it repeats, contact support with the requestId.
maintenance503UnavailableThis kind of change is paused for maintenance. Reads still work.
What to do Retry after Retry-After seconds.
outcome_unknown503UnavailableThe request may or may not have taken effect.
What to do Retry with the same Idempotency-Key: the retry answers what happened, or does it once.