Restore an Nginx revision
Restores a revision as a new revision: a hook the old revision did not have is cleared. The restore is checked, tested and applied like any save, and answers the same.
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.
The id of a revision of this site, from the list's id. At least 1.
Body
When the change applies, if it needs a one-time update of the site's runtime first. Most changes apply at once whatever is sent. When a change that needs a maintenance window is applied. now applies it at once. tonight queues it for the site's next window. window means the same as tonight. An endpoint that takes window only while maintenance windows are on for your company says so, and refuses it 422 on apply otherwise. Defaults to now.
nowtonightwindowFields
Why, shown in the history. "Restored revision" and its number when left out. Up to 200 characters.
A passed test run of the same content, from a check, so it is not run again. At least 1.
The version from the last read. At least 0.
Returns
200 The revision holds what the site already has. Nothing was started.
201 The restore was saved as a new revision. Follow operation.
Fields of the 200 answer
The id of the queued change.
The change to follow. Null when nothing was started.
On a copy that carried path apps: the records that were not carried (path_app_not_carried).
Present when the change waits for a window.
The new revision. Null when there is none.
The window a queued change waits for. Present only while maintenance windows are on for your company.
The date of the window a queued change waits for.
Fields of the 201 answer
The id of the queued change.
The change to follow. Null when nothing was started.
On a copy that carried path apps: the records that were not carried (path_app_not_carried).
Present when the change waits for a window.
The new revision. Null when there is none.
The window a queued change waits for. Present only while maintenance windows are on for your company.
The date of the window a queued change waits for.
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. |
409 | busy | Another operation is running on the site. Wait for it to finish. |
409 | conflict | The action conflicts with the object's present state. Read the message. |
409 | managed_elsewhere | This site is read-only here. Change it in the control panel that manages it. |
409 | restore_running | A restore is running on the site. Wait for it to finish, then try again. |
409 | stale | What you read has changed since you read it. Read it again, then send the change with its new version or quote. |
422 | feature_off | This feature is not on for your organisation yet. |
422 | invalid | Fix the field named in field; errors says why. |
422 | nginx_invalid | These nginx rules cannot be saved: fix the errors shown. |
422 | nginx_rules_locked | Corefinity has locked this environment's nginx rules. Contact support to change them. |
429 | rate_limited | Wait for the seconds in Retry-After. |
500 | none | Read the message; it says what happened. |
502 | none | Read the message; it says what happened. |
503 | upstream_unavailable | A service the action depends on did not answer. Try again later. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/revisions/1/revert \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"note": "Back to the rules of 28 September",
"version": 2
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/revisions/1/revert', [
'note' => 'Back to the rules of 28 September',
'version' => 2,
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/revisions/1/revert', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
note: 'Back to the rules of 28 September',
version: 2,
}),
});
// 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.post(
"https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/revisions/1/revert",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"note": "Back to the rules of 28 September",
"version": 2,
},
)
data = res.json() if res.content else None{
"operation": null,
"revision": null
}{
"item_id": 77,
"operation": null,
"queued": true,
"revision": null,
"window_date": "2026-11-07"
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "busy",
"message": "Another change to this site is in progress. Wait for it to finish.",
"reason": "busy"
}{
"code": "feature_off",
"message": "Queuing changes for the maintenance window is switched off at the moment",
"reason": "feature_off"
}{
"code": "rate_limited",
"message": "Too many attempts on this environment. Try again shortly.",
"reason": "rate_limited",
"retry_after_seconds": 60
}{
"message": "Server Error"
}{
"message": "The change could not be saved. Contact support."
}{
"code": "upstream_unavailable",
"message": "This environment's configuration repository can't be read right now. Try again in a few minutes.",
"reason": "upstream_unavailable"
}Try it is off for this endpointIt overwrites data that cannot be brought back. Copy the request and run it yourself when you are sure.