Choose where and how often a site is backed up
/v1/sites/{siteId}/backup/settings Turns the site's backups on, or changes them: where they go (rabbitflare and a region, or the id of your storage from GET /backup-destinations), how often (daily or weekly at an hour, UTC, or manual), and how many are kept. The settings are saved whole; sending the ones the site already has answers the object as it is. The answer is the object with the new settings and nextRunAt.
Payment. Backups to storage of your own cost nothing. Rabbitflare Backup is billed by use, after each month: $2.00 a month for the site, counted by the days it's backed up there (no fee for sites on Amazon EC2 and Google Cloud servers), plus the space its backups take up, per GB per month at the region's price (prices). The month's bill is paid from the wallet first, then the account's saved card; a total under $0.50 is carried to the next month. Choosing Rabbitflare Backup needs a saved card (402 payment_method_required) and, when the site isn't on it already, the account's agreement to card charges, given once in the panel's Billing (403 charges_not_authorized). An Idempotency-Key header is required.
Scopes. Settings whose destination is Rabbitflare Backup (turning it on, or changing its settings while the site is on it) can start a monthly charge, so they need billing:write as well as sites:write (403 insufficient_scope without it; billing:write is for tokens for all servers only, so a token limited to some servers is refused with 403 all_servers_required), and nothing changes. Storage of your own, moving away from Rabbitflare Backup and removeStored need sites:write only.
Moving away from Rabbitflare Backup. The site's backups there stay (and their space stays billed) until they're deleted: send removeStored: true to delete them with the move, or delete them one by one. Only finished backups are deleted, so removeStored: true is refused while a backup to Rabbitflare Backup is running or waiting its turn (409 conflict): cancel it first (POST /sites/{siteId}/backups/{backupId}/actions/cancel), or wait for it to finish.
Limits. Keep 1 to 60 backups. Only for a site that has finished installing, never a staging copy (409 staging_copy: back up its live site). Storage of your own must have been checked first (status not pending). 30 changes per site an hour.
Scopes
The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).
-
sites:write - Manage sites. Domains, SSL, CDN, cache, firewall, malware protection, resources, backups, staging, Media Offload, SMTP and RabbitPress Cache. Choosing Rabbitflare Backup for a site's backups, and turning on Media Offload or a site's malware protection, also need Turn on paid features: they start monthly charges.
Headers
| Field | Type and description |
|---|---|
Idempotency-Key Required | string 1 to 255 characters A key of your own for this request, like a UUID: letters, digits and |
Path parameters
| Field | Type and description |
|---|---|
siteId Required | string The site's id. |
Request body
JSON, with these fields. Fields that aren't listed are refused.
| Field | Type and description |
|---|---|
destination Required | string Where backups go: |
region | string Where Rabbitflare Backup keeps them: One of: |
frequency Required | string
One of: |
hour | integer 0 to 23 The hour of the day (0 to 23, UTC) a scheduled backup starts. Left out: 3. |
weekday | integer 0 to 6 For weekly backups, the day: 0 (Sunday) to 6 (Saturday). Left out: 0. |
keep Required | integer 1 to 60 How many backups to keep, 1 to 60: when one more completes, the oldest beyond that number are deleted. |
removeStored | boolean When the site moves from Rabbitflare Backup to storage of your own: |
Example request
# Keep this key when you send the same request again (after a timeout, say), so it's only done once.
KEY=$(uuidgen)
curl -X PUT "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup/settings" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $KEY" \
-d '{
"destination": "rabbitflare",
"region": "frankfurt",
"frequency": "daily",
"hour": 3,
"keep": 14
}' import { randomUUID } from "node:crypto";
// Keep this key when you send the same request again (after a timeout, say), so it's only done once.
const idempotencyKey = randomUUID();
const res = await fetch("https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup/settings", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
"Content-Type": "application/json",
"Idempotency-Key": idempotencyKey,
},
body: JSON.stringify({
"destination": "rabbitflare",
"region": "frankfurt",
"frequency": "daily",
"hour": 3,
"keep": 14
}),
});
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);
const { data } = await res.json();
console.log(data); import { Rabbitflare } from "@rabbitflare/api";
const rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });
// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.
const data = await rf.sites.backup.updateSettings({
siteId: "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
destination: "rabbitflare",
region: "frankfurt",
frequency: "daily",
hour: 3,
keep: 14,
});
console.log(data); <?php
// Keep this key when you send the same request again (after a timeout, say), so it's only done once.
$idempotencyKey = bin2hex(random_bytes(16));
$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup/settings');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
'Content-Type: application/json',
'Idempotency-Key: ' . $idempotencyKey,
],
CURLOPT_POSTFIELDS => json_encode([
'destination' => 'rabbitflare',
'region' => 'frankfurt',
'frequency' => 'daily',
'hour' => 3,
'keep' => 14,
]),
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
throw new RuntimeException("Rabbitflare API error $status: $body");
}
print_r(json_decode($body, true)['data']); import os
import uuid
import requests
# Keep this key when you send the same request again (after a timeout, say), so it's only done once.
idempotency_key = str(uuid.uuid4())
response = requests.put(
"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/backup/settings",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
"Idempotency-Key": idempotency_key,
},
json={
"destination": "rabbitflare",
"region": "frankfurt",
"frequency": "daily",
"hour": 3,
"keep": 14,
},
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
200 OK Returns the SiteBackup object in data.
The SiteBackup object's fields 43 fields
| Field | Type and description |
|---|---|
settings | object or null Where the site's backups go and how often. Null while backups are off for the site: |
destination | string Where backups go: |
region | string or null Where Rabbitflare Backup keeps them: Known values: |
frequency | string
Known values: |
hour | integer The hour of the day (0 to 23, UTC) a scheduled backup starts. |
weekday | integer The day a weekly backup is made, from 0 (Sunday) to 6 (Saturday). |
keep | integer How many backups are kept (1 to 60): when one more completes, the oldest beyond that number are deleted. Backups made just before a restore count too. |
paused | boolean Whether scheduled backups are paused (see |
pausedReason | string or null Why they're paused, in one plain sentence. Null while they aren't. |
nextRunAt | string or null An ISO 8601 time, in UTC When the next scheduled backup is due. Null for |
suggestedRegion | string The Rabbitflare Backup region nearest the site's server. Known values: |
prices | array of objects What Rabbitflare Backup would cost this site in each region. It's billed by use, after each month: the site's fee for the days it's backed up there, and the space its backups take up. Storage of your own costs nothing. |
region | string The region: Known values: |
name | string Its name, like |
siteFeeCents | integer The fee for backing the site up there, per month, in US cents, counted by the day: 0 for sites on Amazon EC2 and Google Cloud servers. |
centsPerGbMonth | number What each GB (1,073,741,824 bytes) of the site's backups costs per month, in US cents (it can have decimals). |
currency | string Always Always |
hasCard | boolean Whether the account has a saved card, which Rabbitflare Backup needs ( |
storedBytes | integer What the site's completed backups in Rabbitflare Backup take up now: what their storage is billed on. |
latestBackup | object or null The site's newest backup: the one running, else the last one made. Null before the first. All of them: |
id | string The backup's id. |
status | string
Known values: |
trigger | string Why it was made: Known values: |
location | string Where it's kept, in words: Rabbitflare Backup and its region, or the name your storage had when the backup was made. |
sizeBytes | integer or null Its whole size. Null until it's completed. |
filesBytes | integer or null The size of its files part (a .tar.gz archive). Null until it's completed. |
databaseBytes | integer or null The size of its database part (a gzipped SQL dump). Null until it's completed. |
progress | number or null How far it got, from 0 to 1, when that's known (1 once it's completed). Null otherwise. |
stage | string or null What it's doing while it runs, like |
error | string or null Why it failed, in one plain sentence. Null unless it failed. |
startedAt | string An ISO 8601 time, in UTC When it was started (asked for, or due). |
finishedAt | string or null An ISO 8601 time, in UTC When it completed or failed. Null while it runs. |
canRestore | boolean Whether the site can be restored from it ( |
canDownload | boolean Whether its parts can be downloaded ( |
restore | object or null The site's latest restore from the last 24 hours, running or finished. Null when there's none. |
id | string The restore's id. |
backupId | string The backup it restores from. |
parts | string What it restores: Known values: |
status | string
Known values: |
stage | string or null What it's doing while it runs, like |
error | string or null Why it failed, in one plain sentence. Null unless it failed. |
startedAt | string An ISO 8601 time, in UTC When it was asked for. |
finishedAt | string or null An ISO 8601 time, in UTC When it completed or failed. Null while it runs. |
Example response
{
"data": {
"settings": {
"destination": "rabbitflare",
"region": "frankfurt",
"frequency": "daily",
"hour": 3,
"weekday": 0,
"keep": 14,
"paused": false,
"pausedReason": null,
"nextRunAt": "2026-11-20T03:00:00.000Z"
},
"suggestedRegion": "frankfurt",
"prices": [
{
"region": "virginia",
"name": "United States (Virginia)",
"siteFeeCents": 200,
"centsPerGbMonth": 4.6,
"currency": "usd"
},
{
"region": "frankfurt",
"name": "Europe (Frankfurt)",
"siteFeeCents": 200,
"centsPerGbMonth": 4.9,
"currency": "usd"
},
{
"region": "singapore",
"name": "Asia Pacific (Singapore)",
"siteFeeCents": 200,
"centsPerGbMonth": 5,
"currency": "usd"
}
],
"hasCard": true,
"storedBytes": 17953243136,
"latestBackup": {
"id": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
"status": "completed",
"trigger": "scheduled",
"location": "Rabbitflare Backup (Europe (Frankfurt))",
"sizeBytes": 1284311552,
"filesBytes": 1201143808,
"databaseBytes": 83167744,
"progress": 1,
"stage": null,
"error": null,
"startedAt": "2026-11-19T03:00:04.000Z",
"finishedAt": "2026-11-19T03:06:41.000Z",
"canRestore": true,
"canDownload": true
},
"restore": null
}
} Errors
The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).
| Status and code | When, and what to do |
|---|---|
400 idempotency_ | 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. |
402 payment_ | 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. |
403 insufficient_ | The token lacks a scope this operation needs ( Edit the token in the panel and add the scopes in |
403 all_ | 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. |
403 feature_ | This product isn't open to the account. Contact support if you'd like it opened. |
403 charges_ | The account hasn't agreed to card charges yet. In the panel, open Billing and accept the terms once. Then try again. |
404 not_ | The resource doesn't exist, or isn't this account's. Check the id. Ids of other accounts' resources answer the same way. |
409 staging_ | 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. |
409 conflict | This clashes with something that exists, or is already done (for example, a domain already connected to a site). Read |
409 server_ | 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 |
422 validation_ | One or more fields are missing or wrong. Correct the fields named in |
429 rate_ | Too many requests. Wait for Retry-After seconds, then go on more slowly. |