Skip to content

Open a live log session​

POST
/devices/{device-id}/log-sessions

Streams the device's log files over MQTT through its Pantahub
credential: the Hub opens a session for a revision (current by
default) and up to 10 sources ("" is the whole revision, a
directory everything under it), with up to 500 tail lines. An
optional filter (plain text, at most 256 bytes of UTF-8 without control
characters) keeps only the lines that contain it, case-insensitively:
the device applies it before anything goes on the network, and the
tail counts matching lines; a change of filter is a new session. Requires
device update permission. The session expires after a minute unless
renewed; the credential needs the Pantahub devices.logs scope or full
API access. Long-poll the batches from .../log-sessions/{session-id}/lines.

Authorizations​

Parameters​

Path Parameters

device-id*

device id

Type
string
Required

Request Body​

application/json
JSON
{
  
"filter": "error",
  
"follow": true,
  
"rev": "current",
  
"sources": [
  
  
"string"
  
],
  
"tail": 0
}

Responses​

Session, expires in a minute unless renewed

application/json
JSON
{
  
"created_at": "string",
  
"created_by": "string",
  
"deadline": "string",
  
"device_id": "string",
  
"ended": true,
  
"ended_at": "string",
  
"expires_at": "string",
  
"filter": "string",
  
"follow": true,
  
"id": "string",
  
"reason": "string",
  
"rev": "string",
  
"sources": [
  
  
"string"
  
],
  
"tail": 0
}

Playground​

Variables
Key
Value
Body

Samples​

Powered by VitePress OpenAPI