Errors
The error answer, every code, and which errors are worth retrying.
2 min read Updated
A request that fails answers with an HTTP status of 400 or more and an error object that says what went wrong. Switch on its type first,
then on its code; show its message to people, never parse it.
The error object
{
"error": {
"type": "invalid_request_error",
"code": "validation_failed",
"message": "Choose a plan offered on the cloud you picked",
"fields": {
"planId": "Choose a plan offered on the cloud you picked"
},
"requestId": "req_8Zk2mPq4Xc7Lw9Tn0Bv3Ys",
"docUrl": "https://rabbitflare.com/docs/api/errors#validation_failed"
}
} | Field | Type and description |
|---|---|
error | object What went wrong. |
type | string The error's family, from the HTTP status. Stable: switch on it first. Known values: |
code | string The exact reason, in snake_case. The errors guide lists every code; new codes can appear. |
message | string What went wrong, in a sentence for a person. Not for parsing: the wording can change. |
fields | object When the request is at fault: each field's path ( |
requestId | string The request's id, the same as the X-Request-Id header. Quote it to support. |
docUrl | string The errors guide, at this code. |
requiredScopes | array of strings With insufficient_scope: every scope the operation needs. |
missingScopes | array of strings With insufficient_scope: the scopes the token lacks. |
expiredAt | string An ISO 8601 time, in UTC With token_expired: when the token expired. |
retryAfterSeconds | integer With rate_limited, api_read_only and api_unavailable: seconds to wait before trying again, as in Retry-After. |
scope | string With rate_limited: which limit was reached. Known values: |
limit | integer With rate_limited: the number of requests the limit allows in its window. |
New codes can appear at any time (each with a type and status that already exist), so code that meets one it doesn't know should go by its
type and the HTTP status.
Types and statuses
| Type | Statuses | What it means |
|---|---|---|
invalid_request_error | 400, 405, 413, 415, 422 | The request itself is wrong: a path, a parameter, a field or the body. Fix it before sending it again. |
authentication_error | 401 | No token, or one that can't be used: unknown, expired or revoked. |
payment_error | 402 | A payment didn't go through. Nothing was bought. |
permission_error | 403 | The token, or the account, may not do this. |
not_found_error | 404 | Nothing with this id belongs to the account, or the path doesn't exist. |
conflict_error | 409 | It can't be done in the resource's current state, or another change is in progress. |
rate_limit_error | 429 | Too many requests: wait as long as Retry-After says. |
api_error | 500, 502, 503, 504 | Something went wrong on our side, or a server didn't answer. Most of these are worth retrying. |
Handling errors in code
A client that handles errors well does three things:
- Tries again what's worth it, after waiting: statuses 429, 502, 503, 504 and the codes marked Yes below
(
idempotency_in_progress,busy,server_busy,server_restoring,not_ready,staging_busy,clone_busy,installing_updates,already_running,purging,checking,temporary). Wait as long as theRetry-Afterheader says, or else longer each time, and give up after a few tries. - Shows the fields at fault:
fieldsnames each one with what's wrong, ready to show next to a form's inputs. - Stops on the rest: the same request would fail the same way. Log the
requestId.
The same helper in three languages: it sends a request, gives back data, tries again when it's worth it and otherwise throws the error.
The SDK does all of it by itself: its tab only catches the error.
import { randomUUID } from "node:crypto";
// Worth trying again: these statuses, and these codes.
const RETRY_STATUSES = new Set([429, 502, 503, 504]);
const RETRY_CODES = new Set(["idempotency_in_progress", "busy", "server_busy", "server_restoring", "not_ready", "staging_busy", "clone_busy", "installing_updates", "already_running", "purging", "checking", "temporary"]);
class RabbitflareError extends Error {
constructor(status, error) {
super(error.message);
this.status = status;
this.type = error.type;
this.code = error.code;
this.fields = error.fields ?? {};
this.requestId = error.requestId;
}
}
// A change gets an Idempotency-Key, made once and sent with every try: it's done only once.
async function rabbitflare(method, path, body, { idempotencyKey = method === "GET" ? null : randomUUID(), attempts = 5 } = {}) {
for (let attempt = 1; ; attempt++) {
const res = await fetch(`https://api.rabbitflare.com/v1${path}`, {
method,
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
...(body ? { "Content-Type": "application/json" } : {}),
...(idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {}),
},
body: body ? JSON.stringify(body) : undefined,
});
if (res.ok) return res.status === 204 ? null : (await res.json()).data;
// A gateway's answer may not be JSON: then only the status says what happened.
const answer = await res.json().catch(() => null);
const error = answer?.error ?? { type: "api_error", code: "unknown", message: `HTTP ${res.status}` };
const retry = RETRY_STATUSES.has(res.status) || RETRY_CODES.has(error.code);
if (!retry || attempt === attempts) throw new RabbitflareError(res.status, error);
// Wait as long as Retry-After says, or longer each time (1, 2, 4… seconds).
const seconds = Number(res.headers.get("Retry-After")) || 2 ** (attempt - 1);
await new Promise((resolve) => setTimeout(resolve, seconds * 1000 * (1 + Math.random() / 5)));
}
}
try {
const site = await rabbitflare("POST", "/sites", {
"serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
"name": "Shop",
"siteTitle": "Example Shop",
"adminUsername": "editor",
"adminEmail": "[email protected]"
});
console.log(`Created ${site.id}`);
} catch (err) {
if (!(err instanceof RabbitflareError)) throw err;
console.error(`${err.code}: ${err.message} (request ${err.requestId})`);
for (const [field, problem] of Object.entries(err.fields)) console.error(` ${field}: ${problem}`);
process.exitCode = 1;
} import { randomUUID } from "node:crypto";
import { Rabbitflare, RabbitflareError } from "@rabbitflare/api";
// The SDK tries again by itself when it's worth it (these statuses, and the codes the API marks so),
// waiting as long as Retry-After says, or longer each time: here 5 tries in all.
const rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN, maxRetries: 4 });
try {
// A change gets an Idempotency-Key, made once and sent with every try: it's done only once.
const site = await rf.sites.create({
serverId: "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
name: "Shop",
siteTitle: "Example Shop",
adminUsername: "editor",
adminEmail: "[email protected]",
}, { idempotencyKey: randomUUID() });
console.log(`Created ${site.id}`);
} catch (err) {
if (!(err instanceof RabbitflareError)) throw err;
console.error(`${err.code}: ${err.message} (request ${err.requestId})`);
for (const [field, problem] of Object.entries(err.fields ?? {})) console.error(` ${field}: ${problem}`);
process.exitCode = 1;
} <?php
// Worth trying again: these statuses, and these codes.
const RETRY_STATUSES = [429, 502, 503, 504];
const RETRY_CODES = ['idempotency_in_progress', 'busy', 'server_busy', 'server_restoring', 'not_ready', 'staging_busy', 'clone_busy', 'installing_updates', 'already_running', 'purging', 'checking', 'temporary'];
class RabbitflareException extends RuntimeException
{
public function __construct(public int $status, public array $error)
{
parent::__construct($error['message']);
}
}
function rabbitflare(string $method, string $path, ?array $body = null, ?string $idempotencyKey = null, int $attempts = 5): ?array
{
// A change gets an Idempotency-Key, made once and sent with every try: it's done only once.
$idempotencyKey ??= $method === 'GET' ? null : bin2hex(random_bytes(16));
for ($attempt = 1; ; $attempt++) {
$headers = ['Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN')];
if ($body !== null) {
$headers[] = 'Content-Type: application/json';
}
if ($idempotencyKey !== null) {
$headers[] = 'Idempotency-Key: ' . $idempotencyKey;
}
$retryAfter = 0;
$ch = curl_init('https://api.rabbitflare.com/v1' . $path);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_HEADERFUNCTION => function ($ch, $line) use (&$retryAfter) {
if (stripos($line, 'Retry-After:') === 0) {
$retryAfter = (int) trim(substr($line, 12));
}
return strlen($line);
},
]);
if ($body !== null) {
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
}
$answer = curl_exec($ch);
if ($answer === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status < 400) {
return $status === 204 ? null : json_decode($answer, true)['data'];
}
// A gateway's answer may not be JSON: then only the status says what happened.
$error = json_decode($answer, true)['error'] ?? ['type' => 'api_error', 'code' => 'unknown', 'message' => "HTTP $status", 'requestId' => null];
$retry = in_array($status, RETRY_STATUSES, true) || in_array($error['code'], RETRY_CODES, true);
if (!$retry || $attempt === $attempts) {
throw new RabbitflareException($status, $error);
}
// Wait as long as Retry-After says, or longer each time (1, 2, 4… seconds).
$seconds = $retryAfter ?: 2 ** ($attempt - 1);
usleep((int) ($seconds * 1000000 * (1 + mt_rand() / mt_getrandmax() / 5)));
}
}
try {
$site = rabbitflare('POST', '/sites', [
'serverId' => '3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d',
'name' => 'Shop',
'siteTitle' => 'Example Shop',
'adminUsername' => 'editor',
'adminEmail' => '[email protected]',
]);
echo 'Created ', $site['id'], PHP_EOL;
} catch (RabbitflareException $e) {
fwrite(STDERR, "{$e->error['code']}: {$e->getMessage()} (request {$e->error['requestId']})" . PHP_EOL);
foreach ($e->error['fields'] ?? [] as $field => $problem) {
fwrite(STDERR, " $field: $problem" . PHP_EOL);
}
exit(1);
} import os
import random
import sys
import time
import uuid
import requests
# Worth trying again: these statuses, and these codes.
RETRY_STATUSES = {429, 502, 503, 504}
RETRY_CODES = {"idempotency_in_progress", "busy", "server_busy", "server_restoring", "not_ready", "staging_busy", "clone_busy", "installing_updates", "already_running", "purging", "checking", "temporary"}
class RabbitflareError(Exception):
def __init__(self, status, error):
super().__init__(error["message"])
self.status = status
self.type = error["type"]
self.code = error["code"]
self.fields = error.get("fields", {})
self.request_id = error.get("requestId")
def rabbitflare(method, path, body=None, idempotency_key=None, attempts=5):
headers = {"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"]}
# A change gets an Idempotency-Key, made once and sent with every try: it's done only once.
if idempotency_key is None and method != "GET":
idempotency_key = str(uuid.uuid4())
if idempotency_key:
headers["Idempotency-Key"] = idempotency_key
for attempt in range(1, attempts + 1):
response = requests.request(
method, "https://api.rabbitflare.com/v1" + path, headers=headers, json=body, timeout=120
)
if response.ok:
return None if response.status_code == 204 else response.json()["data"]
# A gateway's answer may not be JSON: then only the status says what happened.
try:
error = response.json()["error"]
except (ValueError, KeyError):
error = {"type": "api_error", "code": "unknown", "message": f"HTTP {response.status_code}"}
retry = response.status_code in RETRY_STATUSES or error["code"] in RETRY_CODES
if not retry or attempt == attempts:
raise RabbitflareError(response.status_code, error)
# Wait as long as Retry-After says, or longer each time (1, 2, 4… seconds).
seconds = float(response.headers.get("Retry-After") or 2 ** (attempt - 1))
time.sleep(seconds * (1 + random.random() / 5))
try:
site = rabbitflare("POST", "/sites", {
"serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
"name": "Shop",
"siteTitle": "Example Shop",
"adminUsername": "editor",
"adminEmail": "[email protected]",
})
print("Created", site["id"])
except RabbitflareError as err:
print(f"{err.code}: {err} (request {err.request_id})", file=sys.stderr)
for field, problem in err.fields.items():
print(f" {field}: {problem}", file=sys.stderr)
sys.exit(1) Every code
Every code the API can answer with today, by what it's about. Each one's address here is its error's docUrl. Retry says whether
trying again later can succeed (for 429, see Rate limits).
Authentication
| Code | Status | What it means | What to do | Retry |
|---|---|---|---|---|
missing_token | 401 | No API token was sent. | Send the header Authorization: Bearer <token>. | No |
invalid_token | 401 | The token is malformed or unknown. | Check you copied the whole token. Make a new one in the panel if it's lost. | No |
token_expired | 401 | The token passed its expiry date (expiredAt). | Make a new token in the panel: an expired token can't be regenerated. | No |
token_revoked | 401 | The token was revoked, or replaced by a regenerated one whose grace time has passed. | Use the token's new value, or make a new token. | No |
Permission
| Code | Status | What it means | What to do | Retry |
|---|---|---|---|---|
insufficient_scope | 403 | The token lacks a scope this operation needs (missingScopes). | Edit the token in the panel and add the scopes in missingScopes. | No |
ip_not_allowed | 403 | The request came from an address that isn't on the token's list of allowed IP addresses. | Call from an allowed address, or change the token's list in the panel. | No |
api_not_enabled | 403 | The API isn't open to this account. | Contact support. | No |
api_access_suspended | 403 | Support paused this account's API access. | Contact support. | No |
two_factor_required | 403 | Two-factor authentication became required for this account and is off. | Sign in to the panel and turn on two-factor authentication. | No |
feature_unavailable | 403 | This product isn't open to the account. | Contact support if you'd like it opened. | No |
all_servers_required | 403 | The token is limited to some servers, and this operation needs a token for all servers: it changes domains or Cloudflare, or reaches Mail or billing, none of which is tied to one server. | Use a token for all servers: make one in the panel with All servers. | No |
forbidden | 403 | You don't have access to this resource. | Check the id: it must be one of this account's. | No |
trial_locked | 403 | The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept. | Keep the server in the control panel: they switch on by themselves. | No |
panel_only | 403 | This can only be done in the control panel: for example, rotating the signing secret of a webhook endpoint added in the panel or with another API token. | Do it in the control panel, signed in as the account's owner (for a signing secret: API, then Webhooks, then the endpoint). | No |
email_unverified | 403 | The account's email address isn't confirmed yet. | Open the link in the confirmation email (the panel can send it again), then try again. | No |
cloud_unavailable | 403, 503 | 403: servers on this cloud aren't open to your account. 503: the cloud didn't answer just now (its stock couldn't be checked, or a server's snapshots and backups couldn't all be listed). | 403: choose a cloud that GET /v1/clouds lists. 503: try again in a minute. | At 503 |
outside_root | 403 | The path leads outside the site's folder (through a link), which files can't reach. | Use a path inside the site's folder. | No |
protected | 403 | The site's folder itself can't be moved, replaced, deleted or given other permissions. | Name a file or folder inside it. | No |
permission_denied | 403 | The site's server refused access to a file or folder: its permissions don't let the site's own user do this. message names it. | Check its permissions (mode); a file the site's user doesn't own can't be changed. Contact support if you need it changed. | No |
Input
| Code | Status | What it means | What to do | Retry |
|---|---|---|---|---|
length_required | 400 | An upload was sent without a Content-Length header. | Send the file's size in Content-Length. | No |
invalid_json | 400 | The body isn't valid JSON, or isn't a JSON object where one is expected. | Send a JSON object. | No |
invalid_parameter | 400 | A query parameter is unknown or has a wrong value (fields names it), or the query is too long: over 16,384 characters, or a parameter's name over 64. | Correct or remove the parameter named in fields. | No |
invalid_cursor | 400 | The cursor isn't one this list gave, or was made with other filters or another sort. | Start again from the first page, or keep the filters and sort the cursor was made with. | No |
idempotency_key_required | 400 | This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once. | Send a unique Idempotency-Key (a UUID) with the request. | No |
invalid_idempotency_key | 400 | The Idempotency-Key is empty, too long, or has characters other than A-Z a-z 0-9 _ - : . | Use a UUID. | No |
bad_request | 400 | The request can't be carried out as sent. message says why (for example, a site's built-in domain can't be removed). | Change the request as message says. | No |
bad_plan | 400 | The plan can't be paid for: it has no price set up. | Choose another plan, or contact support. | No |
bad_path | 400 | The path isn't one the site's server can use. | Use a path in the site that starts with /, without control characters. | No |
not_a_folder | 400 | The path is a file, where a folder is needed. | Name a folder. | No |
not_a_file | 400 | The path is a folder (or something other than a file), where a file is needed. | Name a file. To download a folder, use GET /v1/sites/{siteId}/files/download: it comes as a .zip. | No |
unknown_endpoint | 404 | No operation has this path. | Check the path against the reference; paths are lower-case and start with /v1. | No |
not_found | 404 | The resource doesn't exist, or isn't this account's. | Check the id. Ids of other accounts' resources answer the same way. | No |
method_not_allowed | 405 | The path exists, but not for this method. The Allow header lists the methods it takes. | Use one of the methods in the Allow header. | No |
payload_too_large | 413 | The body is larger than the operation accepts (1 MB for JSON). | Send less data; uploads have their own limit. | No |
too_large | 413 | It's too large for this: a file over 2 MB to read as text, an upload over the limit, or an archive that holds more than 60,000 files or 4 GB. | Download the file instead of reading it, upload a smaller file, or extract a smaller archive. | No |
file_too_large | 413 | The file is larger than one attachment may be (10 MB). | Send a smaller file. | No |
files_too_large | 413 | The files of one message can add up to 25 MB. | Send some of them with another message. | No |
unsupported_media_type | 415 | The body isn't sent as application/json (or application/octet-stream for uploads). | Send Content-Type: application/json with a JSON body. | No |
binary | 415 | The file isn't text, so it can't be read as text. | Download it instead: GET /v1/sites/{siteId}/files/download. | No |
validation_failed | 422 | One or more fields are missing or wrong. fields names each one with what's wrong. | Correct the fields named in fields. Unknown fields are refused too. | No |
idempotency_key_reused | 422 | The Idempotency-Key was already used in the last 24 hours with another operation or another body, or by another token of the account. | Use a new key for a new request. | No |
security_refused | 422 | Imunify360 on the server refused the change. | Check the values you sent. If it keeps happening, contact support with the request id. | No |
own_server_unsupported | 422 | Your own servers can't do this here: their power, size, snapshots and restores belong to your provider. | Do it at your server's provider. | No |
downsize_unsupported | 422 | A server can only move to a larger plan. | Choose a larger plan. Contact support to move to a smaller one. | No |
invalid_address | 422 | The IP address or range isn't valid. | Use an address like 203.0.113.7, or a range like 203.0.113.0/24. | No |
lint_error | 422 | The PHP file has a syntax error, so it wasn't saved. message gives PHP's own words, with the line. | Fix the error and save again, or send force: true to save it anyway (the site may then fail to load). | No |
incomplete | 422 | The upload ended before every byte its Content-Length announced arrived, so nothing was saved. | Upload the file again. | No |
bad_archive | 422 | The file isn't a valid .zip archive. | Check the file, or make the archive again. | No |
unsafe_archive | 422 | The archive holds a path that would land outside the folder it's extracted to (message names it), so extracting it was stopped. | Make the archive again without that path. | No |
io_error | 422 | The site's server couldn't complete the file operation (its disk or file system refused). | Try again; if it keeps failing (for example, the disk is full), contact support. | No |
message_too_short | 422 | A new ticket's message needs at least 10 characters of text (for a formatted message, the text of its html). | Tell support a little more. | No |
message_too_long | 422 | The message is longer than 10,000 characters (for a formatted message, the text of its html). | Shorten it, or say the rest in another message. | No |
empty_file | 422 | The file is empty. | Upload the file with its bytes. | No |
unsupported_file | 422 | The file isn't one that can be attached: screenshots (PNG, JPEG, GIF or WebP), PDFs and text files. What a file is comes from its bytes, not its name. | Send one of those (a text file's name must end in .txt or .log). | No |
file_missing | 422 | A file named in fileIds isn't waiting to be sent any more: it was sent with another message, removed, or uploaded more than a day ago. | Upload it again and send the new id. | No |
too_many_files | 422 | One message can carry up to 5 files. | Send the others with another message. | No |
State and conflicts
| Code | Status | What it means | What to do | Retry |
|---|---|---|---|---|
idempotency_in_progress | 409 | A request with this Idempotency-Key is still running. | Wait a moment (Retry-After), then send the same request again. | Yes |
security_off | 409 | Imunify360 is off for the server (or failed), and this needs it on. | Turn it on with POST /servers/{serverId}/security/actions/enable, wait for security.status to be on, then try again. | No |
malware_protection_off | 409 | Malware protection is off for the site (or, for a server-wide change, for the sites it needs). | Turn it on with POST /sites/{siteId}/malware-protection/actions/enable, then try again. | No |
wordpress_plugin_off | 409 | Imunify360's WordPress plugin is off for the server. | Turn it on with POST /servers/{serverId}/security/wordpress-plugin/actions/enable, then try again. | No |
busy | 409 | Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): message says what. | Wait until it finishes, then try again. A change to the server or site itself is done when its pendingAction is null again; for anything else, message says how long to wait. | Yes |
server_busy | 409 | The server's current change hasn't finished yet. | Wait until the server's change finishes, then try again. | Yes |
server_restoring | 409 | The server is being restored, and nothing else can change it or its sites until that's done. | Wait until the restore finishes (the server's pendingAction is null again), then try again. A restore that stopped partway keeps pendingAction: "restore", with the server's lastError set, until our team has checked the server. | Yes |
invalid_state | 409 | The resource's status doesn't allow this now (for example, powering on a server that is running). message says why. | Check the resource's status, then do what message says. | No |
conflict | 409 | This clashes with something that exists, or is already done (for example, a domain already connected to a site). | Read message; there may be nothing left to do. | No |
server_unavailable | 409 | The server isn't in a state that allows this (for example, it's off or still being set up). | Start the server, or wait until it's active, then try again. | No |
site_unavailable | 409 | The site isn't in a state that allows this (for example, it's still installing). | Wait until the site is active, then try again. | No |
not_ready | 409 | Something this needs isn't ready yet (for example, the server has no IP address yet). | Wait a few minutes, then try again. | Yes |
not_supported | 409 | The server's cloud doesn't offer this (for example, whole-server snapshots on Amazon EC2 and Google Cloud), or the server's kind or size doesn't allow it (Imunify360 on a server of your own, or under 2 GB of memory). | Use what the cloud offers instead: for snapshots, site backups. Imunify360 needs a server Rabbitflare creates, with Intel or AMD processors and 2 GB or more (security.available says why not). | No |
not_restorable | 409 | The backup is incomplete, so the server can't be restored from it. Nothing was changed. | Choose another snapshot or backup of the server. | No |
not_verified | 409 | The domain's DNS isn't verified yet. | Verify the domain first. A domain waiting for DNS can be made primary once it's verified instead. | No |
trial_server | 409 | The server is on the free trial, which can't do this. | Keep the server in the panel first. | No |
staging_busy | 409 | A staging operation is running on this site, or on a site of this server. | Wait until it finishes (activeRun in GET /sites/{siteId}/staging is null again), or cancel it, then try again. | Yes |
staging_copy | 409 | This site is a staging copy, which can't do this. | Do it on the live site. A staging copy is managed through its live site's staging operations. | No |
clone_busy | 409 | A clone of this site, or of a site on this server, is being made. | Wait until the clone finishes (or cancel it), then try again. | Yes |
php_not_fully_restarted | 409 | PHP was restarted on the server, except for the sites message names, with the reason. | Fix what message names on those sites, then restart PHP again. | No |
installing_updates | 409 | Updates are being installed on the server right now. | Check again in a few minutes. | Yes |
cdn_blocked | 409 | The CDN can't be switched on for this site right now. The CDN's blockedReason says why. | Read blockedReason in GET /v1/sites/{siteId}/cdn, do what it says, then try again. | No |
cdn_off | 409 | The site's CDN isn't on, and this needs it. | Turn the CDN on first (POST /v1/sites/{siteId}/cdn/actions/enable) and wait until it's active. | No |
hostname_exists | 409 | The site's CDN already has a custom hostname. | Remove it first (DELETE /v1/sites/{siteId}/cdn/hostname), then add the new one. | No |
hostname_failed | 409 | Setting up the custom CDN hostname failed, so it can't be checked again. | Remove the hostname and add it again to start over. | No |
own_address | 409 | That address is one of your own, which can't be used here: a site's firewall can't block its server's own IP address (WordPress needs to reach itself), and the account's own email addresses can't be changed. | Leave that address as it is. For the firewall, use an address or range that leaves out the server's own; the account's own email addresses need nothing done. | No |
already_running | 409 | The cron job is running now, so it wasn't started again. | Wait until it finishes (running is false in GET /v1/sites/{siteId}/cron-status), then try again. | Yes |
exists | 409 | Something with that name is already there. | Choose another name, or send overwrite: true where the operation takes it (it never replaces a folder). | No |
is_folder | 409 | A folder with that name is already there, so a file can't be written in its place. | Choose another name, or delete the folder first. | No |
too_many_uploads | 409 | Twenty uploads already wait to be sent with a message. | Send them with a message, or remove the ones you don't need (DELETE /v1/tickets/uploads/{uploadId}). Uploads not sent within a day are removed. | No |
attachments_unavailable | 409 | Files can't be attached right now. | Describe the problem in words, or try again later. | No |
no_staging | 409 | The site has no staging copy. | Create one first: POST /v1/sites/{siteId}/staging. | No |
staging_unavailable | 409 | The staging copy can't be used for this now: it's still being created, or it's being removed. | Check copy.status in GET /v1/sites/{siteId}/staging, and try again once it's active. | No |
staging_refused | 409 | The site's server found something that stops this staging operation. message says what. | Deal with what message names, then check again. | No |
not_cancellable | 409 | It can't be cancelled now: it's being switched over (which takes seconds), or our team is putting it right. | Wait for it to finish, then read it again. | No |
cannot_clone | 409 | The site can't be cloned right now. message says why (a staging copy, still installing, its server off, another operation running…). | Deal with what message says, then try again. blockers in GET /v1/sites/{siteId}/clone lists everything in the way. | No |
media_in_storage | 409 | The site keeps some of its media only in Media Offload's storage, which a server of your own doesn't have. | Clone it to one of your Rabbitflare cloud servers, or bring its media back to its server first. | No |
not_on | 409 | Media Offload or Rabbitflare SMTP isn't on for the site, and this needs it. | Turn it on first (POST /v1/sites/{siteId}/media-offload/actions/enable or POST /v1/sites/{siteId}/smtp/actions/enable). | No |
already_on | 409 | Media Offload is on for the site already (or being turned off). | Change its settings with PUT /v1/sites/{siteId}/media-offload/settings instead. | No |
purging | 409 | The files the site had in storage before are still being removed. | Try again in a few minutes. | Yes |
copy_mode | 409 | Freeing up disk needs Media Offload's free up disk mode, and the site is in Copy mode. | Set mode: "free" with PUT /v1/sites/{siteId}/media-offload/settings first. | No |
not_running | 409 | The Media Offload operation has finished already. | Nothing to stop: the site's Media Offload says how it ended. | No |
not_failed | 409 | Setting up Media Offload didn't fail, so there's nothing to try again or cancel. | Read the site's Media Offload (status). | No |
files_in_storage | 409 | Some of the site's files are only in storage (free up disk), so Media Offload can't be turned off yet. message says how many. | Start a restore operation with turnOffAfter: true: it brings them back to the server, then turns Media Offload off. | No |
not_eligible | 409 | The account can't use Rabbitflare SMTP for this site: it needs a paid, running server (not a free trial) and a confirmed account email address. | Read eligible in GET /v1/sites/{siteId}/smtp. | No |
account_off | 409 | Rabbitflare SMTP is switched off for this account for good. | Contact support. | No |
paused | 409 | Email from this site is paused, by an automatic safety check or by Rabbitflare's team. | Read hold in GET /v1/sites/{siteId}/smtp: a first pause is lifted with POST /v1/sites/{siteId}/smtp/actions/resume once hold.canResume is true. | No |
checking | 409 | The site's Rabbitflare SMTP plugin file is being checked, and its emails are stopped meanwhile. | Try again in a few minutes: unless it was changed on purpose, it's checked and put back by itself. | Yes |
suspended | 409 | Email from this site is suspended. | Contact support. | No |
temporary | 409 | Something couldn't be checked just now. | Try again in a minute. | Yes |
not_held | 409 | Email from the site isn't stopped. | Nothing to lift. | No |
cannot_resume | 409 | The stop on the site's emails can't be lifted this way now. message says why: too soon after the pause, or only support can lift it. | Do what message says. | No |
already_confirmed | 409 | The address is confirmed already. | Nothing to do. | No |
reply_exists | 409 | The site has a reply address already. | Remove it first to use another. | No |
dns_mismatch | 422 | The domain doesn't point to the site's server yet. message says where it points now. | Point the domain's A record at the server's IPv4 address, wait a few minutes, then verify again. | No |
Payments
| Code | Status | What it means | What to do | Retry |
|---|---|---|---|---|
payment_method_required | 402 | There's no money in the wallet and no saved card to pay with. | Add funds to the wallet or save a card in the panel. | No |
card_declined | 402 | The card was declined. message gives the bank's reason. Nothing was created. | Use another card, or add funds to the wallet. | No |
payment_action_required | 402 | The bank wants the customer to confirm this payment, which can't happen through the API. Nothing was created. | Add funds to the wallet in the panel (wallet payments need no confirmation), or make this purchase in the panel. | No |
payment_required | 402 | An unpaid bill must be settled first (for example, the Own servers plan's). | Pay the open bill on the panel's Billing page, then try again. | No |
payment_failed | 402 | The payment didn't go through. message gives the reason. Nothing was changed. | Use another card, or add funds to the wallet, then try again. | No |
card_needed | 402 | Servers on this cloud need a saved card: data transfer beyond what the plan includes is charged to it. | Save a card in the panel, or pass paymentMethodId. | No |
transfer_unpaid | 402 | An earlier data transfer bill is unpaid. | Pay it on the panel's Billing page, then try again. | No |
billing_error | 402, 409, 502 | The payment couldn't be made or set up. message gives the reason. | Check the card in the panel, then try again. A 502 can be tried again in a minute. | At 502 |
license_required | 402 | The site is on a server of your own, so RabbitPress Cache needs one of your licences there. | Buy a RabbitPress Cache licence in the panel, then install again with its licenseId. | No |
unpaid | 402 | A Media Offload bill is unpaid, so it can't be turned on for a site. | Pay the bill on the panel's Billing page, then try again. | No |
charges_not_authorized | 403 | The account hasn't agreed to card charges yet. | In the panel, open Billing and accept the terms once. Then try again. | No |
card_not_found | 404 | The card in paymentMethodId isn't one of this account's saved cards. | Leave paymentMethodId out to pay with the default card, set in the panel's Billing. | No |
paypal_billed | 409 | This server is paid through PayPal, so price changes are approved on PayPal's site. | Make this change in the panel. | No |
Limits
| Code | Status | What it means | What to do | Retry |
|---|---|---|---|---|
limit_reached | 403, 409 | A limit is reached: message says which (servers per account, snapshots per server, domains per site, …). | Delete something first, or contact support to raise the limit. | No |
edge_new_account | 403 | A new account can have a few servers on this cloud, and its larger sizes once the account is a month old. | Choose a smaller size, or contact support to raise the limit. | No |
plan_unavailable | 403, 409, 422 | The plan can't be had there: it isn't offered on this cloud or in this region, it's sold out there right now, or it isn't open to your account yet. | Choose another plan or region. GET /v1/clouds/{cloud}/availability says what's in stock. | No |
too_many_addresses | 409 | The site has as many notice addresses as it can have. | Remove one first. | No |
rate_limited | 429 | Too many requests. scope says which limit: token, account, create, operation or network. | Wait for Retry-After seconds, then go on more slowly. | Yes |
concurrency_limited | 429 | Too many requests of this token are in progress at once. | Wait for a request to finish before sending the next. | Yes |
Server-side
| Code | Status | What it means | What to do | Retry |
|---|---|---|---|---|
internal_error | 500 | Something went wrong on our side. The change may or may not have happened. | Check whether it happened before trying again (send an Idempotency-Key with writes, so a retry is safe). If it keeps happening, contact support with the request id. | No |
bad_gateway | 502 | Something on our side didn't answer properly. | Try again in a moment. | Yes |
server_unreachable | 502 | The server didn't answer, or didn't finish the request. | Check that the server is running, then try again in a minute. | Yes |
server_error | 502 | The server answered, but not as expected. | Try again in a minute. If it keeps happening, contact support with the request id. | Yes |
cdn_error | 502 | The CDN didn't accept the change just now. | Try again in a few minutes. | Yes |
file_error | 502 | The site's server didn't complete the file operation. | Try again in a moment. | Yes |
email_failed | 502 | The email couldn't be sent just now. | Try again in a few minutes. | Yes |
api_unavailable | 503 | The API is switched off for everyone for a while. | Try again later; Retry-After says when. | Yes |
api_read_only | 503 | Only reads are served for a while (for example during maintenance). | Try the change again later; Retry-After says when. | Yes |
ssh_unavailable | 503 | Servers can't be reached from our side right now. | Try again later. If it keeps happening, contact support with the request id. | Yes |
card_payments_off | 503 | Card payments can't be taken right now, and servers on this cloud are paid by card. | Try again later, or choose another cloud. | Yes |
offer_unavailable | 503 | A discount couldn't be applied just now. Nothing was charged. | Try again in a minute. | Yes |
cdn_unavailable | 503 | The CDN isn't available right now. | Try again later. | Yes |
cdn_limit | 503 | Custom CDN hostnames can't be added right now. | Try again later. Our team has been told. | Yes |
try_again | 503 | It couldn't be started just now; nothing was changed. | Try again in a minute. | Yes |
apply_failed | 503 | Rabbitflare SMTP couldn't be started on the site's server just now. | Try again in a minute. | Yes |
Still have a question?
Our team answers support tickets about the API, and other developers answer in the community.