---
title: "Logs"
description: "REST endpoints for logs. Bearer-auth required."
section: "API"
group: "REST"
order: 43
---

## GET /api/logs

List logs.

**Query parameters**

- `limit` (optional): Page size (1–100, default 100).
- `after` (optional): Keyset cursor — return the page after this row (next page).
- `before` (optional): Keyset cursor — return the page before this row (prev page).
- `ids` (optional): Comma-separated list of IDs. Narrows results to these IDs within the caller's accessible scope (does not bypass access checks).
- `filter` (optional): Nested filter expression (`<Entity>Filter`): AND/OR/NOT + per-field comparison operators + relation traversal. JSON-encoded on the query string.
- `orderBy` (optional): Multi-key sort (`<Entity>OrderBy[]`): array of `{ field: direction }` applied in order. Directions: asc/desc plus the four explicit nulls variants. JSON-encoded on the query string.
- `workspace_id` (optional): Filter logs to this workspace.
- `subject_id` (optional): Filter to logs attached to this subject entity ID.
- `level` (optional): Filter by log severity level.
- `source` (optional): Filter by log source (e.g. 'api', 'runner', 'email').

**Response**

```json
{
  "data": [
    {
      "id": "<...>",
      "workspaceId": "<...>",
      "subjectId": "<...>",
      "level": "<...>",
      "source": "<...>",
      "message": "<...>",
      "data?": "<...>",
      "createdAt": "<...>"
    }
  ],
  "pageInfo": {
    "total": "number",
    "hasNextPage": "boolean",
    "hasPreviousPage": "boolean",
    "startCursor": "string",
    "endCursor": "string"
  }
}
```

## GET /api/logs/{id}

Get a log entry by ID.

**Path parameters**

- `id` (required): Log entry to retrieve.

**Response**

```json
{
  "id": "string",
  "workspaceId": "string",
  "subjectId": "string",
  "level": "debug | info | warn | error",
  "source": "string",
  "message": "string",
  "data?": "any",
  "createdAt": "string"
}
```
