# History

Sessions group the changes an agent made, so they can be reviewed and undone together.

## Endpoints

- [List agent sessions](https://developers.lydie.co/api/history/list-agent-sessions.md): `GET /v1/history/sessions`
- [List a session's changes](https://developers.lydie.co/api/history/list-a-sessions-changes.md): `GET /v1/history/sessions/{sessionId}`
- [Undo a session](https://developers.lydie.co/api/history/undo-a-session.md): `POST /v1/history/sessions/{sessionId}/undo`

## The HistorySession object

- `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
{
  "sessionId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
  "actor": {
    "type": "user",
    "id": "string"
  },
  "workspaceId": null,
  "firstAt": "2026-11-12T09:30:00.000Z",
  "lastAt": "2026-11-12T09:30:00.000Z",
  "count": 0,
  "undoneCount": 0
}
```
