# Patrol

URL: https://docs.hanzo.ai/docs/openapi/patrol

> Stands watch over an estate: sites, units, tours, keys, cameras, and the incidents that interrupt them.

Also for this capability: **API** · [CLI](https://docs.hanzo.ai/docs/cli/patrol) · [MCP](https://docs.hanzo.ai/docs/mcp-tools/patrol) · [SDKs](https://docs.hanzo.ai/docs/sdks)

Stands watch over an estate: sites, units, tours, keys, cameras, and the incidents that interrupt them.

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

|                |                                        |
| -------------- | -------------------------------------- |
| **Base URL**   | `https://api.hanzo.ai`                 |
| **Operations** | 29                                     |
| **Auth**       | `Authorization: Bearer $HANZO_API_KEY` |

## Specification

Specification pending — no HIP in [hanzoai/hips](https://github.com/hanzoai/hips) declares `capability: patrol` yet. What this capability serves is below, from the API document; what it is — the store it owns, how it meters, what it publishes — is written as a HIP under HIP-0139.

## Four surfaces

| Surface  | Reaches this capability as                     | Coverage                                                                    |
| -------- | ---------------------------------------------- | --------------------------------------------------------------------------- |
| **REST** | `patrol` at its own prefix                     | 29 operations                                                               |
| **CLI**  | `hanzo patrol …`                               | 29 of 29                                                                    |
| **SDK**  | `PatrolApi` in every published client          | 29 methods                                                                  |
| **MCP**  | tool `patrol` on `https://api.hanzo.ai/v1/mcp` | 26 operations, 15 under the document's own id — ask `describe` for the rest |

## Quickstart

```bash
export HANZO_API_KEY=sk-...   # console.hanzo.ai → API keys
```

Then the first call — a read that needs nothing but the key. `GET /v1/patrol/key`, operation `get_patrol_key`:

**CLI**

```bash
hanzo patrol key list
```

**SDK**

**.ts**

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

const api = new PatrolApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getPatrolKey();
```

**.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).get_patrol_key()
```

**.go**

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

resp, _, err := client.PatrolAPI.GetPatrolKey(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::get_patrol_key(&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).getPatrolKey();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/patrol/key \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

Tool `patrol`, op `get_patrol_key` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

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

Answers `200` with `object` — ok.

## Endpoints

| Endpoint                                                                                                                               | What it does                                                                                                                                                                                                         |
| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`POST /v1/patrol/alarm`](https://docs.hanzo.ai/docs/openapi/patrol/post-patrol-alarm)                                                 | Takes one activation.                                                                                                                                                                                                |
| [`GET /v1/patrol/camera/{name}/stream/{ticket}`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-camera-by-name-stream-by-ticket) | Redeems a minted ticket for what opens the camera.                                                                                                                                                                   |
| [`GET /v1/patrol/camera/{name}/stream`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-camera-by-name-stream)                    | Mints a short-lived way in to one camera.                                                                                                                                                                            |
| [`GET /v1/patrol/camera`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-camera)                                                 | Lists the cameras a caller may OPEN.                                                                                                                                                                                 |
| [`GET /v1/patrol/event`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-event)                                                   | Lists the feed, newest first.                                                                                                                                                                                        |
| [`POST /v1/patrol/event`](https://docs.hanzo.ai/docs/openapi/patrol/post-patrol-event)                                                 | Writes one feed row by hand and pushes it to every screen watching.                                                                                                                                                  |
| [`GET /v1/patrol/feed`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-feed)                                                     | Watch the live feed                                                                                                                                                                                                  |
| [`POST /v1/patrol/incident/{name}/step`](https://docs.hanzo.ai/docs/openapi/patrol/post-patrol-incident-by-name-step)                  | Performs one act on an incident: it stamps the act's time, moves the state, appends the act to the trail, and runs what the act sets in motion — a unit assigned, a site secured, a report filed, a controller told. |
| [`GET /v1/patrol/incident/{name}`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-incident-by-name)                              | Returns one response whole: the incident, every act performed on it, and the SLA clocks those acts settled.                                                                                                          |
| [`GET /v1/patrol/incident`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-incident)                                             | Lists responses.                                                                                                                                                                                                     |
| [`POST /v1/patrol/incident`](https://docs.hanzo.ai/docs/openapi/patrol/post-patrol-incident)                                           | Records a response by hand, in state received and carrying the site's tier and SLA.                                                                                                                                  |
| [`POST /v1/patrol/key/{name}/move`](https://docs.hanzo.ai/docs/openapi/patrol/post-patrol-key-by-name-move)                            | Records a key set leaving, returning, or being counted, and moves the register row to match.                                                                                                                         |
| [`GET /v1/patrol/key/{name}`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-key-by-name)                                        | Returns one key set from the register.                                                                                                                                                                               |
| [`GET /v1/patrol/key`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-key)                                                       | Lists the key register.                                                                                                                                                                                              |
| [`GET /v1/patrol/note`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-note)                                                     | Lists internal remarks.                                                                                                                                                                                              |
| [`POST /v1/patrol/note`](https://docs.hanzo.ai/docs/openapi/patrol/post-patrol-note)                                                   | Records an internal remark, stamped with who wrote it.                                                                                                                                                               |
| [`POST /v1/patrol/point/{name}/confirm`](https://docs.hanzo.ai/docs/openapi/patrol/post-patrol-point-by-name-confirm)                  | Records presence at a checkpoint: who confirmed it, the method, where they stood, and the photo key if one was taken.                                                                                                |
| [`GET /v1/patrol/report/{name}`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-report-by-name)                                  | Download a filed report                                                                                                                                                                                              |
| [`POST /v1/patrol/report`](https://docs.hanzo.ai/docs/openapi/patrol/post-patrol-report)                                               | Composes and files a report from one estate read, so the same figures read the same a month later.                                                                                                                   |
| [`GET /v1/patrol/site/{name}`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-site-by-name)                                      | Returns one site whole: the register row plus the panel's zones and the standing hazards, which ride inside the document.                                                                                            |
| [`PUT /v1/patrol/site/{name}`](https://docs.hanzo.ai/docs/openapi/patrol/put-patrol-site-by-name)                                      | Changes a site's contract and brief fields.                                                                                                                                                                          |
| [`GET /v1/patrol/site`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-site)                                                     | Lists the estate.                                                                                                                                                                                                    |
| [`GET /v1/patrol/snapshot`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-snapshot)                                             | Returns the whole picture in one read: sites, units with their position trails, today's tours and checkpoints, the key register, the recent feed and the open incident.                                              |
| [`GET /v1/patrol/tenant/{org}`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-tenant-by-org)                                    | Returns one org's public face — brand, company, operations, features and terminology.                                                                                                                                |
| [`GET /v1/patrol/tour`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-tour)                                                     | Lists patrol rounds with their checkpoints — the proof-of-presence record.                                                                                                                                           |
| [`POST /v1/patrol/unit/{name}/fix`](https://docs.hanzo.ai/docs/openapi/patrol/post-patrol-unit-by-name-fix)                            | Records where a unit is.                                                                                                                                                                                             |
| [`POST /v1/patrol/unit/{name}/state`](https://docs.hanzo.ai/docs/openapi/patrol/post-patrol-unit-by-name-state)                        | Moves a unit between states — on shift, on a break, off, or in trouble.                                                                                                                                              |
| [`GET /v1/patrol/unit/near`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-unit-near)                                           | Answers which units can reach a site soonest.                                                                                                                                                                        |
| [`GET /v1/patrol/unit`](https://docs.hanzo.ai/docs/openapi/patrol/get-patrol-unit)                                                     | Lists the fleet with each unit's position trail, which is what the map draws.                                                                                                                                        |

---

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