{"openapi":"3.1.0","info":{"title":"Alarm B2B API","description":"Read the state of your alarm systems, send them commands, and receive their events.\n\nAll paths start with `/v1`. HTTPS only. The base URL and your credentials are issued per environment.\n\n## Quick start\n\n```bash\n# 1. token (valid 1 h, reuse it)\ncurl -s -X POST https://<host>/v1/oauth/token -u '<client_id>:<client_secret>' -d grant_type=client_credentials\n# 2. your systems, and one system's state\ncurl -s https://<host>/v1/systems -H \"Authorization: Bearer <access_token>\"\ncurl -s https://<host>/v1/systems/2279375212/status -H \"Authorization: Bearer <access_token>\"\n# 3. a command: 202 {\"commandId\":\"...\",\"status\":\"PENDING\"}\ncurl -s -X POST https://<host>/v1/systems/2279375212/commands/arm -H \"Authorization: Bearer <access_token>\" \\\n  -H \"Content-Type: application/json\" -H \"Idempotency-Key: $(uuidgen)\" -d '{\"pin\":\"1234\",\"areas\":[1]}'\n# 4. its outcome: webhook, GET /v1/events, or\ncurl -s https://<host>/v1/commands/<commandId> -H \"Authorization: Bearer <access_token>\"\n```\n\n## Authentication\n\n- OAuth2 client credentials: `POST /v1/oauth/token` with `grant_type=client_credentials`, and `client_id` /\n  `client_secret` as HTTP Basic or in the form.\n- The token is valid for 1 h (`expires_in`). Cache it and get a new one shortly before it runs out: the token\n  endpoint takes at most 10 requests per minute per IP.\n- Scopes are fixed for your client when it is set up:\n\n| Scope | Routes |\n|---|---|\n| `systems:read` | `GET /v1/systems`, `GET /v1/systems/{bi}/status` |\n| `commands:write` | control commands: `arm`, `disarm`, `clear-alarm`, `bypass`, `bypass-permanent`, `unbypass`, `outputs`, `service-mode`, `ping`; `GET /v1/commands/{id}` |\n| `commands:maintain` | maintenance commands: `restart`, `firmware-upgrade`, `refresh-installation`, `upload-diagnostics`, `upload-log`, `re-pair`, `reset`, `gsm-switch`, `change-pin`, `restore-pin`, `apply`; `GET /v1/commands/{id}` |\n| `events:read` | `GET /v1/events` |\n\n- The client secret does not expire. We rotate it on request; the old one stops working at once, while tokens\n  already issued last until they expire.\n\n### Tokens for your staff, apps and customers\n\nKeep `client_secret` on your own server. To let someone else act on your systems (an operator, a technician, an\nend customer's app), mint a token for them on your server and hand over only the token. Narrow it with these\noptional form fields; each one left out means no limit:\n\n| Field | Value | Effect |\n|---|---|---|\n| `scope` | space-separated, some of your scopes | The token gets only these. A scope you don't have: 400 `invalid_scope`. |\n| `bi` | systems, space- or comma-separated or repeated, at most 100 | The token reaches only these systems. Others answer 404 and are left out of `/v1/systems` and `/v1/events`. A system that isn't yours: 400. |\n| `commands` | command names, e.g. `arm disarm` | The token may send only these. Others answer 403 `COMMAND_NOT_ALLOWED`. Each must be allowed by the token's scope, else 400. |\n| `ext_user_id` | your id for the person or app, 1-64 of `A-Z a-z 0-9 . _ : @ + -` | Kept with every command the token sends, and returned as `extUserId` by `GET /v1/commands/{id}`, so each action is audited. Use an opaque id, not a name or e-mail. |\n\n```bash\n# a shop's closing-shift worker: may only arm system 2279375212\ncurl -s -X POST https://<host>/v1/oauth/token -u '<client_id>:<client_secret>' -d grant_type=client_credentials \\\n  -d 'scope=systems:read commands:write' -d bi=2279375212 -d commands=arm -d ext_user_id=shop42-closing\n```\n\n- A field sent empty is 400, never \"no limit\"; `error_description` names the field.\n- A token can't be widened. For more systems or commands, mint a new one.\n- Webhooks are set per client and always deliver all your systems' events, whatever tokens you mint.\n- A narrowed token lasts 1 h like any other, and there is no way to revoke one sooner except rotating your secret.\n  Mint them only for as long as they're needed.\n\n## Systems\n\n- A system is identified by its **BI**, a number. Send it in any numeric form (`2279375212`, `12345678`,\n  `0012345678`); answers always use 10 digits, zero-padded.\n- You see only the systems assigned to you. Someone else's system answers 404, exactly like one that does not exist.\n- `ownership` is `ACTIVE`, or `AWAITING_CONFIRMATION` while a user of the system (in the alarm app) has not yet\n  confirmed the assignment. Until it is `ACTIVE` there is no state and there are no events, and commands answer\n  403 `SYSTEM_AWAITING_CONFIRMATION`.\n- `online` is whether the device is connected now. `stale: true` means our view of that is over 2 min old, so\n  `online` may be out of date; `online: null` means not known yet.\n\n## Commands\n\nA command is asynchronous:\n\n1. `POST /v1/systems/{bi}/commands/<route>` answers **202** with a `commandId` and status `PENDING`. That only\n   means it was accepted for delivery.\n2. The panel answers, usually within 10 s. The command gets a final status and a `result` code, and you get the\n   events `command.accepted`, then `command.completed`, `command.queued` or `command.rejected`. With no answer in\n   120 s it becomes `TIMEOUT` (event `command.timeout`); a late answer can still follow and overwrite it.\n3. `result: OK` means the panel **accepted** the command, not that it took effect. Confirm the effect with the\n   `system.*` events or `GET /v1/systems/{bi}/status` (table below). `system.*` events have no `correlationId`:\n   match them by `changedBy.commandId` when `changedBy.type` is `API_USER`, otherwise on the system, the area, zone\n   or output number, and an `occurredAt` after the command's result.\n\n| Status | Final | Meaning |\n|---|---|---|\n| `PENDING` | no | Accepted, being delivered. |\n| `ACCEPTED` | no | Passed the system's checks, handed to the panel. |\n| `COMPLETED` | yes | The panel was asked; `result` says how it answered (`COMPLETED` + `WRONG_PIN` is normal). |\n| `QUEUED` | yes | Stored for the device's next connection. Nothing more arrives; watch for the effect. |\n| `REJECTED` | yes | Refused before anything reached the panel; `result` says why. |\n| `TIMEOUT` | yes | No answer within 120 s. Read the state before retrying. |\n\n`result` codes. The list is open-ended: treat a code you don't know as \"read the state, then decide\".\n\n| `result` | Meaning | What to do |\n|---|---|---|\n| `OK` | The panel accepted it. | Confirm the effect. |\n| `PARTIAL` | The panel did only part of it. | Read the state. |\n| `FAILED` | The panel reports failure. It may still have acted. | Read the state before retrying. |\n| `WRONG_PIN` | Wrong user code. Counts toward the lock. | Fix the PIN. |\n| `PIN_LOCKED` | 5 wrong PINs lock commands, `ping` included, for 90 s. | Retry after 90 s. |\n| `DENIED` | The PIN's user lacks the right, or does not control those areas or outputs. | Don't retry. |\n| `NOT_ALLOWED_NOW` | `detail`: `SERVICE_MODE` (panel in service mode), `TIMER` (outside the user's schedule), `SERVICE_MODE_REQUIRED` (`re-pair` outside service mode). | Change the condition, then retry. |\n| `NO_ANSWER` | Sent, outcome unknown. It may have run. | Read the state before any retry. |\n| `NOT_SENT` | Not executed. `detail: PAIRING`: the system is not paired with our server yet (see `re-pair` / onboarding). | Retry with a new key. |\n| `ERROR` | Anything else. | Read the state; contact support with the `commandId`. |\n| `QUEUED` | Stored for the device's next connection. | Watch for the effect. |\n| `INVALID` | `detail` names a field. Means our two sides disagree: a bug. | Report it. |\n| `NOT_AUTHORIZED` | The system is not yours. | Don't retry. |\n| `RATE_LIMITED` | Over a limit. | Back off. |\n| `OFFLINE` | The device is not connected. Nothing was sent. | Retry after `module.connected`. |\n| `EXPIRED` | Could not be sent within 60 s. | Retry with a new key. |\n| `NOT_SUPPORTED` | This system cannot do this command. | Don't retry. |\n| `TIMEOUT` | No answer within 120 s. | Read the state. |\n\nCommand routes. PIN routes need `pin`: 4-6 digits, as a string, the code of a user of that panel; it decides which\nareas and outputs the command may touch. We never store or log it; don't log it on your side either.\n\n| Route | Body | Confirm with |\n|---|---|---|\n| `arm` | `pin`, `areas?` (1-4; default: all areas of the PIN's user), `mode?` (`AWAY` default, `STAY`, `NIGHT`, `VACATION`) | `system.armstate` per area. Unused areas answer OK and never change. |\n| `disarm` | `pin`, `areas?` | `system.armstate` = `DISARMED` |\n| `clear-alarm` | `pin`, `areas?` (default: all areas of the PIN's user) | `system.alarm` = `NO_ALARM`. Clears the alarm and its memory. |\n| `bypass` | `pin`, `zones` (1-64) | `system.zone` `state` = `BYPASSED` (non-existent zones also answer OK). A normal bypass, meant for one arm/disarm cycle (not verified live yet that the panel ends it at the next disarm). The panel can report a bypass change minutes after `OK`; the `OK` is its confirmation. |\n| `bypass-permanent` | `pin`, `zones` (1-64) | `system.zone` `state` = `BYPASSED` and `permanent: true`. Stays through arming and disarming until `unbypass`. Its `system.zone` can come later than a normal bypass's; the `OK` is the panel's confirmation. |\n| `unbypass` | `pin`, `zones` (1-64) | `system.zone` `state` leaving `BYPASSED`. Removes normal and permanent bypasses alike. |\n| `outputs` | `pin`, `outputs` (1-32), `state` (`ON` / `OFF`) | `system.output` `state`. Pulse outputs switch back by themselves. |\n| `service-mode` | `pin`, `state` (`ON` / `OFF`) | `system.service` `serviceAllowed`. Arming is refused while `inServiceMode` is true. |\n| `ping` | none | The result itself: checks the path to the panel in about 2 s. |\n| `re-pair` | none | The result itself. Needs service mode on. |\n| `restart`, `firmware-upgrade` | none | `module.disconnected`, then `module.connected`. Queued for the next connection. |\n| `refresh-installation`, `upload-diagnostics`, `upload-log`, `apply` | none | Queued. Nothing comes back through the API. |\n| `reset`, `change-pin`, `restore-pin`, `gsm-switch` | as listed per route | Not usable yet: `NOT_SUPPORTED` or refused by the panel. |\n\nRules:\n\n- The body has exactly the fields listed: an unknown field is 400 `UNKNOWN_FIELD`, a bad value 400\n  `INVALID_FIELD`; `field` names it. Lists hold distinct integers. Routes without fields take no body or `{}`.\n- **`Idempotency-Key` is required**, 1-128 characters, one per intended command (a UUID works). Sending the same\n  key again with the same system, route and fields returns the first command (200) and sends nothing, so a retry\n  after a network error is safe. The same key with anything else is 422. The PIN is not part of the comparison:\n  a corrected PIN, or any retry after a final failure, needs a **new** key. Keys never expire.\n- One command at a time per system: while one is `PENDING` or `ACCEPTED`, another answers 409 `COMMAND_IN_FLIGHT`.\n- Some routes may be switched off in an environment: 403 `COMMAND_DISABLED`.\n\n## Events\n\nEverything that happens on your systems, and to your commands, is an event. You get the same stream two ways:\npushed to your webhook, or pulled with `GET /v1/events`.\n\n| Field | Meaning |\n|---|---|\n| `eventId` | Position in your stream. Increases; numbers can be skipped. |\n| `messageId` | Unique per event. The same event can arrive twice: drop a `messageId` you have already handled. |\n| `messageType` | Below. |\n| `bi` | The system, 10 digits. |\n| `occurredAt` | When we received it from the device (UTC). |\n| `correlationId` | On `command.*` events: the `commandId`. Otherwise null. |\n| `payload` | Depends on `messageType`. |\n\n| `messageType` | `payload` |\n|---|---|\n| `module.connected` | `serialNumber` |\n| `module.disconnected` | `serialNumber`, `reason` (`CLIENT_CLOSED`, `TIMEOUT`, `SERVER_SHUTDOWN`, `ERROR`, `UNKNOWN`) |\n| `system.armstate` | `areaNumber`, `armMode` (`DISARMED`, `AWAY`, `STAY`, `NIGHT`, `VACATION`, `UNKNOWN`), `changedBy` (below), `serialNumber` |\n| `system.alarm` | `areaNumber`, `alarm` (`NO_ALARM`, `ALARM`, `FIRE_ALARM`, `ALARM_MEM`, `FIRE_ALARM_MEM`), `serialNumber`. The area's alarm state; anything but `NO_ALARM` means an alarm happened there. |\n| `system.alarmevent` | `category` (`FIRE`, `PANIC`, `DURESS`, `BURGLARY`, `TAMPER`, `MEDICAL`, `TECHNICAL`, `OTHER`), `active` (true = alarm, false = restore), and where known `areaNumber`, `zoneNumber`, `zoneName`, `moduleNumber`, `userNumber`; `serialNumber`. Each alarm as it happens: **act on this one.** |\n| `system.zone` | `zoneNumber`, `zoneName`, `state` (e.g. `OPEN`, `CLOSED`, `BYPASSED`), `permanent` (`true` on a permanent bypass, else absent), `serialNumber` |\n| `system.trouble` | `trouble` (a code, e.g. `AC_LOSS`, `LOW_BATTERY`), `active`, `serialNumber` |\n| `system.output` | `outputNumber`, `outputName`, `state` (`ON`, `OFF`, `UNKNOWN`), `trouble`, `serialNumber` |\n| `system.service` | `serviceAllowed`, `inServiceMode`, `serialNumber` |\n| `command.accepted` | `command`, `params` |\n| `command.completed`, `command.queued`, `command.rejected`, `command.timeout` | `command`, `params`, `result`, `detail?`. A 429 from the API also emits `command.rejected` with `idempotencyKey` and no command behind it. |\n\n- New event types, payload fields and codes can appear at any time: ignore what you don't know.\n- `system.*` events are sent when a value changes, including changes found when the device reconnects.\n- Who made a change: one `changedBy` object, always on `system.armstate`, on `system.zone`, `system.output` and\n  `system.alarm` when known. It holds only what is known:\n\n  ```json\n  \"changedBy\": {\"type\": \"API_USER\", \"commandId\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\", \"extUserId\": \"staff-17\", \"userNumber\": 1}\n  ```\n\n  `type` says who. `API_USER`: a command sent through this API, with its `commandId` and, when the token had an\n  `ext_user_id`, `extUserId`. `ALARMSERVER_USER`: a user of the alarm app, with `alarmserverUserId` (reserved, not\n  sent yet: a change from the app comes as `UNKNOWN` with `userNumber`). `KEYPAD`: someone at the panel (reserved,\n  not sent yet: a keypad change comes as `UNKNOWN` with `userNumber`). `SCHEDULE`: the panel's timer. `UNKNOWN`:\n  can't tell. The list is open-ended: treat a value you don't know as someone else. `userNumber`, when present, is\n  the panel user whose code was used; every remote command uses a panel user's code too, so on its own it doesn't\n  tell who. Ids only, never names.\n  `GET /v1/systems/{bi}/status` shows the same object for each area's arm mode, zone and output, always with\n  `type`, `commandId`, `extUserId`, `userNumber` and `alarmserverUserId`, each null when not known, and\n  `\"changedBy\": null` when nothing is known (`commandId` and `extUserId` while the command is kept); who cleared an\n  area's alarm is only in its `system.alarm` event.\n- Events and finished commands are kept **90 days**.\n- Pulling: `GET /v1/events?since=<cursor>` returns up to `limit` (default 100, max 500) events after the cursor and a\n  `nextCursor`. Store `nextCursor` once you have processed the page; start from 0.\n\n## Webhooks\n\nOptional. We POST each event to your HTTPS URL: one event per request, in `eventId` order, the next one only after\nyou answered 2xx.\n\n- The body is the event as above plus `previousEventId`, the `eventId` of the delivery before it.\n- Answer 2xx within 15 s; do the work afterwards. Any other answer, a redirect included, or no answer, is a failed\n  attempt. We retry after 1 s, 5 s, 30 s, 5 min and 30 min; then the event is **skipped** and delivery goes on.\n- So: if `previousEventId` is not the last `eventId` you handled, fetch the gap with\n  `GET /v1/events?since=<last eventId you handled>`.\n- Delivery starts with events created after your webhook was set up. Earlier ones are in `GET /v1/events`.\n- Verify every request ([Standard Webhooks](https://www.standardwebhooks.com/); libraries exist for most languages).\n  Use the raw body bytes, before any JSON parsing:\n\n```python\nimport base64, hashlib, hmac, time\n\ndef verify(webhook_secret, headers, raw_body):\n    key = base64.b64decode(webhook_secret.removeprefix(\"whsec_\"))\n    msg_id, ts = headers[\"webhook-id\"], headers[\"webhook-timestamp\"]\n    if abs(time.time() - int(ts)) > 300:\n        return False\n    expected = base64.b64encode(hmac.new(key, f\"{msg_id}.{ts}.\".encode() + raw_body, hashlib.sha256).digest()).decode()\n    return any(hmac.compare_digest(s[3:], expected) for s in headers[\"webhook-signature\"].split() if s.startswith(\"v1,\"))\n```\n\n`webhook-id` is the event's `messageId`, the same on every retry: deduplicate on it.\n\n## Errors\n\nErrors are `application/problem+json` with a stable `code` (each route lists its own). 401, the scope's 403 and\nthe HTTP limit's 429 have no body.\n\n## Limits\n\n| Limit | Value | Answer |\n|---|---|---|\n| Token requests | 10 / min per IP | 429 |\n| All `/v1` requests | 300 / min per client, bursts of 60 | 429, `Retry-After: 60` |\n| Commands | 10 / min per system, 100 / min per client | 429 `RATE_LIMITED` |\n| Maintenance commands | 1 / min per system per route | 429 `RATE_LIMITED` |\n| Commands in flight | 1 per system | 409 `COMMAND_IN_FLIGHT` |\n| Request body | 16 KiB | 413 `PAYLOAD_TOO_LARGE` |\n\nAnswers to the token endpoint and to authenticated requests carry `X-RateLimit-Limit` and `X-RateLimit-Remaining`.\n\n## Versioning\n\nChanges within `/v1` are additive: new routes, fields, event types and codes. Build your client to ignore what it\ndoesn't know.\n\nTwo changes before launch were not (2026-11-03): `changedBy` became an object, with `commandId`, `extUserId`,\n`userNumber` and `alarmserverUserId` moved into it (stored events were converted), and `bypass`'s `permanent` flag\ngave way to the route `bypass-permanent`.\n","version":"v1"},"servers":[{"url":"https://api.agreeabletree-8140f2ed.westeurope.azurecontainerapps.io","description":"Generated server url"}],"tags":[{"name":"Authentication"},{"name":"Systems"},{"name":"Commands"},{"name":"Events"}],"paths":{"/v1/systems/{bi}/commands/upload-log":{"post":{"tags":["Commands"],"summary":"Upload the event log to the server","description":"Queued. Nothing comes back through the api. Scope commands:maintain, at most 1/min per system.","operationId":"uploadLog","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:maintain"]}]}},"/v1/systems/{bi}/commands/upload-diagnostics":{"post":{"tags":["Commands"],"summary":"Upload diagnostics to the server","description":"Queued. Nothing comes back through the api. Scope commands:maintain, at most 1/min per system.","operationId":"uploadDiagnostics","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:maintain"]}]}},"/v1/systems/{bi}/commands/unbypass":{"post":{"tags":["Commands"],"summary":"Unbypass zones","description":"Removes normal and permanent bypasses alike. OK means the panel accepted it: confirm with system.zone leaving BYPASSED.","operationId":"unbypass","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZonesDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:write"]}]}},"/v1/systems/{bi}/commands/service-mode":{"post":{"tags":["Commands"],"summary":"Turn service mode on or off","description":"Sets serviceAllowed, which re-pair needs. Confirm with system.service (serviceMode in status), about 3-4 s after OK. Arming is refused while inServiceMode is true.","operationId":"serviceMode","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceModeDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:write"]}]}},"/v1/systems/{bi}/commands/restore-pin":{"post":{"tags":["Commands"],"summary":"Restore the PIN","description":"Answers NOT_SUPPORTED until there is a tested implementation. Scope commands:maintain, at most 1/min per system.","operationId":"restorePin","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PinDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:maintain"]}]}},"/v1/systems/{bi}/commands/restart":{"post":{"tags":["Commands"],"summary":"Restart the device","description":"Queued: runs at the device's next poll. Confirm with module.disconnected, then module.connected. Scope commands:maintain, at most 1/min per system.","operationId":"restart","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:maintain"]}]}},"/v1/systems/{bi}/commands/reset":{"post":{"tags":["Commands"],"summary":"Reset the panel","description":"Not implemented yet: answers NOT_SUPPORTED and sends nothing. Scope commands:maintain, at most 1/min per system.","operationId":"reset","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:maintain"]}]}},"/v1/systems/{bi}/commands/refresh-installation":{"post":{"tags":["Commands"],"summary":"Refresh the installation summary","description":"Queued. The panel resends its zones and outputs to the server. Scope commands:maintain, at most 1/min per system.","operationId":"refreshInstallation","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:maintain"]}]}},"/v1/systems/{bi}/commands/re-pair":{"post":{"tags":["Commands"],"summary":"Re-pair the server with the panel","description":"Works only while service mode is on, otherwise NOT_ALLOWED_NOW / SERVICE_MODE_REQUIRED. Scope commands:maintain, at most 1/min per system.","operationId":"rePair","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:maintain"]}]}},"/v1/systems/{bi}/commands/ping":{"post":{"tags":["Commands"],"summary":"Check the command channel","description":"End to end in about 2 s. The result is the confirmation.","operationId":"ping","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:write"]}]}},"/v1/systems/{bi}/commands/outputs":{"post":{"tags":["Commands"],"summary":"Switch outputs on or off","description":"The answer says nothing about the effect in either direction: confirm with system.output. Pulse outputs switch themselves back.","operationId":"outputs","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutputsDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:write"]}]}},"/v1/systems/{bi}/commands/gsm-switch":{"post":{"tags":["Commands"],"summary":"Switch the mobile network","description":"Refused by the panel when tried, and the device still went offline for about 4.5 min. Scope commands:maintain, at most 1/min per system.","operationId":"gsmSwitch","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PinDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:maintain"]}]}},"/v1/systems/{bi}/commands/firmware-upgrade":{"post":{"tags":["Commands"],"summary":"Upgrade the firmware","description":"Queued. Reflashes to the newest firmware the server holds, then reboots. Confirm as for restart. Scope commands:maintain, at most 1/min per system.","operationId":"firmwareUpgrade","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:maintain"]}]}},"/v1/systems/{bi}/commands/disarm":{"post":{"tags":["Commands"],"summary":"Disarm areas","description":"No areas = all areas the PIN's user controls. OK means the panel accepted it: confirm with system.armstate = DISARMED.","operationId":"disarm","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AreasDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:write"]}]}},"/v1/systems/{bi}/commands/clear-alarm":{"post":{"tags":["Commands"],"summary":"Clear the alarm","description":"Clears the alarm and its memory on the areas. No areas = all areas the PIN's user controls. OK means the panel accepted it: confirm with system.alarm = NO_ALARM.","operationId":"clearAlarm","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AreasDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:write"]}]}},"/v1/systems/{bi}/commands/change-pin":{"post":{"tags":["Commands"],"summary":"Change the PIN","description":"Answers NOT_SUPPORTED until there is a tested implementation. Scope commands:maintain, at most 1/min per system.","operationId":"changePin","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePinDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:maintain"]}]}},"/v1/systems/{bi}/commands/bypass":{"post":{"tags":["Commands"],"summary":"Bypass zones","description":"The panel's normal bypass of every listed zone, meant for one arm/disarm cycle (not verified live yet that the panel ends it at the next disarm). OK means the panel accepted it, also for zones that don't exist or can't be bypassed: confirm with system.zone = BYPASSED. The panel can report the zone minutes after OK; the OK is its confirmation.","operationId":"bypass","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZonesDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:write"]}]}},"/v1/systems/{bi}/commands/bypass-permanent":{"post":{"tags":["Commands"],"summary":"Bypass zones permanently","description":"The panel's long bypass of every listed zone: it stays through arming and disarming until unbypass. OK means the panel accepted it, also for zones that don't exist or can't be bypassed: confirm with system.zone = BYPASSED and permanent: true. The panel can report the zone minutes after OK; the OK is its confirmation.","operationId":"bypassPermanent","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZonesDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:write"]}]}},"/v1/systems/{bi}/commands/arm":{"post":{"tags":["Commands"],"summary":"Arm areas","description":"No areas = all areas the PIN's user controls; no mode = AWAY. OK means the panel accepted it: confirm with system.armstate.","operationId":"arm","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArmDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:write"]}]}},"/v1/systems/{bi}/commands/apply":{"post":{"tags":["Commands"],"summary":"Apply","description":"Queued. No effect today. Scope commands:maintain, at most 1/min per system.","operationId":"apply","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","description":"1-128 characters, one per intended command. The same key with the same system, route and fields replays the first command (200); with anything else it is 422. A retry after a final failure (NOT_SENT, EXPIRED, TIMEOUT, WRONG_PIN, ...) needs a new key. Keys never expire.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyDoc"}}}},"responses":{"202":{"description":"Accepted: a new command, status PENDING. Location: /v1/commands/{commandId}. The outcome comes later, see the overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"200":{"description":"Replay of an earlier request with this Idempotency-Key: its command and current status. Nothing is sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"400":{"description":"IDEMPOTENCY_KEY_REQUIRED, MALFORMED_JSON, UNKNOWN_FIELD or INVALID_FIELD (`field` names it).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"No body: the token lacks this route's scope. COMMAND_DISABLED: the route is off in this environment. COMMAND_NOT_ALLOWED: the token was minted with `commands` and this one is not on it. SYSTEM_AWAITING_CONFIRMATION: a user of the system has not confirmed the assignment yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"SYSTEM_NOT_FOUND: no such system, not yours, or not on the token's `bi` list.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"COMMAND_IN_FLIGHT: another command to this system is still PENDING or ACCEPTED (`commandId`). Nothing was stored: retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 16 KiB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"415":{"description":"A body with a Content-Type other than application/json."},"422":{"description":"IDEMPOTENCY_KEY_REUSED: this key was used for another system, route or fields.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"RATE_LIMITED: 10 commands/min per system, 100/min per customer, 1/min per system on a maintenance route; a command.rejected event follows. Without a body: the HTTP limit. Retry-After: 60.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"UNAVAILABLE: not sent, nothing stored. Retry the same key after Retry-After (5 s).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"oauth2":["commands:maintain"]}]}},"/v1/oauth/token":{"post":{"tags":["Authentication"],"summary":"Get an access token","description":"OAuth2 client_credentials. Send client_id and client_secret as HTTP Basic or in the form. The token is valid for 1 h: reuse it, and fetch a new one shortly before expires_in runs out. At most 10 requests per minute per IP.\n\nTo hand a token to your staff, apps or customers, narrow it with scope, bi and commands, and name its user with ext_user_id: every command sent with it is then audited with that id. A token can't be widened later; mint a new one. Keep client_secret on your own server.","operationId":"token","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/TokenForm"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenDoc"}}}},"400":{"description":"invalid_request (error_description says which field), invalid_scope (a scope you don't have) or unsupported_grant_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthErrorDoc"}}}},"401":{"description":"invalid_client: unknown client_id or wrong secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthErrorDoc"}}}},"413":{"description":"The form is over 16 KiB","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"429":{"description":"Over 10 requests per minute from this IP (no body, Retry-After: 60), or temporarily_unavailable: too many token requests at once, retry in a moment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthErrorDoc"}}}}}}},"/v1/systems":{"get":{"tags":["Systems"],"summary":"List your systems","description":"Every system assigned to you. `ownership` is ACTIVE, or AWAITING_CONFIRMATION until a user of the system confirms the assignment: until then `online` is null and nothing else about the system is shown. `online` is the device's connection; `stale` = true means our view of it is over 2 min old, so `online` may be out of date.","operationId":"listSystems","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SystemSummary"}}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"The token lacks this route's scope. No body."},"429":{"description":"HTTP limit, 300/min per customer with bursts of 60. No body, Retry-After: 60."}},"security":[{"oauth2":["systems:read"]}]}},"/v1/systems/{bi}/status":{"get":{"tags":["Systems"],"summary":"Read a system's last known state","description":"Areas (arm mode, alarm), zones, troubles, outputs and service mode, each with the time it last changed: the same values the system.* events carry. `bi` in any numeric form; answers use 10 digits. Lists can be empty until the panel's next status report. `serviceMode` is null until the panel's first status report. Areas, zones and outputs say who made the last change in `changedBy`: `type` (`API_USER`, `ALARMSERVER_USER`, `KEYPAD`, `SCHEDULE`, `UNKNOWN`; open-ended), `commandId`, `extUserId`, `userNumber` and `alarmserverUserId`, each null when not known; `commandId` and `extUserId` while that command is kept. `changedBy` is null when nothing is known. An area's comes from its arm mode. A zone's `permanent` is true for a permanent bypass.","operationId":"status","parameters":[{"name":"bi","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"The token lacks this route's scope. No body."},"404":{"description":"Not found, or not yours: one answer for both.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"HTTP limit, 300/min per customer with bursts of 60. No body, Retry-After: 60."}},"security":[{"oauth2":["systems:read"]}]}},"/v1/oauth/jwks":{"get":{"tags":["Authentication"],"summary":"Public key that signs the tokens","description":"JWKS (RS256). Only needed if you want to read the token yourself; the API checks it.","operationId":"jwks","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}}}}},"/v1/events":{"get":{"tags":["Events"],"summary":"Read your event stream","description":"Your events in eventId order, oldest first. Page with `since` = the previous page's `nextCursor`; an empty page keeps the cursor. The same stream the webhook delivers. Events and finished commands are kept 90 days.","operationId":"events","parameters":[{"name":"since","in":"query","description":"Return events with eventId greater than this. Default 0.","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"bi","in":"query","description":"Only this system (any numeric form).","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Page size, 1-500. Default 100.","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/EventPage"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"The token lacks this route's scope. No body."},"429":{"description":"HTTP limit, 300/min per customer with bursts of 60. No body, Retry-After: 60."}},"security":[{"oauth2":["events:read"]}]}},"/v1/commands/{id}":{"get":{"tags":["Commands"],"summary":"Read a command's status","description":"status: PENDING, ACCEPTED (not final), QUEUED, COMPLETED, REJECTED, TIMEOUT (final). A final status always has a `result` code. COMPLETED means the system finished handling it; `result` says how (OK, WRONG_PIN, ...). A late result can turn TIMEOUT into COMPLETED or REJECTED. `extUserId`: the ext_user_id of the token that sent it, if any.","operationId":"get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CommandView"}}}},"401":{"description":"Missing, invalid or expired token. No body."},"403":{"description":"The token lacks this route's scope. No body."},"404":{"description":"Not found, or not yours: one answer for both.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"HTTP limit, 300/min per customer with bursts of 60. No body, Retry-After: 60."}},"security":[{"oauth2":["commands:write"]},{"oauth2":["commands:maintain"]}]}}},"components":{"schemas":{"EmptyDoc":{},"CommandAccepted":{"type":"object","properties":{"commandId":{"type":"string","format":"uuid"},"status":{"type":"string"}}},"ZonesDoc":{"type":"object","properties":{"pin":{"type":"string","pattern":"^[0-9]{4,6}$"},"zones":{"type":"array","items":{"type":"integer","format":"int32","maximum":64,"minimum":1},"maxItems":64,"minItems":1,"uniqueItems":true}},"required":["pin","zones"]},"ServiceModeDoc":{"type":"object","properties":{"pin":{"type":"string","pattern":"^[0-9]{4,6}$"},"state":{"type":"string","enum":["ON","OFF"]}},"required":["pin","state"]},"PinDoc":{"type":"object","properties":{"pin":{"type":"string","pattern":"^[0-9]{4,6}$"}},"required":["pin"]},"OutputsDoc":{"type":"object","properties":{"pin":{"type":"string","pattern":"^[0-9]{4,6}$"},"outputs":{"type":"array","items":{"type":"integer","format":"int32","maximum":32,"minimum":1},"maxItems":32,"minItems":1,"uniqueItems":true},"state":{"type":"string","enum":["ON","OFF"]}},"required":["outputs","pin","state"]},"AreasDoc":{"type":"object","properties":{"pin":{"type":"string","pattern":"^[0-9]{4,6}$"},"areas":{"type":"array","items":{"type":"integer","format":"int32","maximum":4,"minimum":1},"maxItems":4,"minItems":1,"uniqueItems":true}},"required":["pin"]},"ChangePinDoc":{"type":"object","properties":{"pin":{"type":"string","pattern":"^[0-9]{4,6}$"},"newPin":{"type":"string","pattern":"^[0-9]{4,6}$"}},"required":["newPin","pin"]},"ArmDoc":{"type":"object","properties":{"pin":{"type":"string","pattern":"^[0-9]{4,6}$"},"areas":{"type":"array","items":{"type":"integer","format":"int32","maximum":4,"minimum":1},"maxItems":4,"minItems":1,"uniqueItems":true},"mode":{"type":"string","default":"AWAY","enum":["AWAY","STAY","NIGHT","VACATION"]}},"required":["pin"]},"TokenForm":{"type":"object","properties":{"grant_type":{"type":"string","enum":["client_credentials"]},"client_id":{"type":"string","description":"Leave out when sent as HTTP Basic"},"client_secret":{"type":"string","description":"Leave out when sent as HTTP Basic"},"scope":{"type":"string","description":"Space-separated. Only these of your scopes; leave out for all of them"},"bi":{"type":"string","description":"Space- or comma-separated, or repeated, at most 100. Only these of your systems; leave out for all of them"},"commands":{"type":"string","description":"Space- or comma-separated, or repeated: command names, e.g. `arm disarm`. Only these commands; leave out for every command the scopes allow"},"ext_user_id":{"type":"string","description":"Your id for the person or app that will use this token, kept with every command it sends (audit). An opaque id, not a name or e-mail","pattern":"^[A-Za-z0-9._:@+-]{1,64}$"}},"required":["grant_type"]},"TokenDoc":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer","format":"int64"},"scope":{"type":"string","description":"Space-separated scopes granted to this token"}}},"OAuthErrorDoc":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_request","invalid_scope","unsupported_grant_type","invalid_client","temporarily_unavailable"]},"error_description":{"type":"string"}}},"SystemSummary":{"type":"object","properties":{"bi":{"type":"string"},"ownership":{"type":"string"},"online":{"type":"boolean"},"asOf":{"type":"string","format":"date-time"},"stale":{"type":"boolean"}}},"Area":{"type":"object","properties":{"areaNumber":{"type":"integer","format":"int32"},"armMode":{"type":"string"},"armModeAt":{"type":"string","format":"date-time"},"changedBy":{"$ref":"#/components/schemas/ChangedBy"},"alarm":{"type":"string"},"alarmAt":{"type":"string","format":"date-time"},"alarmZoneNumber":{"type":"integer","format":"int32"}}},"ChangedBy":{"type":"object","properties":{"type":{"type":"string"},"commandId":{"type":"string"},"extUserId":{"type":"string"},"userNumber":{"type":"integer","format":"int32"},"alarmserverUserId":{"type":"integer","format":"int64"}}},"Output":{"type":"object","properties":{"outputNumber":{"type":"integer","format":"int32"},"outputName":{"type":"string"},"state":{"type":"string"},"trouble":{"type":"boolean"},"at":{"type":"string","format":"date-time"},"changedBy":{"$ref":"#/components/schemas/ChangedBy"}}},"ServiceMode":{"type":"object","properties":{"serviceAllowed":{"type":"boolean"},"inServiceMode":{"type":"boolean"},"at":{"type":"string","format":"date-time"}}},"StatusResponse":{"type":"object","properties":{"bi":{"type":"string"},"ownership":{"type":"string"},"online":{"type":"boolean"},"asOf":{"type":"string","format":"date-time"},"stale":{"type":"boolean"},"areas":{"type":"array","items":{"$ref":"#/components/schemas/Area"}},"zones":{"type":"array","items":{"$ref":"#/components/schemas/Zone"}},"troubles":{"type":"array","items":{"$ref":"#/components/schemas/Trouble"}},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/Output"}},"serviceMode":{"$ref":"#/components/schemas/ServiceMode"}}},"Trouble":{"type":"object","properties":{"trouble":{"type":"string"},"active":{"type":"boolean"},"at":{"type":"string","format":"date-time"}}},"Zone":{"type":"object","properties":{"zoneNumber":{"type":"integer","format":"int32"},"zoneName":{"type":"string"},"state":{"type":"string"},"permanent":{"type":"boolean"},"at":{"type":"string","format":"date-time"},"changedBy":{"$ref":"#/components/schemas/ChangedBy"}}},"EventItem":{"type":"object","properties":{"eventId":{"type":"integer","format":"int64"},"messageId":{"type":"string","format":"uuid"},"messageType":{"type":"string"},"bi":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"correlationId":{"type":"string","format":"uuid"},"payload":{"type":"object","additionalProperties":{}}}},"EventPage":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/EventItem"}},"nextCursor":{"type":"integer","format":"int64"}}},"CommandView":{"type":"object","properties":{"commandId":{"type":"string","format":"uuid"},"bi":{"type":"string"},"command":{"type":"string"},"status":{"type":"string"},"result":{"type":"string"},"detail":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"extUserId":{"type":"string"}}},"Problem":{"type":"object","description":"RFC 9457 problem body (application/problem+json). Switch on `code`; `detail` is for humans.","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string","description":"Stable error code, e.g. INVALID_FIELD"},"field":{"type":"string","description":"On UNKNOWN_FIELD / INVALID_FIELD: the field. Values are never echoed."},"commandId":{"type":"string","format":"uuid","description":"On COMMAND_IN_FLIGHT: the command in the way, when it is yours."},"retryAfter":{"type":"integer","format":"int32","description":"On UNAVAILABLE: seconds to wait, same as Retry-After."}}},"WebhookEvent":{"type":"object","description":"One event, as GET /v1/events returns it, plus previousEventId.","properties":{"eventId":{"type":"integer","format":"int64"},"messageId":{"type":"string","format":"uuid"},"messageType":{"type":"string"},"bi":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"correlationId":{"type":"string","format":"uuid"},"payload":{"type":"object","additionalProperties":{}},"previousEventId":{"type":"integer","format":"int64","description":"eventId of the delivery before this one (0 for the first). A gap means events were skipped after 5 failed attempts: read them from GET /v1/events?since=previousEventId."}}}},"securitySchemes":{"oauth2":{"type":"oauth2","description":"OAuth2 client_credentials. Send the token as `Authorization: Bearer <access_token>`.","flows":{"clientCredentials":{"tokenUrl":"/v1/oauth/token","scopes":{"systems:read":"List systems and read their status","commands:write":"Control commands (arm, disarm, clear-alarm, bypass, bypass-permanent, unbypass, outputs, service-mode, ping)","commands:maintain":"Maintenance commands (restart, firmware-upgrade, re-pair and the rest)","events:read":"Read the event stream"}}}}}},"webhooks":{"event":{"post":{"summary":"Event delivery to your webhook URL","description":"We POST each of your events to your HTTPS URL, one per request, in eventId order. Answer 2xx within 15 s; anything else, a redirect included, is a failed attempt. Retries after 1 s, 5 s, 30 s, 5 min and 30 min; after that the event is skipped and delivery goes on with the next one (it stays readable from GET /v1/events). Signed per Standard Webhooks (https://www.standardwebhooks.com/), see \"Webhooks\" in the overview.","parameters":[{"name":"webhook-id","in":"header","description":"The event's messageId. Same value on every retry: deduplicate on it.","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","description":"Unix seconds when this attempt was signed. Refuse it if more than 5 min from your clock.","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","description":"`v1,<base64 HMAC-SHA256>` of `webhook-id.webhook-timestamp.body`, keyed with the base64-decoded webhook secret after `whsec_`. Space-separated if there are several.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}},"required":true},"responses":{"2XX":{"description":"Delivered."}}}}}}