---
title: "Read the logs of a device"
method: GET
path: "/api/devices/{device_id}/logs"
tags: ["Devices"]
---

# Read the logs of a device

`GET /api/devices/{device_id}/logs`

## Request

- Base URL: `https://trmnl.com`
- URL: `https://trmnl.com/api/devices/{device_id}/logs`
- Auth: HTTP bearer

What the device reported and what rendering for it logged, newest first. before_ts and before_event_id from the last row page further back.

## Path parameters

- `device_id` integer, required

## Query parameters

- `level` string
- `source` string
- `limit` integer
- `before_ts` string
- `before_event_id` string

## Response `200`

Scopes the query to the device within the account

- object
  - `data` object
    - `logs` object[]
    - `more` boolean
    - `oldest_cursor` object, nullable
      - `ts` string
      - `event_id` string

## Other responses

- `401`: Unauthorized
- `404`: Device belongs to another user
- `422`: A level the logs do not have

---

[API](https://skmtc.dev/trmnl/apis/trmnl-api.md) · [All operations](https://skmtc.dev/trmnl/apis/trmnl-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trmnl/apis/trmnl-api/revisions/66179e6d663b?raw)
