# List a document's versions

`GET /v1/documents/{id}/versions`

Lists saved versions of a document's body, newest first.

Scope: `docs:read`.

## Request

```bash
curl "https://api.lydie.co/v1/documents/01JCQ3V5MZ8G4ZK2X7T9R6N1PB/versions" \
  -H "Authorization: Bearer $LYDIE_TOKEN"
```

## Path parameters

- `id` (ULID, required)

## Query parameters

- `limit` (integer, optional): Default: `50`. (1–200)

## Response

- `versions` (DocumentVersion[], required)
  - `id` (string, required)
  - `documentId` (ULID, required)
  - `kind` (string, required): auto: editing went idle. before_write: the state before an API write or restore. restore: the result of a restore. One of: `auto`, `before_write`, `restore`.
  - `authors` (string[], required): Actor refs of whoever changed the body since the previous version.
  - `restoredFrom` (string, required, nullable)
  - `sizeBytes` (integer, required)
  - `createdAt` (string, required)

```json
{
  "versions": [
    {
      "id": "string",
      "documentId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
      "kind": "auto",
      "authors": [
        "string"
      ],
      "restoredFrom": null,
      "sizeBytes": -9007199254740991,
      "createdAt": "string"
    }
  ]
}
```

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