GET
/api/devices/{device_id}/logsList logs for a device
Lists logs reported by a device and logs generated while rendering for it, with the newest entries first. Filter by level or source, and use before_ts and before_event_id from the oldest row to retrieve earlier entries.
device_idintegerrequired
The identifier of the device whose logs to retrieve.
levelstringoptional
Filter logs by severity: debug, info, warn, or error.
sourcestringoptional
Filter logs by source: device, plugin, custom_plugin, private_plugin, mashup, or support.
limitintegeroptional
Number of logs to return, from 1 to 100. Defaults to 20 when omitted.
before_tsstringoptional
Timestamp cursor for retrieving logs older than a previous page.
before_event_idstringoptional
Event identifier cursor for retrieving logs older than a previous page.
200Returns an object containing `data.logs`, the `more` indicator for additional results, and an `oldest_cursor` for retrieving earlier entries.
dataobjectoptional
401Returned when the request is unauthorized.
errorstringoptional
404Returned when the device belongs to another user.
422Returned when the requested log level is not present in the device logs.
Error handling
A 401 is returned when the request is unauthenticated. A 404 is returned when the device_id path parameter belongs to another user, and a 422 is returned when the requested level is not present in the logs. limit must be between 1 and 100; use before_ts and before_event_id from the oldest row to page further back.