Skip to content

Rate limits

How many requests a token and an account can make, and how to slow down.

3 min read Updated

Limits keep the API quick for everyone. They're generous for real work, and a script that reaches one only has to wait a little and go on. Every answer says how much is left.

The limits

Each request counts in its kind and in every request of the hour, for its token and for its account. An account's limits are twice a token's, shared by all its tokens, so two busy tokens can't use more than that between them.

LimitCountsPer tokenPer account
Reads GET and HEAD, other than heavy ones 120 a minute 240 a minute
Changes POST, PUT, PATCH and DELETE, other than heavy ones 30 a minute 60 a minute
Heavy requests Those marked Heavy (below) 20 a minute 40 a minute
Every request All of the above together 3,000 an hour 6,000 an hour
Requests at once Sent and not yet answered 4 8
New servers Created through the API Per account only 10 an hour
New sites Created through the API Per account only 60 an hour

These are the defaults. GET /v1/token shows your token's own in rateLimits. Only servers and sites that were made count against the hourly limits on new ones: a request that failed costs nothing.

Heavy requests

Some requests reach one of your servers while you wait: graphs, logs, tools, checks. They count against the heavy limit instead of the reads or changes, and are marked Heavy in the reference:

OperationRequest
Get what's in stock on a cloud GET /v1/clouds/{cloud}/availability
Restart PHP on a server POST /v1/servers/{serverId}/actions/restart-php
Check PHP security updates now POST /v1/servers/{serverId}/actions/check-php-security
Get a server's graphs GET /v1/servers/{serverId}/metrics
List a server's snapshots and backups GET /v1/servers/{serverId}/snapshots
Get a server's logs and clean-up settings GET /v1/servers/{serverId}/logs
Clear a server's logs POST /v1/servers/{serverId}/logs/actions/clear
Purge a site's cache POST /v1/sites/{siteId}/actions/purge-cache
Reset the WordPress administrator's password POST /v1/sites/{siteId}/actions/reset-admin-password
Check a domain's DNS now POST /v1/sites/{siteId}/domains/{domainId}/actions/verify
Check a custom CDN hostname's DNS now POST /v1/sites/{siteId}/cdn/hostname/actions/check
List the requests a site's firewall stopped GET /v1/sites/{siteId}/firewall/events
List requests Cloudflare stopped on a site GET /v1/sites/{siteId}/protection/events
Get a server's security GET /v1/servers/{serverId}/security
Turn on a server's security POST /v1/servers/{serverId}/security/actions/enable
Turn off a server's security POST /v1/servers/{serverId}/security/actions/disable
Change a server's security settings PATCH /v1/servers/{serverId}/security/settings
List a server's allowed and blocked addresses GET /v1/servers/{serverId}/security/addresses
Allow, block or challenge an address on a server POST /v1/servers/{serverId}/security/addresses
Take an address off a server's list POST /v1/servers/{serverId}/security/addresses/actions/remove
Move an address to another of a server's lists POST /v1/servers/{serverId}/security/addresses/actions/move
Add a port to a server's port list POST /v1/servers/{serverId}/security/ports
Take a port off a server's port list DELETE /v1/servers/{serverId}/security/ports/{protocol}/{port}
Get the attacks stopped on a server GET /v1/servers/{serverId}/security/incidents
Scan a server's sites for malware POST /v1/servers/{serverId}/security/actions/scan
Turn off a security rule for false alarms POST /v1/servers/{serverId}/security/rules/actions/disable
Turn a security rule back on POST /v1/servers/{serverId}/security/rules/actions/enable
Install KernelCare on a server POST /v1/servers/{serverId}/security/kernel-patching/actions/enable
Remove KernelCare from a server POST /v1/servers/{serverId}/security/kernel-patching/actions/disable
Check a server's domains against blacklists POST /v1/servers/{serverId}/security/reputation/actions/check
Turn on Imunify360's WordPress plugin POST /v1/servers/{serverId}/security/wordpress-plugin/actions/enable
Turn off Imunify360's WordPress plugin POST /v1/servers/{serverId}/security/wordpress-plugin/actions/disable
Let a search engine through a server's bot checks POST /v1/servers/{serverId}/security/crawlers
Stop letting a search engine through DELETE /v1/servers/{serverId}/security/crawlers/{crawlerId}
Get a site's malware protection GET /v1/sites/{siteId}/malware-protection
Turn on a site's malware protection POST /v1/sites/{siteId}/malware-protection/actions/enable
Turn off a site's malware protection POST /v1/sites/{siteId}/malware-protection/actions/disable
Change a site's malware protection emails PATCH /v1/sites/{siteId}/malware-protection/settings
List a site's malware threats GET /v1/sites/{siteId}/malware-protection/threats
Clean a site's malware threats POST /v1/sites/{siteId}/malware-protection/threats/actions/clean
Undo a clean-up of a site's threats POST /v1/sites/{siteId}/malware-protection/threats/actions/undo-clean
Mark a site's threats as not malware POST /v1/sites/{siteId}/malware-protection/threats/actions/ignore
Have malware scans skip a path on a site POST /v1/sites/{siteId}/malware-protection/ignored-paths
Stop malware scans skipping a path DELETE /v1/sites/{siteId}/malware-protection/ignored-paths/{ignoredPathId}
Scan a site for malware POST /v1/sites/{siteId}/malware-protection/actions/scan
Change Imunify360's WordPress plugin in a site PATCH /v1/sites/{siteId}/malware-protection/wordpress-plugin
Get what a site uses of its server now GET /v1/sites/{siteId}/resources/usage
Add a cron job to a site POST /v1/sites/{siteId}/cron-jobs
Change a cron job PUT /v1/sites/{siteId}/cron-jobs/{jobId}
Resume a paused cron job POST /v1/sites/{siteId}/cron-jobs/{jobId}/actions/enable
Pause a cron job POST /v1/sites/{siteId}/cron-jobs/{jobId}/actions/disable
Delete a cron job DELETE /v1/sites/{siteId}/cron-jobs/{jobId}
Run a cron job now POST /v1/sites/{siteId}/cron-jobs/{jobId}/actions/run
List a cron job's runs GET /v1/sites/{siteId}/cron-jobs/{jobId}/runs
Get which of a site's cron jobs are running GET /v1/sites/{siteId}/cron-status
List a folder of a site GET /v1/sites/{siteId}/files
Read a text file of a site GET /v1/sites/{siteId}/files/content
Write a text file of a site PUT /v1/sites/{siteId}/files/content
Make a folder in a site POST /v1/sites/{siteId}/files/actions/create-folder
Make an empty file in a site POST /v1/sites/{siteId}/files/actions/create-file
Move or rename a file or folder POST /v1/sites/{siteId}/files/actions/move
Copy a file or folder POST /v1/sites/{siteId}/files/actions/copy
Delete files and folders of a site POST /v1/sites/{siteId}/files/actions/delete
Change a file's or folder's permissions POST /v1/sites/{siteId}/files/actions/chmod
Extract a .zip archive in a site POST /v1/sites/{siteId}/files/actions/extract
Make a .zip archive in a site POST /v1/sites/{siteId}/files/actions/compress
Upload a file to a site PUT /v1/sites/{siteId}/files/upload
Download a file or folder of a site GET /v1/sites/{siteId}/files/download
Download a backup's files or database GET /v1/sites/{siteId}/backups/{backupId}/download
Check backup storage POST /v1/backup-destinations/{destinationId}/actions/check
Check what a staging operation would do GET /v1/sites/{siteId}/staging/preview
Get what cloning a site needs GET /v1/sites/{siteId}/clone
Check a server's room for a clone GET /v1/sites/{siteId}/clone/room
Get RabbitPress Cache on a site GET /v1/sites/{siteId}/rabbitpress
See what turning on Media Offload would move POST /v1/sites/{siteId}/media-offload/actions/inspect
Send a test event POST /v1/webhooks/endpoints/{endpointId}/actions/send-test

