Update a site's backup-file rule
Switches the rule on or off. The change applies at once, so it cannot be scheduled: follow the operation in the answer. Sending the state the site already has answers 200 with operation: null.
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.
Body
Only now, the default. The change always applies at once.
nowTrue to block backup files, false to stop.
Returns
200 The site already has that state. Nothing was started and operation is null.
201 The change was saved and started. Follow operation.
Fields of the 200 answer
Corefinity's backup-file rule on one site.
Fields
Whether the site carries the rule now.
File endings that often hold backups and that the rule does not block.
Whether the rule is offered for the site. False while it is not, and switching it on is refused.
Whether the rule is wanted. On unless somebody switched it off.
The file endings the rule blocks.
The rule as Nginx reads it, for display.
Whether a change to the rule is still running.
True when the site's platform always blocks these files itself, so the rule cannot be switched off.
When the rule was switched off. Null while it is on. Format: date-time.
True when the last change was saved but not confirmed, so whether the site carries the rule is not known. It is applied again within a few minutes.
The change to follow. Null when nothing was started.
Fields of the 201 answer
Corefinity's backup-file rule on one site.
Fields
Whether the site carries the rule now.
File endings that often hold backups and that the rule does not block.
Whether the rule is offered for the site. False while it is not, and switching it on is refused.
Whether the rule is wanted. On unless somebody switched it off.
The file endings the rule blocks.
The rule as Nginx reads it, for display.
Whether a change to the rule is still running.
True when the site's platform always blocks these files itself, so the rule cannot be switched off.
When the rule was switched off. Null while it is on. Format: date-time.
True when the last change was saved but not confirmed, so whether the site carries the rule is not known. It is applied again within a few minutes.
The change to follow. Null when nothing was started.
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 | files_missing | The files the Control Panel manages for this are missing or not ready yet. Read the message: try again in a few minutes, keep the Control Panel's version, or contact support. |
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 | wrong_platform | This is not available for the site's platform. Use it on a site of the platform it is for. |
422 | apply_not_supported | This change applies at once, so it cannot be scheduled. |
422 | invalid | Fix the field named in field; errors says why. |
422 | nginx_rules_locked | Corefinity has locked this environment's nginx rules. Contact support to change them. |
422 | not_available | The tool does not apply to this object. |
429 | rate_limited | Wait for the seconds in Retry-After. |
502 | none | Read the message; it says what happened. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/backup-guard \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"enabled": false
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->put('https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/backup-guard', [
'enabled' => false,
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/backup-guard', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
enabled: false,
}),
});
// 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.put(
"https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/backup-guard",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"enabled": False,
},
)
data = res.json() if res.content else None{
"backup_guard": {
"applied": true,
"attention_extensions": [
"zip",
"tar.gz",
"tgz"
],
"available": true,
"enabled": true,
"extensions": [
"sql",
"sql.gz"
],
"lines": [
"set $cf_backup_guard_body \"\";",
"if ($uri ~* \"\\.(?:sql|sql\\.gz)$\") { return 404 $cf_backup_guard_body; }"
],
"pending": false,
"platform_enforced": false,
"switched_off_at": null,
"uncertain": false
},
"operation": null
}{
"backup_guard": {
"applied": true,
"attention_extensions": [
"zip",
"tar.gz",
"tgz"
],
"available": true,
"enabled": false,
"extensions": [
"sql",
"sql.gz"
],
"lines": [
"set $cf_backup_guard_body \"\";",
"if ($uri ~* \"\\.(?:sql|sql\\.gz)$\") { return 404 $cf_backup_guard_body; }"
],
"pending": true,
"platform_enforced": false,
"switched_off_at": "2026-11-06T09:16:40Z",
"uncertain": false
},
"operation": {
"applied_at": null,
"can_retry": false,
"cluster": {
"id": 1017,
"name": "Northwind UK 1"
},
"committed_at": "2026-11-06T09:16:40Z",
"completed_at": null,
"created_at": "2026-11-06T09:16:40Z",
"environment": {
"env_id": "rs-harbourandfinch-example-com",
"hostname": "harbourandfinch-example-com.northwind.cfstack.example.net",
"id": 1042,
"name": "Production",
"role": "production",
"role_label": "Production",
"slug": "production"
},
"error": null,
"failure_reason": null,
"from_version": null,
"hot": true,
"id": 5120,
"install": null,
"label": "Picked up by the platform",
"notes": [],
"parent_operation_id": null,
"requested_by": {
"id": 2041,
"name": "Eleanor Finch"
},
"reset_target": null,
"result": null,
"result_state": "none",
"retried_by_operation_id": null,
"retries_operation_id": null,
"retry_requires": null,
"revealed": null,
"scope": "site",
"site": {
"domain": "harbourandfinch.example.com",
"id": 1042
},
"status": "committed",
"status_label": "Waiting for the platform",
"step": "applied",
"steps": [
{
"key": "saved",
"label": "Saved",
"state": "done"
},
{
"key": "applied",
"label": "Picked up by the platform",
"state": "current"
},
{
"key": "live",
"label": "Live",
"state": "todo"
}
],
"subject": null,
"summary": "Backup file blocking",
"to_version": null,
"type": "nginx_backup_guard_change",
"type_label": "Backup file blocking"
}
}{
"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": "apply_not_supported",
"field": "apply",
"message": "This change applies at once, so it cannot be scheduled.",
"reason": "apply_not_supported"
}{
"code": "rate_limited",
"message": "Too many attempts on this environment. Try again shortly.",
"reason": "rate_limited",
"retry_after_seconds": 60
}{
"message": "The platform returned an error (HTTP 503). Try again shortly."
}Try it is off for this endpointIt has not been cleared for the console. Copy the request and run it yourself when you are sure.