Return the latest cached printer status
const url = 'https://example.com/api/v1/printers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/status';const options = {method: 'GET', headers: {'X-Label-Hub-Key': '<X-Label-Hub-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/v1/printers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/status \ --header 'X-Label-Hub-Key: <X-Label-Hub-Key>'Returns the most recent status written by the background probe worker (SNMP for tape printers, IPP for page printers; page printers add kind, printer_state, reasons, markers, trays and jobs_ahead). The response is served from printer_status_cache. When no probe has completed yet online is null and note explains why. Reads the hub’s cache only; never contacts the printer. Returns 404 when the printer is not registered.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”Successful Response
Printer status sourced from the printer_status_cache table.
The endpoint reads the cache row written by StatusProbeProducer instead of doing a synchronous SNMP probe inline. This makes the response fast (<10 ms) even when the printer is offline.
tape_loaded is a human-readable string such as
"12mm laminated black/clear" or None when no tape is inserted.
error_state mirrors the active PrinterError flags as a string, or
None when the printer is ready.
captured_at is the UTC timestamp of the probe that last updated the
cache row. None means no probe has completed yet. For a page printer
(kind="page") that went offline it stays the time of the last
successful reading; online and last_error tell that it is stale.
last_probe_age_s is the age of the cached reading in seconds (for an
offline page printer: since its last successful reading).
last_error is the exception message from the most recent failed probe.
note carries a human-readable hint (e.g. “No probe yet”).
polled is False when no status producer runs for the printer (SNMP discovery
off, printer disabled or not wired). stale is True when the last probe attempt
(printer_status_cache.updated_at) is older than
max(90, 3 * probe interval, 2 * max backoff) seconds (an IPP printer that stopped answering
is probed with a backoff of up to 300 s, so its bound is 600 s),
or implausibly in the future. For an unpolled or stale printer online is
None and the cached values (tape, error state, markers, trays) are not returned;
captured_at and last_probe_age_s stay so a client can show how old the last
reading is.
object
True while the device behind the printer’s address differs from the one the hub stored (a swapped printer). Sheet and calibration jobs are held meanwhile. Only the flag is returned here; the identity values are for admins.
One supply (toner, ink, waste container) of a page printer.
False when no status producer runs for this printer
True when the roll changed and the operator is still to be asked for the tape colour (PUT /printers/{id}/roll); False for an unpolled or stale printer
True when the last probe attempt is older than the staleness bound
One printer-state-reasons keyword of a page printer (severity suffix removed).
object
A configured tray of a page printer plus what the printer reports as loaded in it.
Example
{ "identity_mismatch": false, "kind": "tape", "polled": true, "printer_state": "idle", "roll_prompt": false, "stale": false, "state_reasons": [ { "severity": "report" } ], "tape_colour": "white"}The printer is not registered.
The error body the routes actually send: FastAPI’s {"detail": "<text>"}.
Routes raise HTTPException(status, detail="<text>"); this is the model that describes
that body in OpenAPI. It is not :class:ProblemDetail, which no route sends.
object
Human-readable explanation of the error
Example generated
{ "detail": "example"}Validation Error
object
object
object
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}