CorefinityCorefinityDocs
Open the Control PanelControl Panel
Web server rules · 16 of 19

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.

POST/api/corestack/sites/{site}/nginx-rules/revisions/{revision}/revert

Path parameters

siteintegerRequired

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.

revisionintegerRequired

The id of a revision of this site, from the list's id. At least 1.

Body

applystring

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.

nowtonightwindow
Fields
notestring or null

Why, shown in the history. "Restored revision" and its number when left out. Up to 200 characters.

test_idinteger

A passed test run of the same content, from a check, so it is not run again. At least 1.

versionintegerRequired

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
item_idinteger or null

The id of the queued change.

operationobject or any or nullRequired

The change to follow. Null when nothing was started.

path_app_warningsarray of objects

On a copy that carried path apps: the records that were not carried (path_app_not_carried).

queuedboolean

Present when the change waits for a window.

revisionobject or any or nullRequired

The new revision. Null when there is none.

windowobject or any or null

The window a queued change waits for. Present only while maintenance windows are on for your company.

window_datestring or null

The date of the window a queued change waits for.

Fields of the 201 answer
item_idinteger or null

The id of the queued change.

operationobject or any or nullRequired

The change to follow. Null when nothing was started.

path_app_warningsarray of objects

On a copy that carried path apps: the records that were not carried (path_app_not_carried).

queuedboolean

Present when the change waits for a window.

revisionobject or any or nullRequired

The new revision. Null when there is none.

windowobject or any or null

The window a queued change waits for. Present only while maintenance windows are on for your company.

window_datestring or null

The date of the window a queued change waits for.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
409busyAnother operation is running on the site. Wait for it to finish.
409conflictThe action conflicts with the object's present state. Read the message.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
409restore_runningA restore is running on the site. Wait for it to finish, then try again.
409staleWhat you read has changed since you read it. Read it again, then send the change with its new version or quote.
422feature_offThis feature is not on for your organisation yet.
422invalidFix the field named in field; errors says why.
422nginx_invalidThese nginx rules cannot be saved: fix the errors shown.
422nginx_rules_lockedCorefinity has locked this environment's nginx rules. Contact support to change them.
429rate_limitedWait for the seconds in Retry-After.
500noneRead the message; it says what happened.
502noneRead the message; it says what happened.
503upstream_unavailableA 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
  }'
{
  "operation": null,
  "revision": null
}
Try it

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.

Was this helpful?
Open in ClaudeOpen in ChatGPT