How much is left

Every answer to a request with a token carries three headers, about the limit closest to running out:

Headers
RateLimit-Limit: 120
RateLimit-Remaining: 87
RateLimit-Reset: 41
RateLimit-Limit
How many requests that limit allows.
RateLimit-Remaining
How many are left.
RateLimit-Reset
Seconds until it starts again.

Over a limit

A request over a limit isn't done, and answers 429 rate_limited with a Retry-After header: the seconds to wait. The error says which limit it was in scope:

429 Too Many Requests
{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limited",
    "message": "Too many requests. Try again in 41 seconds.",
    "scope": "token",
    "limit": 120,
    "retryAfterSeconds": 41,
    "requestId": "req_8Zk2mPq4Xc7Lw9Tn0Bv3Ys",
    "docUrl": "https://rabbitflare.com/docs/api/errors#rate_limited"
  }
}
scopeThe limit reached
token This token's limit for the kind of request, or its hourly limit.
account The account's limit, shared by all its tokens.
create The account's limit on new servers or new sites in an hour.
operation A feature's own limit, the same as in the panel.
network Requests without a working token, from one network.

Back off

Wait as long as Retry-After says, then send the request again; don't send it again at once in a loop. Better still, slow down before the limit: when RateLimit-Remaining reaches 0, wait RateLimit-Reset seconds.

