Get site

Returns one site whole: the register row plus the panel's zones and the standing hazards, which ride inside the document.

GET /v1/patrol/site/{name}

Addresshttps://api.hanzo.ai/v1/patrol/site/{name}
MethodGET
Operationget_patrol_site_by_name
AuthAuthorization: Bearer $HANZO_API_KEY

Returns one site whole: the register row plus the panel's zones and the standing hazards, which ride inside the document. A client asking for a site that is not theirs is 404.

Request

1 field.

FieldInTypeRequiredDescription
namepathstringyesName is the site's document name, from the path.

Response

StatusBodyMeaning
200patrol.patrolSiteOutok
defaultproblem-detailsrefused

200 body — 27 fields.

FieldInTypeAlwaysDescription
databodypatrol.patrolSite—
data.accountbodystring—Account is the alarm-panel account number the receiving centre reports.
data.camerasbodyinteger (int64)—Cameras is how many cameras are registered here.
data.categorybodystring—Category is what kind of premises this is.
data.clientbodystring—Client is the customer this site belongs to.
data.contactbodystring—Contact is the keyholder to reach.
data.eircodebodystring—Eircode is the postal code.
data.hazardsbodystring[]—Hazards is the standing warnings, present on a single-site read.
data.keysbodyboolean—Keys says whether the operation holds a key set for this site.
data.latbodynumber (double)—Lat is the site's latitude in degrees.
data.lonbodynumber (double)—Lon is the site's longitude in degrees.
data.namebodystring—Name is the site's document name and the segment /v1/patrol/site/{name} addresses it by.
data.notesbodystring—Notes is the standing brief for the site.
data.refbodyinteger (int64)—Ref is the site's number in the register.
data.riskbodyinteger (int64)—Risk is the assessed risk score.
data.sectorbodystring—Sector is the patrol sector the site sits in.
data.slabodyinteger (int64)—SLA is the contracted response time in minutes.
data.statusbodystring—Status is ok, fault, alarm or offline.
data.tierbodystring—Tier is the contracted service tier.
data.townbodystring—Town is the town the site is in.
data.unitbodystring—Unit is the call sign of the unit that covers the site, or empty.
data.visitsbodyinteger (int64)—Visits is how many patrol visits the contract calls for.
data.zonesbodypatrol.patrolZone[]—Zones is the panel's detection zones, present on a single-site read.
data.zones[].devicebodystring—Device is the detector type.
data.zones[].locationbodystring—Location is where in the building the zone is.
data.zones[].refbodystring—Ref is the zone number the panel reports.
data.zones[].statebodystring—State is the zone's last known condition.

Failure carries the platform error shape — see Errors.

Examples

hanzo patrol site get <name>
import { Configuration, PatrolApi } from 'hanzoai';

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

resp, _, err := client.PatrolAPI.GetPatrolSiteByName(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::get_patrol_site_by_name(&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).getPatrolSiteByName();
curl https://api.hanzo.ai/v1/patrol/site/<name> \
  -H "Authorization: Bearer $HANZO_API_KEY"

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

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_site_by_name",
           "input": {
             "name": "<name>"
           }
         }
       }
     }'

Patrol API · All Hanzo APIs · Interactive reference

Was this page useful?