Connect backup storage
/v1/backup-destinations Connects storage of your own for site backups: an Amazon S3 bucket (s3), a DigitalOcean Space (spaces), Vultr Object Storage (vultr), a Cloudflare R2 bucket (r2), any other storage that speaks S3 (s3compat), or an SFTP server (sftp). Google Drive and Dropbox are connected in the panel, by signing in to them.
It's checked before it's saved, from Rabbitflare's side: a small file is written and deleted (400 bad_request with the reason when that fails). So an S3-compatible endpoint or an SFTP server must be on the public internet: a name whose IPv4 addresses are all public, or a public IPv4 address (422 validation_failed otherwise, or 503 try_again when its DNS doesn't answer). An SFTP server signing in with Rabbitflare's key (auth: "key", the default) is saved as pending: add the answer's publicKey to the user's ~/.ssh/authorized_keys on the server, then check it (POST /backup-destinations/{destinationId}/actions/check).
Keys and passwords are kept encrypted and never answered. The answer is 201 with the storage; Location is its path, /v1/backup-destinations/{destinationId}, where GET reads it, PATCH renames it and DELETE removes it. Limits. 20 per account, 20 connected an hour.
Storage belongs to the whole account, as in the panel, not to a server: a token limited to some servers sees and manages all of it too, with where it points (detail) and the count of sites on every server that back up to it (siteCount).
Scopes
The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).
-
sites:files - Files and logins. File Manager, WordPress logins, cron jobs, backup downloads and backup storage. Full access to the sites' code and data.
Headers
| Field | Type and description |
|---|---|
Idempotency-Key | string 1 to 255 characters A key of your own for this request, like a UUID: letters, digits and |
Example request
curl -X POST "https://api.rabbitflare.com/v1/backup-destinations" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"kind": "s3",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"bucket": "shop-backups",
"folder": "sites"
}' const res = await fetch("https://api.rabbitflare.com/v1/backup-destinations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"kind": "s3",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"bucket": "shop-backups",
"folder": "sites"
}),
});
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 });
const data = await rf.backupDestinations.create({
kind: "s3",
accessKeyId: "AKIAIOSFODNN7EXAMPLE",
secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
bucket: "shop-backups",
folder: "sites",
});
console.log(data); <?php
$ch = curl_init('https://api.rabbitflare.com/v1/backup-destinations');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'kind' => 's3',
'accessKeyId' => 'AKIAIOSFODNN7EXAMPLE',
'secretAccessKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
'bucket' => 'shop-backups',
'folder' => 'sites',
]),
]);
$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 requests
response = requests.post(
"https://api.rabbitflare.com/v1/backup-destinations",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
json={
"kind": "s3",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"bucket": "shop-backups",
"folder": "sites",
},
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
201 Created Returns the BackupDestination object in data.
The BackupDestination object's fields 10 fields
| Field | Type and description |
|---|---|
id | string The storage's id: what a site's backup settings name as |
kind | string What it is: Known values: |
name | string Its name. |
detail | string Where it points: a bucket and its folder ( |
status | string
Known values: |
lastError | string or null What went wrong when it was last checked or used, in one plain sentence. Null unless |
publicKey | string or null An SFTP server's Rabbitflare key, when it signs in with one: this public half goes in the user's |
hostKeyFingerprint | string or null An SFTP server's identity (its host key's fingerprint), noted at its first successful check: backups go only to a server that still has it. Null until then, and for other kinds. |
siteCount | integer How many sites back up to it now. |
createdAt | string An ISO 8601 time, in UTC When it was connected. |
Example response
{
"data": {
"id": "8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12",
"kind": "s3",
"name": "Amazon S3 · shop-backups",
"detail": "shop-backups/sites",
"status": "ok",
"lastError": null,
"publicKey": null,
"hostKeyFingerprint": null,
"siteCount": 0,
"createdAt": "2026-11-19T10:00:00.000Z"
}
} 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 bad_ | The request can't be carried out as sent. Change the request as |
403 feature_ | This product isn't open to the account. Contact support if you'd like it opened. |
409 conflict | This clashes with something that exists, or is already done (for example, a domain already connected to a site). Read |
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. |
503 try_ | It couldn't be started just now; nothing was changed. Try again in a minute. |