Skip to content

Check what a staging operation would do

GET /v1/sites/{siteId}/staging/preview

Asks the server what an operation would do and need, before you start it (it takes a few seconds): the room it needs, what stands in the way (blockers), and for a push of the database what changed on the live site since the copy and which tables it would copy; for a push of the code, what's newer on the live site (downgrades, which the push needs in its allowDowngrade) and what it would remove.

Nothing is changed. Up to 10 previews a minute; not while a staging operation is running (409 staging_busy). When the server couldn't check, the answer is 503 try_again.

While staging is closed to the account (features.staging in GET /account), only an undo's preview works, so a push can always be checked and undone; the others answer 403 feature_unavailable.

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

FieldType and description
siteId Required

string

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

Query parameters

FieldType and description
operation Required

string

The operation to check: create, refresh, push or undo.

One of: createrefreshpushundo

scope

string

For a push: what it would copy, code (WordPress itself, plugins, themes, must-use plugins and languages), database (the database, and media added on the copy) or everything (both). Default code.

One of: codedatabaseeverything

parts

string

For a refresh: what it would copy, all (the default), files or database.

One of: allfilesdatabase

runId

string

For an undo (and needed there): the restore point's runId.

tables

string

For a push of the database: the only tables it would copy, separated by commas.

Example request

curl "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/staging/preview?operation=push&scope=everything" \
  -H "Authorization: Bearer $RABBITFLARE_TOKEN"

Response

200 OK Returns the StagingPreview object in data.

The StagingPreview object's fields 38 fields
FieldType and description
sizes

object

What the operation would copy, and the room it needs.

liveFilesBytes

integer

The live site's files the operation copies, in bytes (0 when it copies none).

liveDatabaseBytes

integer

The live site's database, in bytes.

stagingFilesBytes

integer

The copy's code a push copies, in bytes (0 when it copies none).

stagingDatabaseBytes

integer

The copy's database, in bytes.

freeBytes

integer

Free room on the server's disk, in bytes.

neededBytes

integer

The room the operation needs on the server's disk while it runs, in bytes.

blockers

array of strings

Why the operation would be refused, or fail. Empty when nothing stands in the way.

warnings

array of strings

What's worth knowing before going ahead.

changes

object or null

For a push of the database or an undo: what changed on the live site since then, which the operation would replace. Null otherwise.

since

string or null An ISO 8601 time, in UTC

Since when: the copy's last database copy (for a push), or the push (for an undo). Null when not known.

orders

integer

New orders.

users

integer

New users.

comments

integer

New comments.

formEntries

integer

New form entries.

posts

integer

New posts and pages.

editedPosts

integer

Posts and pages edited.

tables

array of objects

For a push of the database: the copy's tables. Empty otherwise.

name

string

The table's name.

rows

integer

Its rows.

sizeBytes

integer

Its size, in bytes.

onLive

boolean

Whether the live site has a table of this name.

keptOnLive

boolean

Whether the push leaves the live site's own table in place (as it does for the tables that hold the site's own state, unless they're named in tables).

liveOnlyTables

array of strings

For a push of the database: tables only the live site has, which the push leaves in place.

downgrades

array of objects

For a push of the code: what's newer on the live site than on the copy. The push puts these back to the copy's version only when they're named in its allowDowngrade; otherwise it fails, changing nothing.

kind

string

core (WordPress itself), plugin or theme.

Known values: coreplugintheme More can appear.

name

string

Its folder's name (core for WordPress itself): what allowDowngrade takes after plugin: or theme:.

title

string

Its name, as WordPress shows it.

liveVersion

string or null

Its version on the live site. Null when the live site doesn't have it.

stagingVersion

string or null

Its version on the copy. Null when the copy doesn't have it.

removedFromLive

array of objects

For a push of the code: plugins and themes on the live site that the copy doesn't have, which the push removes.

kind

string

core (WordPress itself), plugin or theme.

Known values: coreplugintheme More can appear.

name

string

Its folder's name (core for WordPress itself): what allowDowngrade takes after plugin: or theme:.

title

string

Its name, as WordPress shows it.

liveVersion

string or null

Its version on the live site. Null when the live site doesn't have it.

stagingVersion

string or null

Its version on the copy. Null when the copy doesn't have it.

overdueTasks

integer

For a push of the database: scheduled tasks on the copy that are already due (they'd run on the live site after the push, unless cancelOverdue).

paymentsScheduled

boolean

For a push of the database: whether the copy's store has subscription renewals or other payments scheduled, which need care before replacing the live site's database.

Example response

200 OK
{
  "data": {
    "sizes": {
      "liveFilesBytes": 0,
      "liveDatabaseBytes": 48211456,
      "stagingFilesBytes": 0,
      "stagingDatabaseBytes": 51380224,
      "freeBytes": 41871163392,
      "neededBytes": 113036492
    },
    "blockers": [],
    "warnings": [
      "The live site has new orders or users since the copy; pushing the database replaces them"
    ],
    "changes": {
      "since": "2026-11-18T10:05:47.000Z",
      "orders": 3,
      "users": 1,
      "comments": 0,
      "formEntries": 2,
      "posts": 0,
      "editedPosts": 1
    },
    "tables": [
      {
        "name": "wp_options",
        "rows": 412,
        "sizeBytes": 1212416,
        "onLive": true,
        "keptOnLive": false
      },
      {
        "name": "wp_posts",
        "rows": 1874,
        "sizeBytes": 9453568,
        "onLive": true,
        "keptOnLive": false
      },
      {
        "name": "wp_users",
        "rows": 12,
        "sizeBytes": 16384,
        "onLive": true,
        "keptOnLive": false
      }
    ],
    "liveOnlyTables": [
      "wp_shop_audit_log"
    ],
    "downgrades": [
      {
        "kind": "plugin",
        "name": "woocommerce",
        "title": "WooCommerce",
        "liveVersion": "9.4.2",
        "stagingVersion": "9.4.1"
      }
    ],
    "removedFromLive": [],
    "overdueTasks": 0,
    "paymentsScheduled": false
  }
}

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 invalid_parameter

A query parameter is unknown or has a wrong value (fields names it), or the query is too long: over 16,384 characters, or a parameter's name over 64.

Correct or remove the parameter named in fields.

403 feature_unavailable

This product isn't open to the account.

Contact support if you'd like it opened.

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 no_staging

The site has no staging copy.

Create one first: POST /v1/sites/{siteId}/staging.

409 staging_unavailable

The staging copy can't be used for this now: it's still being created, or it's being removed.

Check copy.status in GET /v1/sites/{siteId}/staging, and try again once it's active.

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 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 staging_refused

The site's server found something that stops this staging operation. message says what.

Deal with what message names, then check again.

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.

502 server_unreachable

The server didn't answer, or didn't finish the request.

Check that the server is running, then try again in a minute.

503 try_again

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

Try again in a minute.

Rate limit

Heavy requests: 20 a minute per token, 40 per account. More in Rate limits.

Added on .

Popular

API docs