Get run logs

Get persisted log entries for a run, wrapped in the standard list envelope { object: "list", data, hasMore }. Pass ?since=<id> to receive only entries with id > since — the cursor used by the CLI's polling tail to bound per-poll payload growth, and the pagination cursor when combined with ?limit=. Pass ?level= to filter by minimum severity (level=info skips debug breadcrumbs). limit defaults to 1000 when omitted — the response is never unbounded; when more entries follow, hasMore is true and an RFC 5988 Link: <…?since=<lastId>>; rel="next" response header points at the next page. id is a monotonic int64 (one sequence across all runs, so consecutive entries of a run are not contiguous); invalid since/level/limit values fall back to the default rather than 400 so a stale cursor never breaks a polling tail. Rate-limited to 120/min per identity. Note: tool-result payloads inside data are truncated at write time by the runner (default 2048 bytes, operator-tunable via TOOL_RESULT_BYTE_LIMIT) — entries already persisted truncated cannot be recovered by this endpoint.

GET/api/runs/{id}/logs

Authorization

better-auth.session_token<token>

Cookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.

In: cookie

Path Parameters

id*string

Query Parameters

since?integer

Return only log entries with id > since. Used by the CLI's appstrate run remote polling loop to fetch incremental tails without re-shipping the full history each poll, and as the cursor in the Link; rel="next" pagination header.

Formatint64
Range0 <= value
level?string

Minimum severity to include (debug < info < warn < error). level=info returns info, warn and error entries. Defaults to debug (everything).

Value in"debug" | "info" | "warn" | "error"
limit?integer

Maximum number of entries to return. Defaults to 1000 when omitted. When more entries follow, the response carries a Link; rel="next" header whose URL re-uses since as the cursor — page with it to read longer histories.

Default1000
Range1 <= value <= 1000

Header Parameters

X-Org-Id?string

Organization ID. Required for cookie auth. Not needed for API key auth (org resolved from key).

Formatuuid
X-Space-Id?string

Space ID. Required for space-scoped routes (agents, runs, schedules, and space-scoped module routes). Not needed for API key auth (space resolved from key).

curl -X GET "https://your-instance/api/runs/string/logs"
{
  "object": "list",
  "data": [
    {
      "id": 0,
      "runId": "string",
      "orgId": "string",
      "type": "string",
      "level": "debug",
      "event": "string",
      "message": "string",
      "data": {},
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ],
  "hasMore": true
}
{
  "type": "https://docs.appstrate.dev/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Invalid or missing session",
  "code": "unauthorized",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Insufficient permissions",
  "code": "forbidden",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/not-found",
  "title": "Not Found",
  "status": 404,
  "detail": "Resource not found",
  "code": "not_found",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/rate-limited",
  "title": "Rate Limited",
  "status": 429,
  "detail": "Too many requests. Please try again shortly.",
  "code": "rate_limited",
  "request_id": "req_abc123",
  "retry_after": 30
}