// Send a request; on 429, wait as long as Retry-After says, then send it again.
async function withBackOff(send, attempts = 5) {
  for (let attempt = 1; ; attempt++) {
    const res = await send();
    if (res.status !== 429 || attempt === attempts) return res;
    const seconds = Number(res.headers.get("Retry-After")) || 1;
    await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
  }
}

const res = await withBackOff(() =>
  fetch("https://api.rabbitflare.com/v1/servers", { headers: { Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}` } }),
);
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);
const { data: servers } = await res.json();
console.log(`${servers.length} servers`);

// Slow down before the limit: when nothing is left, wait for the window to start again.
if (res.headers.get("RateLimit-Remaining") === "0") {
  const reset = Number(res.headers.get("RateLimit-Reset"));
  await new Promise((resolve) => setTimeout(resolve, reset * 1000));
}

Spread work out rather than sending it in bursts, and keep what rarely changes, like the catalogue of clouds and plans, instead of asking for it every time (the errors guide's helper backs off too).

Requests at once

A token can have 4 requests waiting for an answer at once, and an account 8. One more answers 429 concurrency_limited, with Retry-After. To send many requests, run at most 4 at a time, for example with a small queue.

Other limits

  • Features have their own limits, the same as in the panel. Reaching one answers 429 rate_limited with scope operation.
  • The account's own limits, like how many servers it can have, apply as in the panel: limit_reached says so.
  • Some features share limits with every account: setting Media Offload up or taking it away (cloning a site that has it counts too), setting up the CDN and adding a CDN hostname. When one is busy, the request answers 429 rate_limited with scope operation and the seconds to wait, and it doesn't count against your token's limits. Each also has a cap per account per day, and backup downloads are limited to 50 GB a day per account. A day ends at 00:00 UTC.
  • Without a working token, requests are counted per network: 60 a minute. After 20 answers of 401 within 5 minutes, every request from that network answers 429 for 5 minutes.
  • A token refused by the account's checks (an address outside its allowed IP addresses, the API not open to the account or paused on it, two-factor authentication owed, changes while only reads are served) is limited all the same, as many refusals as its own limits allow, counted apart from its own requests and its account's: once they're used up, it answers 429 instead, while its requests from an allowed address go on.

Higher limits

If your app needs more, open a support ticket saying what it does and which limit it reaches. Limits can be raised for an account.

Still have a question?

Our team answers support tickets about the API, and other developers answer in the community.

Contact support

Popular

API docs