---
title: "Telemetry"
method: POST
path: "/api/print/agent/telemetry"
tags: ["print-agent"]
---

# Telemetry

`POST /api/print/agent/telemetry`

## Request

- Base URL: `https://api.pigeonly.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pigeonly.com/api/print/agent/telemetry`
- Auth: none declared

The live SNMP link (Frederick, 2026-09-30): the agent posts one
snapshot per change, plus a heartbeat every ten minutes -- see
`print_agent.py`'s own polling loop. Read-only toward the printer: this
route never sends the agent anything to act on.

⛔AUTH RUNS AS A DEPENDENCY (`_require_agent`), NOT A CALL INSIDE THIS
BODY -- fixed 2026-09-30, main red since #2555/#2584. An anonymous POST
used to answer 422 (missing `body`) before `_agent(conn, authorization)`
ever ran, because FastAPI validates the Pydantic body in the same pass
as an ordinary handler statement only gets to run AFTER -- see
`_require_agent`'s own docstring. The returned `Agent` is unused here
(same as every other print-agent route's own `_agent(...)` call site
that ignores the return past auth, except `claim`/`report`/`heartbeat`,
which read `.name`/`.capabilities` off it) -- this route's whole
contract is the snapshot, never anything scoped by which agent posted
it.

404 for a host `equipment_endpoints` has no row for; 409 when more
than one equipment row claims it (`AmbiguousTelemetryHost` -- refusing
rather than inventing which machine an address belongs to).

⛔ATOMIC, AND ACTS ONLY AFTER COMMIT (Fable's design review of PR
#2555, R16). `ingest_snapshot` itself does around ten writes on this
same connection with no transaction of its own -- wrapping the WHOLE
call here means a failure partway through rolls back cleanly instead
of leaving, say, an issue filed with no matching `machine_telemetry`
row. The Slack DM only fires once that transaction has actually
committed, using the OUTCOME the call returned, never from inside it.

⛔HOT-ROUTES-8 (2026-11-15, lead decision under the owner's 2026-11-11 delegation, lane
cq-press-03): the body runs inside `request_memo.scope()`, so a `system_settings` row this POST
reads twice (the shadow-mode switch, read by `ingest_snapshot` and again below) is asked of the
database once. A settings write forgets the memo (`request_memo.forget`, in `settings_service`), so
a post that changed a setting never reads the old value back. The body itself is `_telemetry_post`,
unchanged. Measured: a steady post ran 41 statements before this change and 37 after (test
`test_a_steady_telemetry_post_asks_the_database_less_real_postgres.py`).

## Headers

- `authorization` string, nullable

## Request body

- TelemetryBody: One SNMP read of one machine (the Ricoh engine or its Fiery controller), from `print_agent.py`'s own SNMP client -- see that module's `snmp_get`/`poll_ricoh` and docs/runbooks/RICOH_LIVE_LINK.md. `host` is the exact ipv4 the agent polled: this is how `equipment.telemetry.ingest_snapshot` resolves WHICH equipment row this is about (`equipment_endpoints`, migration 0412), never a hardcoded machine id the agent would have to know.
  - `host` string, required
  - `reachable` boolean
  - `asleep` boolean
  - `device_status` integer, nullable
  - `printer_status` integer, nullable
  - `error_state_bits` integer, nullable
  - `alerts` TelemetryAlert[]
    - `code` integer, nullable
    - `description` string, nullable
  - `lifetime_pages` integer, nullable
  - `supplies` object
  - `supplies_source` object
  - `guest_supply_capture` object, nullable
  - `serial_number` string, nullable
  - `agent_version` string, nullable
  - `counters` TelemetryCounter[]
    - `name` string, nullable
    - `value` integer, nullable
  - `trays` object[], nullable
  - `display` string, nullable
  - `fiery_jobs` object[], nullable
  - `ipp_state` integer, nullable
  - `ipp_reasons` string[], nullable
  - `printer_mib_absent` boolean

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

## Changes

- **2026-11-13** `8a79cc96bfd9`: 1 info
  - added the new optional request property `guest_supply_capture`
- **2026-11-13** `6c40db4872d4`: 1 info
  - added the new optional request property `supplies_source`
- **2026-11-04** `079ad302143f`: 3 info
  - added the new optional request property `ipp_reasons`
  - added the new optional request property `ipp_state`
  - added the new optional request property `printer_mib_absent`
- **2026-10-30** `cc1ef459fe7d`: 1 info
  - added the new optional request property `asleep`
- **2026-10-17** `c497b46d08d5`: 3 info
  - added the new optional request property `display`
  - added the new optional request property `fiery_jobs`
  - added the new optional request property `trays`

[Operation history](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/changes/api/print/agent/telemetry/post.md)

---

[API](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os.md) - [All operations](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/llms.txt) - [OpenAPI document](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/revisions/14571c4b7007?raw)
