---
title: "Answer a change made outside"
url: https://docs.corefinity.com/api/reference/site-settings/resolve-site-nginx-drift
type: endpoint
last_updated: 2026-11-13
feature: nginx-rules
related:
  - https://docs.corefinity.com/guides/sites/site-settings/web-server-rules.md
  - https://docs.corefinity.com/mcp/tools/corestack_nginx_rules_drift_resolve.md
---
# Answer a change made outside

Answers a change to the site's Nginx rules that was made outside the Control Panel (`drift` in the read). `committed` takes the changed rules as your saved rules, as a new revision that is then checked like any change. `panel` keeps your saved rules: nothing is written, and your next save writes them again.

```http
POST /api/corestack/sites/{site}/nginx-rules/drift
```

- Scope: `write`
- Two-factor: required on your account (all)
- Rate limit: 60 a minute; 20 a minute for each environment
- Try it in the console: off. It overwrites data that cannot be brought back. Copy the request and run it yourself when you are sure.

## Path parameters

- `site` (integer, required): The id of a site row. A website's production site and each of its environments has its own id. Digits only.

## Body

- `action` (string, required): `committed` takes the changed rules as your saved rules; `panel` keeps your saved rules. One of `committed`, `panel`.
- `version` (integer, required): The `version` from the last read.

## Request

### curl

```bash
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/drift \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "panel",
    "version": 3
  }'
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->post('https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/drift', [
        'action' => 'panel',
        'version' => 3,
    ]);

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/drift', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    action: 'panel',
    version: 3,
  }),
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.post(
    "https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/drift",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "action": "panel",
        "version": 3,
    },
)

data = res.json() if res.content else None
```

## Responses

### 200 `panel`: your saved rules stay as they are.

```json
{
  "operation": null,
  "revision": null
}
```

### 201 `committed`: the changed rules are a new revision, `pending_verify` until they have been checked.

```json
{
  "operation": null,
  "revision": {
    "id": 320,
    "number": 2,
    "status": "pending_verify"
  }
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the scope (`scope_required`, with the `scope` to use), or your company requires two-factor authentication and you have not set it up. For routes outside Managed Clusters.

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 404 The id does not exist or is something you cannot see, or the feature is not on for your company (`feature_off`).

```json
{
  "code": "feature_off",
  "message": "Not found.",
  "reason": "feature_off"
}
```

### 409 The request was refused because of the site's state. `reason` says why: `stale` (the rules changed since your read: read them again and send the new `version`), `busy` or `change_pending` (another change is running or waiting), `inventory_behind` (the rules changed again after your read), or `managed_elsewhere`.

```json
{
  "code": "busy",
  "message": "Another change to this site is in progress. Wait for it to finish.",
  "reason": "busy"
}
```

### 422 A field is missing or wrong (`invalid`), there is no change made outside the Control Panel to answer (`no_drift`), the changed rules break the policy (`nginx_invalid`, with `diagnostics`) or lack a file (`files_missing`), or Corefinity has locked the site's Nginx rules (`nginx_rules_locked`).

```json
{
  "code": "invalid",
  "errors": {
    "action": [
      "action is committed or panel."
    ]
  },
  "field": "action",
  "message": "action is committed or panel.",
  "reason": "invalid"
}
```

### 429 Too many requests (`rate_limited`): the API's general limit, or the 20 saves a minute this environment takes from the API, the Control Panel and AI assistants together. Wait for `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many attempts on this environment. Try again shortly.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

### 503 The site's configuration cannot be read at the moment (`upstream_unavailable`). Try again in a few minutes.

```json
{
  "code": "upstream_unavailable",
  "message": "This environment's configuration repository can't be read right now. Try again in a few minutes.",
  "reason": "upstream_unavailable"
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | 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 | `inventory_behind` | The files changed again after they were read. Read them again, then choose again. |
| 409 | `managed_elsewhere` | This site is read-only here. Change it in the control panel that manages it. |
| 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 | `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 | `no_drift` | The files are the ones the Control Panel last committed: there is no change made outside it to answer. Nothing to do. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |
| 503 | `upstream_unavailable` | A service the action depends on did not answer. Try again later. |

## The same task elsewhere

- Guide: [Web server rules](https://docs.corefinity.com/guides/sites/site-settings/web-server-rules.md)
- MCP tool: [`corestack_nginx_rules_drift_resolve`](https://docs.corefinity.com/mcp/tools/corestack_nginx_rules_drift_resolve.md)
