---
title: "Update a firewall entry"
url: https://docs.corefinity.com/api/reference/firewall/update-firewall-entry
type: endpoint
last_updated: 2026-11-13
feature: firewall
related:
  - https://docs.corefinity.com/guides/sites/access-and-security/firewall.md
  - https://docs.corefinity.com/mcp/tools/corestack_firewall_entry_update.md
---
# Update a firewall entry

Changes an entry's comment, expiry or scope. Send at least one of them. The address itself cannot be changed:
remove the entry and add another.

```http
PATCH /api/firewall/entries/{entry}
```

- Scope: `write`
- Two-factor: required on your account (all)
- Rate limit: 120 a minute; 30 a minute for each person; 120 a minute for each company
- Long-running: answers with an operation to poll
- Try it in the console: off. It has not been cleared for the console. Copy the request and run it yourself when you are sure.

## Path parameters

- `entry` (integer, required): The id of a firewall entry, as the lists answer it in `id`. Digits only.

## Body

- `comment` (string or null): The new comment. Null removes it.
- `expires_in_days` (integer or null): Counted from now. Null removes the expiry. After how many days the address stops being allowed. Null, or left out, for no expiry. One of `1`, `30`, `90`, `365`, `null`.
- `scope` (string): What the address may reach. `ssh` is SSH only, `web` the website only, `both` both. One of `both`, `ssh`, `web`.

## Request

### curl

```bash
curl -X PATCH https://manage.corefinity.com/api/firewall/entries/9001 \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "comment": "Head office"
  }'
```

### PHP

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

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->patch('https://manage.corefinity.com/api/firewall/entries/9001', [
        'comment' => 'Head office',
    ]);

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

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/firewall/entries/9001', {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    comment: 'Head office',
  }),
});

// 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.patch(
    "https://manage.corefinity.com/api/firewall/entries/9001",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "comment": "Head office",
    },
)

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

## Responses

### 200 The entry as it is now. `change_id` is null when nothing needs applying, as after a new comment.

```json
{
  "change_id": 5311,
  "covered_by": null,
  "entry": {
    "added_by": {
      "name": "Eleanor Finch",
      "on_behalf_of": null,
      "support": false
    },
    "carried_from": null,
    "changed_at": "2026-11-06T09:16:40Z",
    "cidr": "203.0.113.7/32",
    "comment": "Office",
    "created_at": "2026-11-01T10:02:44Z",
    "decision_reason": null,
    "editable": true,
    "expires_at": null,
    "family": 4,
    "id": 9001,
    "layer": "company",
    "owner": {
      "id": 1204,
      "name": "Harbour & Finch",
      "type": "company"
    },
    "path": null,
    "request_reason": null,
    "scope": {
      "ssh": true,
      "web": false
    },
    "source": "manual",
    "status": "active",
    "web_paused": false
  }
}
```

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

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

### 403 The token lacks the `write` scope (`scope_required`), your company requires two-factor authentication and you have not set it up (`two_factor_required`), or you can see the entry or preset but may not change it, as with one your agency holds (`firewall_not_editable`).

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

### 404 The id does not exist or is something you cannot reach (`not_found`; both answer the same body), or the firewall is not on for it (`feature_off`).

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

### 409 The entry is not in a state that allows this, such as one that is being removed (`firewall_state_conflict`). Read it again.

```json
{
  "code": "firewall_state_conflict",
  "field": null,
  "message": "This entry has changed. Reload and try again.",
  "reason": "firewall_state_conflict"
}
```

### 422 The request was refused. `reason` says why: `invalid_arguments` (a field is wrong or not part of the request, or nothing was sent to change; `field` names it), `firewall_scope_invalid` (the scope cannot apply to this address here) or `firewall_cap_exceeded` (a wider scope, or a new expiry for an entry that had expired, would take an environment it reaches over its limit of addresses).

```json
{
  "code": "firewall_scope_invalid",
  "field": "scope",
  "message": "That scope cannot apply to this address here.",
  "reason": "firewall_scope_invalid"
}
```

### 429 Too many requests: the endpoint's request limit (`rate_limited`, with `Retry-After`), or the firewall's own budget of 30 changes a minute for you and 120 for your company, which the Control Panel and AI assistants spend too (`firewall_throttled`). The budget's answer names no wait: try again after a minute.

```json
{
  "code": "firewall_throttled",
  "field": null,
  "message": "Too many firewall changes. Wait a minute and try again.",
  "reason": "firewall_throttled"
}
```

## 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 | `firewall_not_editable` | You can see this entry but you cannot change it. |
| 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. |
| 404 | `not_found` | Not found. |
| 409 | `firewall_state_conflict` | This entry has changed. Reload and try again. |
| 422 | `firewall_scope_invalid` | That scope cannot apply to this address here. |
| 422 | `invalid_arguments` | The arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again. |
| 429 | `firewall_throttled` | Too many firewall changes. Wait a minute and try again. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Firewall](https://docs.corefinity.com/guides/sites/access-and-security/firewall.md)
- MCP tool: [`corestack_firewall_entry_update`](https://docs.corefinity.com/mcp/tools/corestack_firewall_entry_update.md)
