Create alarm
Takes one activation. It records the activation whatever happens, then matches a site — the one the caller named, else the one whose account number…
POST /v1/patrol/alarm
| Address | https://api.hanzo.ai/v1/patrol/alarm |
| Method | POST |
| Operation | post_patrol_alarm |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Takes one activation. It records the activation whatever happens, then matches a site — the one the caller named, else the one whose account number reported — and on a match opens an incident in state received with that site's tier and SLA, puts the site into alarm, raises a red feed row and tells the controllers. An activation that matches no site is still recorded, raises an amber row, and answers 202: an activation is never dropped.
It admits the receiving centre's own credential and a controller keying one in
by hand. The centre holds the centre role its tenant granted it, which posts
an activation and reads nothing, like every other identity here.
The centre's own reference identifies the activation while the response it opened is still running, so a redelivery is answered with that response rather than dispatching a second unit. Centres recycle references, so once the response has closed the same one is the next activation.
Request
7 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
account | body | string | — | Account is the alarm-panel account number that reported. |
raw | body | any | — | Raw is the activation exactly as it arrived, kept verbatim up to 16 KiB. |
ref | body | string | — | Ref is the receiving centre's own reference for the activation. |
site | body | string | — | Site names the site directly, by document name, when the caller already knows it. |
source | body | string | — | Source is which receiver or operator the activation came through. |
trigger | body | string | — | Trigger is what the panel reported. |
zone | body | string | — | Zone is the panel zone that fired. |
Response
| Status | Body | Meaning |
|---|---|---|
201 | patrol.patrolAlarmOut | created |
202 | patrol.patrolAlarmOut | accepted |
default | problem-details | refused |
201 body — 38 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
data | body | patrol.patrolActivation | — | |
data.alarm | body | string | — | Alarm is the recorded activation's document name. |
data.incident | body | patrol.patrolIncident | — | |
data.incident.checked | body | string | — | Checked is when the premises had been walked. |
data.incident.clocks | body | patrol.patrolClock[] | — | Clocks is the SLA clocks, present on a single-incident read. |
data.incident.clocks[].elapsed | body | integer (int64) | — | Elapsed is the seconds run so far, or the seconds it took when settled. |
data.incident.clocks[].label | body | string | — | Label names the clock: Verify, Dispatch or On site. |
data.incident.clocks[].settled | body | integer (int64) | — | Settled is the seconds it took, or -1 while the clock is still running. |
data.incident.clocks[].target | body | integer (int64) | — | Target is the contracted seconds. |
data.incident.closed | body | string | — | Closed is when the incident was closed. |
data.incident.dispatched | body | string | — | Dispatched is when a unit was assigned. |
data.incident.enroute | body | string | — | Enroute is when that unit started moving. |
data.incident.escalated | body | string | — | Escalated is when it was escalated, or empty. |
data.incident.false | body | boolean | — | False says the activation turned out to be nothing. |
data.incident.filed | body | string | — | Filed is when the report was written. |
data.incident.name | body | string | — | Name is the incident's document name. |
data.incident.onsite | body | string | — | Onsite is when it arrived. |
data.incident.opened | body | string | — | Opened is when the activation landed. |
data.incident.outcome | body | string | — | Outcome is what it came to. |
data.incident.ref | body | string | — | Ref is the receiving centre's own reference. |
data.incident.secured | body | string | — | Secured is when the site was made safe. |
data.incident.site | body | string | — | Site is where it is happening. |
data.incident.sla | body | integer (int64) | — | SLA is the contracted response time in minutes. |
data.incident.state | body | string | — | State is one of received, verified, dispatched, enroute, onsite, checked, secured, filed and closed. |
data.incident.steps | body | patrol.patrolAct[] | — | Steps is the act trail, present on a single-incident read. |
data.incident.steps[].act | body | string | — | Act is the act performed. |
data.incident.steps[].actor | body | string | — | Actor is who performed it. |
data.incident.steps[].at | body | string | — | At is when it happened. |
data.incident.steps[].detail | body | string | — | Detail is what they wrote with it. |
data.incident.steps[].from | body | string | — | From is the state the incident left. |
data.incident.steps[].to | body | string | — | To is the state it landed in. |
data.incident.tier | body | string | — | Tier is the site's contracted service tier. |
data.incident.trigger | body | string | — | Trigger is what the panel reported. |
data.incident.unit | body | string | — | Unit is the call sign attending, or empty. |
data.incident.verified | body | string | — | Verified is when the activation was confirmed real. |
data.incident.zone | body | string | — | Zone is the panel zone that reported. |
data.matched | body | boolean | — | Matched says whether a site was found for it. |
data.site | body | string | — | Site is the site it matched, or empty. |
Failure carries the platform error shape — see Errors.
Examples
hanzo patrol alarmimport { Configuration, PatrolApi } from 'hanzoai';
const api = new PatrolApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postPatrolAlarm({ account: "<account>", raw: "<raw>" });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).post_patrol_alarm(account="<account>", raw="<raw>")cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.PatrolAPI.PostPatrolAlarm(context.Background()).Execute()
if err != nil {
return err
}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::post_patrol_alarm(&cfg, Default::default()).await?;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).postPatrolAlarm();The method above is the one at the current release of the document. [email protected] (npm) was generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl -X POST https://api.hanzo.ai/v1/patrol/alarm \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"account": "<account>",
"raw": "<raw>"
}'MCP declares no tool for patrol — tools/list on https://api.hanzo.ai/v1/mcp names the products it does reach. Use HTTP or an SDK.
How is this guide?