Skip to content

Create a staging copy

POST /v1/sites/{siteId}/staging

Makes a private copy of the live site on the same server (its files and its database), on its own address with a certificate, password protected, with outgoing email held and scheduled tasks paused. One copy per live site, included with the site.

What happens next. The answer is 201 with the copy installing and the create operation in activeRun. It usually takes a few minutes, depending on the site's size. Poll GET /sites/{siteId}/staging every 10 seconds until activeRun is null; the operation is then first in recentRuns, completed, or failed with the reason in lastError.

Limits. The site must be installed and its server running, with no other operation in progress. A site's copy can be created 3 times a week (createsLeftThisWeek), and an account's copies a few times a day: past that, 409 limit_reached says when to try again. blockers in GET /sites/{siteId}/staging says what stands in the way.

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

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).

Path parameters

FieldType and description
siteId Required

string

The live site's id (never the staging copy's).

Example request

curl -X POST "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging" \
  -H "Authorization: Bearer $RABBITFLARE_TOKEN"

Response

201 Created Returns the SiteStaging object in data.

The SiteStaging object's fields 70 fields
FieldType and description
live

object

The live site.

id

string

The live site's id.

name

string

The live site's name.

url

string

The live site's address.

copy

object or null

The site's staging copy. Null when it has none.

id

string

The copy's id. It's a site of its own (GET /sites/{siteId} shows it), changed through its live site's staging operations.

name

string

The copy's name: the live site's, with “(staging)”.

status

string

