Hanzo AI
OpenapiPatrol

Create state

Moves a unit between states — on shift, on a break, off, or in trouble.

POST /v1/patrol/unit/{name}/state

Addresshttps://api.hanzo.ai/v1/patrol/unit/{name}/state
MethodPOST
Operationpost_patrol_unit_by_name_state
AuthAuthorization: Bearer $HANZO_API_KEY

Moves a unit between states — on shift, on a break, off, or in trouble. An officer may move only their own unit; the control room may move any.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
namepathstringyesName is the unit's call sign, from the path.
namebodystringName is the unit's call sign, from the path.
statebodystringState is available, assigned, enroute, onsite, offline, break or emergency.

Response

StatusBodyMeaning
200patrol.patrolUnitOutok
defaultproblem-detailsrefused

200 body — 13 fields.

FieldInTypeAlwaysDescription
databodypatrol.patrolUnit
data.duebodystringDue is the lone-worker deadline, or empty when none is set.
data.latbodynumber (double)Lat is the unit's last latitude in degrees.
data.lonbodynumber (double)Lon is the unit's last longitude in degrees.
data.namebodystringName is the unit's call sign, which is its document name and the segment /v1/patrol/unit/{name}/fix addresses it by.
data.officerbodystringOfficer is who is crewing it.
data.sectorbodystringSector is the patrol sector it works.
data.seenbodystringSeen is when the unit last reported.
data.statebodystringState is available, assigned, enroute, onsite, offline, break or emergency.
data.trailbodypatrol.patrolFix[]Trail is the tail of the unit's recorded positions, oldest first.
data.trail[].atbodystringAt is when the position was recorded.
data.trail[].latbodynumber (double)Lat is the latitude in degrees.
data.trail[].lonbodynumber (double)Lon is the longitude in degrees.

Failure carries the platform error shape — see Errors.

Examples

hanzo patrol unit state <name>

Patrol API · All Hanzo APIs · Interactive reference

How is this guide?

On this page