Create 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.

POST /v1/patrol/incident/{name}/step

Addresshttps://api.hanzo.ai/v1/patrol/incident/{name}/step
MethodPOST
Operationpost_patrol_incident_by_name_step
AuthAuthorization: Bearer $HANZO_API_KEY

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.

The states run forward only. An act from a state it does not leave is 409 naming the state the incident is in, and a caller without the act's roles is refused.

Request

7 fields, body application/json (required).

FieldInTypeRequiredDescription
namepathstringyesName is the incident's document name, from the path.
actbodystring—Act is VERIFY, DISPATCH, ROLL, ARRIVE, CHECK, SECURE, FILE, CLOSE or ESCALATE.
detailbodystring—Detail is what to write on the trail with this act.
falsebodyboolean—False says the activation turned out to be nothing, read by CLOSE.
namebodystring—Name is the incident's document name, from the path.
outcomebodystring—Outcome is what the incident came to, read by CLOSE.
unitbodystring—Unit is the call sign to send, read by DISPATCH.

Response

StatusBodyMeaning
200patrol.patrolIncidentOutok
defaultproblem-detailsrefused

200 body — 34 fields.

FieldInTypeAlwaysDescription
databodypatrol.patrolIncident—
data.checkedbodystring—Checked is when the premises had been walked.
data.clocksbodypatrol.patrolClock[]—Clocks is the SLA clocks, present on a single-incident read.
data.clocks[].elapsedbodyinteger (int64)—Elapsed is the seconds run so far, or the seconds it took when settled.
data.clocks[].labelbodystring—Label names the clock: Verify, Dispatch or On site.
data.clocks[].settledbodyinteger (int64)—Settled is the seconds it took, or -1 while the clock is still running.
data.clocks[].targetbodyinteger (int64)—Target is the contracted seconds.
data.closedbodystring—Closed is when the incident was closed.
data.dispatchedbodystring—Dispatched is when a unit was assigned.
data.enroutebodystring—Enroute is when that unit started moving.
data.escalatedbodystring—Escalated is when it was escalated, or empty.
data.falsebodyboolean—False says the activation turned out to be nothing.
data.filedbodystring—Filed is when the report was written.
data.namebodystring—Name is the incident's document name.
data.onsitebodystring—Onsite is when it arrived.
data.openedbodystring—Opened is when the activation landed.
data.outcomebodystring—Outcome is what it came to.
data.refbodystring—Ref is the receiving centre's own reference.
data.securedbodystring—Secured is when the site was made safe.
data.sitebodystring—Site is where it is happening.
data.slabodyinteger (int64)—SLA is the contracted response time in minutes.
data.statebodystring—State is one of received, verified, dispatched, enroute, onsite, checked, secured, filed and closed.
data.stepsbodypatrol.patrolAct[]—Steps is the act trail, present on a single-incident read.
data.steps[].actbodystring—Act is the act performed.
data.steps[].actorbodystring—Actor is who performed it.
data.steps[].atbodystring—At is when it happened.
data.steps[].detailbodystring—Detail is what they wrote with it.
data.steps[].frombodystring—From is the state the incident left.
data.steps[].tobodystring—To is the state it landed in.
data.tierbodystring—Tier is the site's contracted service tier.
data.triggerbodystring—Trigger is what the panel reported.
data.unitbodystring—Unit is the call sign attending, or empty.
data.verifiedbodystring—Verified is when the activation was confirmed real.
data.zonebodystring—Zone is the panel zone that reported.

Failure carries the platform error shape — see Errors.

Examples

hanzo patrol incident step <name>
import { Configuration, PatrolApi } from 'hanzoai';

const api = new PatrolApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postPatrolIncidentByNameStep({ name: 'name', act: "<act>", detail: "<detail>" });
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_incident_by_name_step(name='name', act="<act>", detail="<detail>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.PatrolAPI.PostPatrolIncidentByNameStep(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_incident_by_name_step(&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).postPatrolIncidentByNameStep();
curl -X POST https://api.hanzo.ai/v1/patrol/incident/<name>/step \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "act": "<act>",
       "detail": "<detail>"
     }'

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:

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 · All Hanzo APIs · Interactive reference

Was this page useful?