installing: being created (see the staging's activeRun). active: ready. failed: creating it failed, and it's being removed. deleting: being deleted.

Known values: installingactivefaileddeleting More can appear.

url

string

The copy's address.

adminUrl

string

The address of the copy's WordPress dashboard. Its users and passwords are the live site's, as of the last copy of the database.

hostname

string

The copy's own address: staging. and the live site's built-in address. Search engines are always asked not to index it.

sslStatus

string

The copy's SSL certificate: none, pending (being issued), active or failed.

Known values: nonependingactivefailed More can appear.

certificate

string

Which certificate the copy is served with: trusted (no browser warning), securing (a trusted one is being set up; meanwhile a temporary one, which browsers warn about), or temporary (only one made on its server, which browsers warn about).

Known values: trustedsecuringtemporary More can appear.

certificateRetry

boolean

Whether a trusted certificate can be asked for again (the last tries gave up): POST /sites/{siteId}/actions/reissue-ssl with the copy's id.

createdAt

string An ISO 8601 time, in UTC

When the copy was created.

databaseSyncedAt

string or null An ISO 8601 time, in UTC

When the live site's database was last copied into it (when it was made or refreshed). Null until then.

filesSyncedAt

string or null An ISO 8601 time, in UTC

When the live site's files were last copied into it. Null until then.

settings

object

The staging copy's settings.

Show its 6 fields
FieldType and description
protect

boolean

Password protection: visitors must enter username and its password to see the copy (GET /sites/{siteId}/staging/password-protection). On by default. The copy has the live site's user accounts, so keep it on unless you need to share the copy.

username

string

The username visitors enter while password protection is on.

holdEmail

boolean

Whether the copy's outgoing email is held, so it sends no orders, password resets or newsletters. On by default.

tasks

boolean

Whether scheduled tasks (WP-Cron, Action Scheduler) run on the copy. Off by default, so the copy doesn't repeat the live site's work (renewals, newsletters).

status

string

Whether these settings are in place on the server: applying (being put in place, a few seconds), applied, or failed (see lastError; send them again).

Known values: appliedapplyingfailed More can appear.

lastError

string or null

Why the settings couldn't be put in place (with status: "failed"). Null otherwise.

activeRun

object or null

The staging operation in progress (or waiting for our team). Null when none is. Poll GET /sites/{siteId}/staging every 10 seconds until it's null again; the operation is then first in recentRuns.

id

string

The operation's id.

operation

string

create (make the copy), refresh (copy the live site into it again), push (copy it to the live site) or undo (put the live site back to a restore point).

Known values: createrefreshpushundo More can appear.

status

string

queued: waiting to start (one staging operation runs on a server at a time). running: under way (see stage and progress). completed. failed: see lastError; what it was changing is as it was. cancelled. attention: something went wrong while switching the live site over, and our team is putting it right.

Known values: queuedrunningcompletedfailedcancelledattention More can appear.

phase

string or null

While it runs: prepare (getting everything ready; the live site hasn't been touched and it can be cancelled), apply (switching over, which takes seconds) or recovering (being put right). Null while queued and once it's finished.

Known values: prepareapplyrecovering More can appear.

stage

string or null

What's happening now, in words. Null once it's finished.

progress

integer or null

How far it has got, 0 to 100. Null when that isn't known.

cancellable

boolean

Whether it can be cancelled now (POST /sites/{siteId}/staging/actions/cancel): while it's queued, or still preparing.

options

object

What the operation was asked to do.

Show its 4 fields
FieldType and description
parts

string or null

For a refresh: what it copies from the live site: all, files or database. Null otherwise.

Known values: allfilesdatabase More can appear.

scope

string or null

For a push: what it copies to the live site: code (WordPress itself, plugins, themes, must-use plugins and languages), database (the database, and media added on the copy) or everything (both). Null otherwise.

Known values: codedatabaseeverything More can appear.

tables

array of strings or null

For a push of the database: the only tables it copies. Null: all of them.

restoreRunId

string or null

For an undo: the restore point it puts the live site back to (the runId of the push or undo that made it). Null otherwise.

lastError

string or null

Why it failed, or why it waits for our team. Null otherwise.

notes

array of strings

For a finished operation: facts worth knowing (files left out, places that still mention the other address…).

createdAt

string An ISO 8601 time, in UTC

When it was asked for.

startedAt

string or null An ISO 8601 time, in UTC

When it started on the server. Null until then.

finishedAt

string or null An ISO 8601 time, in UTC

When it finished. Null until then.

restorePoints

array of objects

The restore point of the last push or undo: what it replaced on the live site. Only the newest is kept: the next push or undo replaces it, and the one it replaces is listed discarding until it's gone. Newest first.

runId

string

The id of the push (or undo) that made it. Send it to POST /sites/{siteId}/staging/actions/undo-push to put the live site back to it, or delete it with DELETE /sites/{siteId}/staging/restore-points/{runId}.

operation

string

What made it: a push, or an undo (so the undo itself can be undone).

Known values: pushundo More can appear.

scope

string or null

What it holds of the live site, as it was before: code (WordPress itself, plugins, themes, must-use plugins and languages), database (the database, and media added on the copy) or everything (both). Null when not known.

Known values: codedatabaseeverything More can appear.

status

string

available: an undo can use it. using: an undo is using it now. held: kept while our team puts the site right. discarding: being deleted.

Known values: availableusinghelddiscarding More can appear.

createdAt

string An ISO 8601 time, in UTC

When it was made.

expiresAt

string or null An ISO 8601 time, in UTC

When it's deleted by itself (7 days after it was made), unless the next push or undo replaces it first. Null when it's kept for now.

sizeBytes

integer or null

The room it takes on the server's disk. Null when not known.

recentRuns

array of objects

The last 10 finished staging operations, newest first.

id

string

The operation's id.

operation

string

create (make the copy), refresh (copy the live site into it again), push (copy it to the live site) or undo (put the live site back to a restore point).

Known values: createrefreshpushundo More can appear.

status

string

queued: waiting to start (one staging operation runs on a server at a time). running: under way (see stage and progress). completed. failed: see lastError; what it was changing is as it was. cancelled. attention: something went wrong while switching the live site over, and our team is putting it right.

Known values: queuedrunningcompletedfailedcancelledattention More can appear.

phase

string or null

While it runs: prepare (getting everything ready; the live site hasn't been touched and it can be cancelled), apply (switching over, which takes seconds) or recovering (being put right). Null while queued and once it's finished.

Known values: prepareapplyrecovering More can appear.

stage

string or null

What's happening now, in words. Null once it's finished.

progress

integer or null

How far it has got, 0 to 100. Null when that isn't known.

cancellable

boolean

Whether it can be cancelled now (POST /sites/{siteId}/staging/actions/cancel): while it's queued, or still preparing.

options

object

What the operation was asked to do.

Show its 4 fields
FieldType and description
parts

string or null

For a refresh: what it copies from the live site: all, files or database. Null otherwise.

Known values: allfilesdatabase More can appear.

scope

string or null

For a push: what it copies to the live site: code (WordPress itself, plugins, themes, must-use plugins and languages), database (the database, and media added on the copy) or everything (both). Null otherwise.

Known values: codedatabaseeverything More can appear.

tables

array of strings or null

For a push of the database: the only tables it copies. Null: all of them.

restoreRunId

string or null

For an undo: the restore point it puts the live site back to (the runId of the push or undo that made it). Null otherwise.

lastError

string or null

Why it failed, or why it waits for our team. Null otherwise.

notes

array of strings

For a finished operation: facts worth knowing (files left out, places that still mention the other address…).

createdAt

string An ISO 8601 time, in UTC

When it was asked for.

startedAt

string or null An ISO 8601 time, in UTC

When it started on the server. Null until then.

finishedAt

string or null An ISO 8601 time, in UTC

When it finished. Null until then.

blockers

array of strings

Why a staging copy can't be created right now: staging isn't open to the account, the site is still installing, its server is off, an operation is running, or the weekly limit is reached. Empty when one can be, or when the site has a copy.

createsLeftThisWeek

integer

How many more times a copy can be created for this site in the next 7 days (3 a week per site).

Example response

201 Created
{
  "data": {
    "live": {
      "id": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
      "name": "Shop",
      "url": "https://shop.example.com"
    },
    "copy": {
      "id": "5c2e8f1a-7b3d-4e6f-9a0b-1c2d3e4f5a6b",
      "name": "Shop (staging)",
      "status": "installing",
      "url": "https://staging.shop-x7k2p.rabbitflare.link",
      "adminUrl": "https://staging.shop-x7k2p.rabbitflare.link/wp-admin/",
      "hostname": "staging.shop-x7k2p.rabbitflare.link",
      "sslStatus": "none",
      "certificate": "temporary",
      "certificateRetry": false,
      "createdAt": "2026-11-18T10:02:11.000Z",
      "databaseSyncedAt": null,
      "filesSyncedAt": null,
      "settings": {
        "protect": true,
        "username": "staging",
        "holdEmail": true,
        "tasks": false,
        "status": "applied",
        "lastError": null
      }
    },
    "activeRun": {
      "id": "0d4c7b2a-1e3f-4a5b-8c6d-7e8f9a0b1c2d",
      "operation": "create",
      "status": "queued",
      "phase": null,
      "stage": "Publishing the staging address",
      "progress": null,
      "cancellable": true,
      "options": {
        "parts": null,
        "scope": null,
        "tables": null,
        "restoreRunId": null
      },
      "lastError": null,
      "notes": [],
      "createdAt": "2026-11-18T10:02:11.000Z",
      "startedAt": null,
      "finishedAt": null
    },
    "restorePoints": [],
    "recentRuns": [],
    "blockers": [],
    "createsLeftThisWeek": 2
  }
}

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
403 feature_unavailable

This product isn't open to the account.

Contact support if you'd like it opened.

403 · 409 limit_reached

A limit is reached: message says which (servers per account, snapshots per server, domains per site, …).

Delete something first, or contact support to raise the limit.

404 not_found

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_copy

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 invalid_state

The resource's status doesn't allow this now (for example, powering on a server that is running). message says why.

Check the resource's status, then do what message says.

409 server_unavailable

The server isn't in a state that allows this (for example, it's off or still being set up).

Start the server, or wait until it's active, then try again.

409 busy

Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): message says what.

Wait until it finishes, then try again. A change to the server or site itself is done when its pendingAction is null again; for anything else, message says how long to wait.

409 staging_busy

A staging operation is running on this site, or on a site of this server.

Wait until it finishes (activeRun in GET /sites/{siteId}/staging is null again), or cancel it, then try again.

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.

409 not_supported

The server's cloud doesn't offer this (for example, whole-server snapshots on Amazon EC2 and Google Cloud), or the server's kind or size doesn't allow it (Imunify360 on a server of your own, or under 2 GB of memory).

Use what the cloud offers instead: for snapshots, site backups. Imunify360 needs a server Rabbitflare creates, with Intel or AMD processors and 2 GB or more (security.available says why not).

409 server_restoring

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 pendingAction is null again), then try again. A restore that stopped partway keeps pendingAction: "restore", with the server's lastError set, until our team has checked the server.

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.

Rate limit

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

Added on .

Popular

API docs