REST API · hw-cloud v1
Cloud API
All workstations of an account from one server: which registers are online, alerts and events, metrics, commands to registers, receipts through the cloud. For integrations, monitoring and an AI assistant (Cloud MCP).
Getting started
- 1Key. hw-connector.ru cabinet → Cloud → API key
hwk_…(shown once): full or read-only — allGET, while register changes, commands, the proxy (exceptGET) and receipts —KEY_READ_ONLY. A key sees only its account's registers: another account's register —DEVICE_NOT_FOUND. Registers join the cloud with an enrollment tokenhwe_…from the same section. - 2Registers.
GET /api/v1/devices— register numbers; the other methods and the agent proxy (X-Device-Id) need them. - 3Format. JSON; dates — ISO 8601; amounts — kopecks. Lists —
limitandoffset, total — in theX-Total-Countheader. Errors — problem+json with acodefield.
curl
curl 'https://cloud.hw-connector.ru/api/v1/summary' -H 'X-Api-Key: hwk_…'
curl 'https://cloud.hw-connector.ru/api/v1/devices?online=false&limit=50' -H 'X-Api-Key: hwk_…'
curl -X PATCH 'https://cloud.hw-connector.ru/api/v1/devices/42' -H 'X-Api-Key: hwk_…' \
-H 'Content-Type: application/json' --data '{"label": "Till 2, foyer"}'Fleet monitoring
GET /api/v1/summary— how many registers are online and disabled, agent versions, open alerts by code, agent requests in the last day.GET /api/v1/alerts— alerts:FN_EXPIRING,OFD_BACKLOG,SHIFT_EXPIRED,REGISTER_UNAVAILABLE,DEVICE_OFFLINE; they open and close by themselves, the cloud also sends them by webhook.GET /api/v1/metrics/latest— one metric across registers:fn.days_left(days to fiscal drive end),ofd.not_sent,shift.open,register.ok.GET /api/v1/events— failed operations, printers, power.GET /api/v1/devices/{id}— everything about a register in one request.
Management
PATCH /api/v1/devices/{id}— own register name (the agent does not overwrite it) and an on/off switch: a disabled register gets no commands, proxy requests or receipts.- Any request to the agent API on a register — the
https://cloud.hw-connector.ru/agent/api/v1/…proxy withX-Device-Id(Agent API → Through the cloud) orPOST /api/v1/devices/{id}/commandsin an envelope. The log —GET /api/v1/requests. - A receipt on an account register with a queue and a webhook —
POST /api/v1/receipts. - The cloud does not pass device setup (
/api/v1/setup): it is done on the register.
Cloud MCP
The same API for an AI assistant: the cloud MCP server https://cloud.hw-connector.ru/mcp with the same key — Claude, Cursor and other MCP clients check the fleet state, investigate alerts and send commands to registers. Connecting and tools — Cloud MCP.
API sections
RegistersAccount registers: list with filters and pages, the register card (metrics, alerts, events), own name and on/off switch, register metrics.MonitoringFleet state: the account summary in one request, alerts (fiscal drive, OFD, shift, register not answering, register gone), register events and the latest metric values across registers.CommandsCommands to registers: a request to the agent API in an envelope and the log of all agent requests.ReceiptsReceipts through the cloud: a site, CRM or bot prints a receipt on an account register; a queue while the register is offline, the result and a webhook, accounting by point.