Skip to content

Connect backup storage

POST /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

FieldType and description
Idempotency-Key

string 1 to 255 characters

A key of your own for this request, like a UUID: letters, digits and _ - : . Send the request again with the same key (after a timeout, say) and it's done only once. Keys are kept for 24 hours (see Idempotency).

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"
}'

Response

201 Created Returns the BackupDestination object in data.

The BackupDestination object's fields 10 fields
FieldType and description
id

string

The storage's id: what a site's backup settings name as destination.

kind

string

What it is: s3 (an Amazon S3 bucket), spaces (a DigitalOcean Space), vultr (Vultr Object Storage), b2 (a B2 bucket, connected in the panel: through the API a B2 bucket connects as s3compat), r2 (a Cloudflare R2 bucket), s3compat (other storage that speaks S3), gdrive (Google Drive), dropbox (Dropbox) or sftp (an SFTP server).

Known values: s3spacesvultrb2r2s3compatgdrivedropboxsftp More can appear.

name

string

Its name.

detail

string

Where it points: a bucket and its folder (shop-backups/sites), the Google or Dropbox account, or the SFTP user, server and folder ([email protected]:site-backups).

status

string

ok (it worked when last checked, or for the last backup), error (see lastError) or pending (an SFTP server waiting for Rabbitflare's key: add publicKey to it, then check it).

Known values: okerrorpending More can appear.

lastError

string or null

What went wrong when it was last checked or used, in one plain sentence. Null unless status is error.

publicKey

string or null

An SFTP server's Rabbitflare key, when it signs in with one: this public half goes in the user's ~/.ssh/authorized_keys on the server. Null otherwise.

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

201 Created
{
  "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 codeWhen, and what to do
400 bad_request

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.

403 feature_unavailable

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 message; there may be nothing left to do.

422 validation_failed

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.

429 rate_limited

Too many requests. scope says which limit: token, account, create, operation or network.

Wait for Retry-After seconds, then go on more slowly.

503 try_again

It couldn't be started just now; nothing was changed.

Try again in a minute.

Rate limit

Write requests: 30 a minute per token, 60 per account. More in Rate limits.

Added on .

Popular

API docs