Preview a copy onto an environment
Checks a copy of {site} onto another environment: what would move, what blocks it now (blockers), what it would wait for (waits), and the preview_token that cloneSite must quote within 15 minutes. Ask with the same target, scope and snapshot you will send; you need to be able to change both environments.
Path parameters
The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.
Query parameters
environment (with target_id) or production, which copies onto the website's production.
environmentproductionFor environment, the site row id of the environment to copy onto. At least 1.
What to copy. Files and database when left out.
files_dbdbfilesCopy from this snapshot of the source instead of the live environment. At least 1.
Ask about an anonymised copy (Shopware only). true or false; 1 and 0 are taken too, and anything else is refused invalid.
Returns
200 The preview. can_proceed says whether a copy sent now would be taken.
Fields of the 200 answer
Present for a Shopware source only. Whether an anonymised copy can be made, and why not.
Fields
What stops the copy now. Each has a reason and a message.
Fields of each item
Whether a copy sent now would be taken, started or queued.
For Magento 2, whether both environments use the same encryption key. Null when not established.
How long the data is expected to take to copy. Null when the size is not known.
How long the target is expected to be switched over for.
What the switch-over involves. Null when no target was named.
When the token stops being accepted. Format: date-time.
What is adjusted on the target after the copy, in plain words.
Quote this in cloneSite within 15 minutes.
Whether a copy sent now would wait its turn (202) instead of starting.
Whether a safety copy of the target can be kept first.
What a copy takes: files and database, the database only, or files only.
files_dbdbfilesWhat would be copied, as last measured. Every figure is null until the environment has been measured.
Fields
What was measured, such as volume for the space used on the environment's disk.
When the figures were measured. Format: date-time.
One environment of a website, addressed by its site row.
Fields
The environment's platform identifier.
The environment's own address on the platform.
The site row id, the {site} every /corestack/sites/{site} endpoint takes.
The environment's role, such as production or staging.
The application, such as wordpress or magento2.
The environment's size.
The steps the copy goes through, in order.
Fields of each item
A stable key for the line.
The line in plain words.
The environment the copy goes onto. Null when no target was named.
The target's disk. Null when no target was named.
When the target is too small for the data and a larger size fixes it, that size, what it adds each month and whether it is bought automatically. Null otherwise.
What a copy sent now would wait for before it starts by itself.
Fields of each item
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | scope_required | Use a token with the scope named in scope. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | feature_off | This feature is not on for your organisation yet. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait for the seconds in Retry-After. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl https://manage.corefinity.com/api/corestack/sites/1042/clone/preview \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json"use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->get('https://manage.corefinity.com/api/corestack/sites/1042/clone/preview');
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/clone/preview', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
},
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.get(
"https://manage.corefinity.com/api/corestack/sites/1042/clone/preview",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
)
data = res.json() if res.content else None{
"blockers": [],
"can_proceed": true,
"crypt_match": null,
"estimated_seconds": null,
"estimated_switch_seconds": 30,
"expected_switch": {
"compute": {
"from": null,
"to": null
},
"crosses_tier": false,
"note": null,
"storage": {
"from": null,
"to": null
}
},
"expires_at": "2026-11-03T07:15:00Z",
"fixups": [
"URLs rewritten to harbourandfinch-example-com-staging.northwind.cfstack.example.net",
"Crons switched off",
"Outbound mail captured by Mailpit",
"Search engines blocked (noindex)",
"WordPress admin password reset (shown once)"
],
"preview_token": "cp_Xq7mR2vK9sLp4TzW8nBd",
"queues": false,
"safety_snapshot": true,
"scope": "files_db",
"sizes": {
"basis": null,
"copied_bytes": null,
"db_bytes": null,
"files_bytes": null,
"measured_at": null,
"scratch_bytes": null,
"used_bytes": null
},
"source": {
"env_id": "rs-northwind-harbourandfinch-example-com",
"hostname": "harbourandfinch-example-com.northwind.cfstack.example.net",
"id": 1042,
"name": "Production",
"platform": "wordpress",
"role": "production",
"role_label": "Production",
"slug": "production",
"tier": "S"
},
"steps": [
{
"key": "snapshot",
"label": "Snapshots taken"
},
{
"key": "bound",
"label": "Prepared on the cluster"
},
{
"key": "holding",
"label": "Disk slot held"
},
{
"key": "stopped",
"label": "Target stopped"
},
{
"key": "copied",
"label": "Data copied"
},
{
"key": "started",
"label": "Target started"
},
{
"key": "fixups",
"label": "Target adjusted"
},
{
"key": "cleanup",
"label": "Tidied up"
}
],
"target": {
"env_id": "rs-northwind-harbourandfinch-example-com--staging",
"hostname": "harbourandfinch-example-com-staging.northwind.cfstack.example.net",
"id": 1043,
"name": "Staging",
"role": "staging",
"role_label": "Staging",
"slug": "staging",
"tier": "S"
},
"target_disk": {
"free_bytes": null,
"size_bytes": 10737418240,
"used_bytes": null
},
"target_growth": null,
"waits": []
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "invalid",
"errors": {
"anonymise": [
"Anonymise is true or false"
]
},
"field": "anonymise",
"message": "Anonymise is true or false",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}