Try a failed clone again
/v1/sites/{siteId}/clone/actions/retry Starts a failed clone again, into the same new site, from the original as it is now. The new site must be active and the original still there; otherwise delete the new site and clone again. The token must reach the original's server too, as starting the clone needed (404 not_found otherwise). Trying again a clone of a site that has Media Offload counts as setting Media Offload up, 200 a day per account (429 rate_limited).
What happens next. The answer is 202 with the clone queued. Poll GET /sites/{siteId}/clone/status with the new site's id every 10 seconds until status is done, failed (the reason in lastError) or cancelled.
Idempotency-Key required. A request sent again (after a timeout, say) must never make a second site or start a second copy: each needs an Idempotency-Key (400 idempotency_key_required without one), the same request sent again with the same key gets the first answer, and nothing is made twice; while the first is still running, the same key answers 409 idempotency_in_progress (try again in a moment).
Media Offload. When the site being copied has Media Offload on (on, being set up, being turned off, or failed), the new site gets it too, billed by use after each month like turning it on (POST /sites/{siteId}/media-offload/actions/enable): so this also needs billing: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 the account's agreement to card charges, given once in the panel's Billing (403 charges_not_authorized). Nothing is made or changed then.
Scopes
The token needs these scopes. Without them, the request is refused with insufficient_scope (see Scopes).
-
sites:create - Create sites. Install new WordPress sites on your servers. Cloning a site also needs Manage sites.
-
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 id of the new site the clone is made into ( |
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 POST "https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/actions/retry" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" \
-H "Idempotency-Key: $KEY" 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/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/actions/retry", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
"Idempotency-Key": idempotencyKey,
},
});
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.clone.retry({ siteId: "6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f" });
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/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/actions/retry');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
'Idempotency-Key: ' . $idempotencyKey,
],
]);
$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.post(
"https://api.rabbitflare.com/v1/sites/6d3f2e1c-9b8a-4c7d-8e6f-5a4b3c2d1e0f/clone/actions/retry",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
"Idempotency-Key": idempotency_key,
},
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
202 Accepted Returns the SiteClone object in data.
The SiteClone object's fields 35 fields
| Field | Type and description |
|---|---|
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). |
id | string The site's id. |
name | string The site's name. |
serverName | string The name of the site's server. |
target | object The new site the copy is made into. |
id | string The site's id. |
name | string The site's name. |
serverName | string The name of the site's server. |
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. |
resources | boolean The site's PHP and resource settings were copied, where they fit the destination server. |
firewall | boolean The firewall's mode, sensitivity, login protection, blocked and allowed addresses and exceptions were copied. |
cron | boolean The site's cron jobs were copied, paused (the original keeps running its own). |
noindex | boolean Search engines are asked not to index the clone (WordPress's “Discourage search engines” setting). |
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. |
ok | boolean Whether the new site's pages answered as the original's did. |
problems | array of strings What went wrong, page by page. |
reason | string or null Why the pages failed, where the server could tell. Null otherwise. |
skipped | array of objects Files the copy left out (up to 100 of them). |
path | string The file's path in the site. |
reason | string Why it was left out: Known values: |
skippedCount | integer How many files the copy left out in all. |
sizes | object or null What was copied. Null until the copy is made. |
filesBytes | integer The site's files, without caches and backup archives, in bytes. |
databaseBytes | integer The site's database, in bytes. |
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": {
"id": "2b7e1c9d-3a4f-4e5b-8d6c-0f1e2a3b4c5d",
"status": "queued",
"stage": "Starting again",
"progress": null,
"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": [],
"health": null,
"skipped": [],
"skippedCount": 0,
"sizes": null,
"cancellable": true,
"createdAt": "2026-11-18T15:40:12.000Z",
"startedAt": "2026-11-18T16:10:00.000Z",
"finishedAt": 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. |
403 feature_ | This product isn't open to the account. Contact support if you'd like it opened. |
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 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 invalid_ | The resource's status doesn't allow this now (for example, powering on a server that is running). Check the resource's |
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 |
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. |