# Replace site

URL: https://docs.hanzo.ai/docs/openapi/patrol/put-patrol-site-by-name

> Changes a site's contract and brief fields.

`PUT /v1/patrol/site/{name}`

> [Patrol →](https://docs.hanzo.ai/docs/openapi/patrol) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                              |
| ------------- | -------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/patrol/site/{name}` |
| **Method**    | `PUT`                                        |
| **Operation** | `put_patrol_site_by_name`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`       |

Changes a site's contract and brief fields. It leaves absent fields
as they stand, and it never moves the account number, the coordinates or the
customer — those are register facts, changed through the framework surface.

## Request

11 fields, body `application/json` (required).

| Field      | In   | Type            | Required | Description                                      |
| ---------- | ---- | --------------- | -------- | ------------------------------------------------ |
| `name`     | path | string          | yes      | Name is the site's document name, from the path. |
| `category` | body | string          | —        | Category is what kind of premises this is.       |
| `contact`  | body | string          | —        | Contact is the keyholder to reach.               |
| `eircode`  | body | string          | —        | Eircode is the postal code.                      |
| `name`     | body | string          | —        | Name is the site's document name, from the path. |
| `notes`    | body | string          | —        | Notes is the standing brief for the site.        |
| `sector`   | body | string          | —        | Sector is the patrol sector the site sits in.    |
| `sla`      | body | integer (int64) | —        | SLA is the contracted response time in minutes.  |
| `status`   | body | string          | —        | Status is ok, fault, alarm or offline.           |
| `tier`     | body | string          | —        | Tier is the contracted service tier.             |
| `town`     | body | string          | —        | Town is the town the site is in.                 |

## Response

| Status    | Body                 | Meaning |
| --------- | -------------------- | ------- |
| `200`     | patrol.patrolSiteOut | ok      |
| `default` | problem-details      | refused |

`200` body — 27 fields.

| Field                   | In   | Type                 | Always | Description                                                                              |
| ----------------------- | ---- | -------------------- | ------ | ---------------------------------------------------------------------------------------- |
| `data`                  | body | patrol.patrolSite    | —      |                                                                                          |
| `data.account`          | body | string               | —      | Account is the alarm-panel account number the receiving centre reports.                  |
| `data.cameras`          | body | integer (int64)      | —      | Cameras is how many cameras are registered here.                                         |
| `data.category`         | body | string               | —      | Category is what kind of premises this is.                                               |
| `data.client`           | body | string               | —      | Client is the customer this site belongs to.                                             |
| `data.contact`          | body | string               | —      | Contact is the keyholder to reach.                                                       |
| `data.eircode`          | body | string               | —      | Eircode is the postal code.                                                              |
| `data.hazards`          | body | string\[]            | —      | Hazards is the standing warnings, present on a single-site read.                         |
| `data.keys`             | body | boolean              | —      | Keys says whether the operation holds a key set for this site.                           |
| `data.lat`              | body | number (double)      | —      | Lat is the site's latitude in degrees.                                                   |
| `data.lon`              | body | number (double)      | —      | Lon is the site's longitude in degrees.                                                  |
| `data.name`             | body | string               | —      | Name is the site's document name and the segment /v1/patrol/site/{name} addresses it by. |
| `data.notes`            | body | string               | —      | Notes is the standing brief for the site.                                                |
| `data.ref`              | body | integer (int64)      | —      | Ref is the site's number in the register.                                                |
| `data.risk`             | body | integer (int64)      | —      | Risk is the assessed risk score.                                                         |
| `data.sector`           | body | string               | —      | Sector is the patrol sector the site sits in.                                            |
| `data.sla`              | body | integer (int64)      | —      | SLA is the contracted response time in minutes.                                          |
| `data.status`           | body | string               | —      | Status is ok, fault, alarm or offline.                                                   |
| `data.tier`             | body | string               | —      | Tier is the contracted service tier.                                                     |
| `data.town`             | body | string               | —      | Town is the town the site is in.                                                         |
| `data.unit`             | body | string               | —      | Unit is the call sign of the unit that covers the site, or empty.                        |
| `data.visits`           | body | integer (int64)      | —      | Visits is how many patrol visits the contract calls for.                                 |
| `data.zones`            | body | patrol.patrolZone\[] | —      | Zones is the panel's detection zones, present on a single-site read.                     |
| `data.zones[].device`   | body | string               | —      | Device is the detector type.                                                             |
| `data.zones[].location` | body | string               | —      | Location is where in the building the zone is.                                           |
| `data.zones[].ref`      | body | string               | —      | Ref is the zone number the panel reports.                                                |
| `data.zones[].state`    | body | string               | —      | State is the zone's last known condition.                                                |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo patrol site set <name>
```

**SDK**

**.ts**

```ts
import { Configuration, PatrolApi } from 'hanzoai';

const api = new PatrolApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.putPatrolSiteByName({ name: 'name', category: "<category>", contact: "<contact>" });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import PatrolApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = PatrolApi(client).put_patrol_site_by_name(name='name', category="<category>", contact="<contact>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.PatrolAPI.PutPatrolSiteByName(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, patrol_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = patrol_api::put_patrol_site_by_name(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.PatrolApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new PatrolApi(client).putPatrolSiteByName();
```

**HTTP**

```bash
curl -X PUT https://api.hanzo.ai/v1/patrol/site/<name> \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "category": "<category>",
       "contact": "<contact>"
     }'
```

**MCP**

MCP reaches **patrol** through the `patrol` tool, which names its 26 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "get_patrol_camera"
         }
       }
     }'
```

---

[Patrol API](https://docs.hanzo.ai/docs/openapi/patrol) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
