# List agent sessions

`GET /v1/history/sessions`

Lists sessions that changed a workspace, most recent first.

Scope: `docs:read`.

## Request

```bash
curl "https://api.lydie.co/v1/history/sessions" \
  -H "Authorization: Bearer $LYDIE_TOKEN"
```

## Query parameters

- `workspaceId` (string, optional): (1–64 chars)
- `limit` (integer, optional): Default: `50`. (1–200)

## Response

- `sessions` (HistorySession[], required)
  - `sessionId` (string, required)
  - `actor` (Actor, required)
  - `workspaceId` (string, required, nullable): (1–64 chars)
  - `firstAt` (timestamp, required)
  - `lastAt` (timestamp, required)
  - `count` (integer, required)
  - `undoneCount` (integer, required)

```json
{
  "sessions": [
    {
      "sessionId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
      "actor": {
        "type": "user",
        "id": null
      },
      "workspaceId": null,
      "firstAt": "2026-11-12T09:30:00.000Z",
      "lastAt": "2026-11-12T09:30:00.000Z",
      "count": 0,
      "undoneCount": 0
    }
  ]
}
```

Errors use the envelope described at https://developers.lydie.co/errors.md.
