Get what cloning a site needs
/v1/sites/{siteId}/clone Returns whether the site can be cloned (blockers), its size, the servers it can be cloned to (its own first) with the room on its own server, a name for the new site, the clone in progress and the latest clones.
It asks the site's server to measure the site, which takes a few seconds. A token limited to some servers sees only those as destinations, and only the clones into them (active, recent).
Scopes
The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).
-
sites:read - View sites. See sites and their domains, CDN, firewall, malware protection, backups, staging, resources, SMTP and Media Offload. SMTP includes who each site's recent emails went to, their subjects, and the team's sign-in addresses.
Path parameters
| Field | Type and description |
|---|---|
siteId Required | string The id of the site to clone. |
Example request
curl "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" const res = await fetch("https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone", {
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
},
});
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.sites.clone.options({ siteId: "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d" });
console.log(data); <?php
$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
],
]);
$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.get(
"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/clone",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
200 OK Returns the CloneSetup object in data.
The CloneSetup object's fields 91 fields
| Field | Type and description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
blockers | array of strings Why the site can't be cloned right now (cloning isn't open to the account, it's a staging copy, it's still installing, its server is off, another operation is running…). Empty when it can be. | ||||||||||
sizes | object or null The site's size. Null when it couldn't be measured. | ||||||||||
filesBytes | integer The site's files, without caches and backup archives, in bytes. | ||||||||||
databaseBytes | integer The site's database, in bytes. | ||||||||||
wordpressVersion | string or null The site's WordPress version. Null when not known. | ||||||||||
suggestedName | string A name for the new site: the site's, with “copy”. | ||||||||||
destinations | array of objects The servers of the account the site can be cloned to, its own first. A token limited to some servers sees only those. | ||||||||||
id | string The server's id: send it as | ||||||||||
name | string The server's name. | ||||||||||
cloud | string Where the server runs (see the Server object). Known values: | ||||||||||
region | string The server's location id. | ||||||||||
sameServer | boolean Whether it's the site's own server. | ||||||||||
unavailableReason | string or null Why the site can't be cloned there right now (the server is off, still being set up…). Null when it can. | ||||||||||
room | object or null The room on the site's own server. Null when it couldn't be checked. | ||||||||||
serverId | string The destination server's id. | ||||||||||
freeBytes | integer or null Free room on the server's disk. Null when it couldn't be checked. | ||||||||||
neededBytes | integer The room the clone needs there while it's made, with what must stay free (0 when the site's size wasn't given). | ||||||||||
fits | boolean or null Whether the clone fits. Null when that couldn't be checked; the clone checks again before copying. | ||||||||||
unknown | boolean Whether the room couldn't be checked (the server didn't answer). | ||||||||||
active | object or null A clone of this site that hasn't finished (one runs at a time). Null when none is. | ||||||||||
id | string The clone's id. | ||||||||||
status | string
Known values: | ||||||||||
stage | string or null What's happening now, in words. Null once it's finished. | ||||||||||
progress | integer or null How far the copy has got, 0 to 100. Null when that isn't known. | ||||||||||
source | object or null The site that is copied. A clone never changes it. Null when this token can't reach that site's server (a token limited to some servers). Show its 3 fields
| ||||||||||
target | object The new site the copy is made into. Show its 3 fields
| ||||||||||
crossServer | boolean Whether the new site is on another server than the original. | ||||||||||
options | object What the clone copies besides the files and the database. Show its 4 fields
| ||||||||||
lastError | string or null Why the clone failed (or was cancelled by itself). Null otherwise. | ||||||||||
notes | array of strings What's worth knowing after the clone: settings that didn't fit the destination, cron jobs copied paused, and the like. | ||||||||||
health | object or null The new site's own pages, checked right after the copy. Null until they're checked. Show its 3 fields
| ||||||||||
skipped | array of objects Files the copy left out (up to 100 of them). Show its 2 fields
| ||||||||||
skippedCount | integer How many files the copy left out in all. | ||||||||||
sizes | object or null What was copied. Null until the copy is made. Show its 2 fields
| ||||||||||
cancellable | boolean Whether it can be cancelled now ( | ||||||||||
createdAt | string An ISO 8601 time, in UTC When the clone was started. | ||||||||||
startedAt | string or null An ISO 8601 time, in UTC When the copy started. Null until then. | ||||||||||
finishedAt | string or null An ISO 8601 time, in UTC When it finished. Null until then. | ||||||||||
recent | array of objects The latest clones of this site (up to 5), newest first. | ||||||||||
id | string The clone's id. | ||||||||||
status | string
Known values: | ||||||||||
stage | string or null What's happening now, in words. Null once it's finished. | ||||||||||
progress | integer or null How far the copy has got, 0 to 100. Null when that isn't known. | ||||||||||
source | object or null The site that is copied. A clone never changes it. Null when this token can't reach that site's server (a token limited to some servers). Show its 3 fields
| ||||||||||
target | object The new site the copy is made into. Show its 3 fields
| ||||||||||
crossServer | boolean Whether the new site is on another server than the original. | ||||||||||
options | object What the clone copies besides the files and the database. Show its 4 fields
| ||||||||||
lastError | string or null Why the clone failed (or was cancelled by itself). Null otherwise. | ||||||||||
notes | array of strings What's worth knowing after the clone: settings that didn't fit the destination, cron jobs copied paused, and the like. | ||||||||||
health | object or null The new site's own pages, checked right after the copy. Null until they're checked. Show its 3 fields
| ||||||||||
skipped | array of objects Files the copy left out (up to 100 of them). Show its 2 fields
| ||||||||||
skippedCount | integer How many files the copy left out in all. | ||||||||||
sizes | object or null What was copied. Null until the copy is made. Show its 2 fields
| ||||||||||
cancellable | boolean Whether it can be cancelled now ( | ||||||||||
createdAt | string An ISO 8601 time, in UTC When the clone was started. | ||||||||||
startedAt | string or null An ISO 8601 time, in UTC When the copy started. Null until then. | ||||||||||
finishedAt | string or null An ISO 8601 time, in UTC When it finished. Null until then. |
Example response
{
"data": {
"blockers": [],
"sizes": {
"filesBytes": 48000000,
"databaseBytes": 6400000
},
"wordpressVersion": "6.8.3",
"suggestedName": "Shop copy",
"destinations": [
{
"id": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
"name": "Production",
"cloud": "digitalocean",
"region": "fra1",
"sameServer": true,
"unavailableReason": null
},
{
"id": "9e8d7c6b-5a4f-4e3d-9c2b-1a0f9e8d7c6b",
"name": "Staging box",
"cloud": "vultr",
"region": "lhr",
"sameServer": false,
"unavailableReason": "Switched off"
}
],
"room": {
"serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
"freeBytes": 41871163392,
"neededBytes": 330825728,
"fits": true,
"unknown": false
},
"active": null,
"recent": [
{
"id": "2b7e1c9d-3a4f-4e5b-8d6c-0f1e2a3b4c5d",
"status": "done",
"stage": null,
"progress": 100,
"source": {
"id": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"name": "Shop",
"serverName": "Production"
},
"target": {
"id": "6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f",
"name": "Shop copy",
"serverName": "Production"
},
"crossServer": false,
"options": {
"resources": true,
"firewall": true,
"cron": true,
"noindex": true
},
"lastError": null,
"notes": [
"The site's 2 cron jobs were copied paused, so they don't run twice. Turn each on with POST /v1/sites/{siteId}/cron-jobs/{jobId}/actions/enable when you want it."
],
"health": {
"ok": true,
"problems": [],
"reason": null
},
"skipped": [
{
"path": "wp-content/uploads/cache.sock",
"reason": "special_file"
}
],
"skippedCount": 1,
"sizes": {
"filesBytes": 48000000,
"databaseBytes": 6400000
},
"cancellable": false,
"createdAt": "2026-11-18T15:40:12.000Z",
"startedAt": "2026-11-18T15:41:02.000Z",
"finishedAt": "2026-11-18T15:44:51.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 |
|---|---|
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 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 |