---
title: "List Agent Logs"
method: GET
path: "/logs"
tags: ["Logs"]
---

# List Agent Logs

`GET /logs`

Query logs for an agent. Requires user authentication.

## Query parameters

- `agent_name` string, required — Name of the agent (format: namespace/name or agent ID)
- `branch_id` string, nullable — Filter by branch/deployment ID
- `task_id` string, nullable — Filter by task ID
- `trace_id` string, nullable — Filter by OTEL trace ID (32 lowercase hex chars)
- `level` 'DEBUG' | 'INFO' | 'WARNING' | 'ERROR' | 'CRITICAL' — Log level for entries.
- `source` 'stdout' | 'stderr' | 'server' — Source of the log entry.
- `since` string, date-time, nullable — Start timestamp filter (ISO 8601)
- `until` string, date-time, nullable — End timestamp filter (ISO 8601)
- `search` string, nullable — Full-text search in message (case-insensitive)
- `after_id` string, nullable — Return logs after this log_id (cursor-based pagination)
- `limit` integer — Maximum number of results
- `offset` integer — Number of results to skip

## Response `200`

Successful Response

- LogListResponse — Response from logs list endpoint.
  - `has_more` boolean, required
  - `logs` LogQueryEntry[], required
    - `agent_id` string, required
    - `environment` string, nullable
    - `level` 'DEBUG' | 'INFO' | 'WARNING' | 'ERROR' | 'CRITICAL', required — Log level for entries.
    - `log_id` string, required
    - `logger` string, nullable
    - `message` string, required
    - `method` string, nullable
    - `source` 'stdout' | 'stderr' | 'server', required — Source of the log entry.
    - `span_id` string, nullable
    - `task_id` string, nullable
    - `timestamp` string, required
    - `trace_id` string, nullable
    - `version` string, nullable
  - `total` integer, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/terminaluse/apis/sb0-api.md) · [All operations](https://skmtc.net/terminaluse/apis/sb0-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/terminaluse/sb0-api/revisions/f24a474dc415/schema)
