## The audit trail of a document (tenant:dms:read)

`GET /api/dms/v1/documents/{id}/audit`

Module: DMS · operationId: `getDocumentAudit` · Tag: Compliance · Auth: access token (`Authorization: Bearer <accessToken>`)

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string (uuid) | yes |  |

### Responses

- **200** Audit entries, oldest first (`application/json`)
- **404** Error (`application/json`)

Fields of the 200 answer:

- `items` (array of AuditEntry, required): The audit entries of the document
  - `action` (string, required): What happened (one of `CREATE`, `VIEW`, `DOWNLOAD`, `LINK`, `UNLINK`, `VERSION`, `LOCK`, `LEGAL_HOLD`, `LEGAL_HOLD_RELEASED`, `DELETE`, `PURGE`, `EXPORT`, `VERIFY`, `KEY`, `EXTRACT`, `SCAN_INFECTED`, `FOLDER`, `FOLDER_CREATE`, `FOLDER_UPDATE`, `FOLDER_DELETE`, `FOLDER_ACCESS`)
  - `actor` (string, required): Who did it
  - `clientIp` (string, required): IP address of the caller
  - `createdAt` (string (date-time), required): Time of the entry
  - `customerNo` (string, required): Customer number of the tenant
  - `details` (string, required): JSON text with action details
  - `entryHash` (string, required): SHA-256 over prevHash and the fields of this entry (hash chain)
  - `id` (integer (int64), required): Entry id
  - `prevHash` (string, required): entryHash of the previous entry of the tenant
  - `tenantName` (string, required): Tenant name
  - `documentId` (string (uuid)): The document the entry is about, if any
- `total` (integer, required): Number of entries

Example 200 answer:

```json
{
  "items": [
    {
      "action": "CREATE",
      "actor": "christina.adler@muster-it.example",
      "clientIp": "203.0.113.17",
      "createdAt": "2026-09-30T08:40:12Z",
      "customerNo": "99999",
      "details": "{\"fileName\":\"RE-482117.pdf\",\"version\":1}",
      "documentId": "3f6c2a1e-8b4d-4c7a-9e21-5d0b7a9c1f42",
      "entryHash": "3c7a1e9f5b2d8c4e0a6f1b7d3e9c5a2f8b4d0e6c1a7f3b9d5e2c8a4f0b6d1e9c",
      "id": 18001,
      "prevHash": "0a4e8c2f6b1d9e3a7c5f0b8d4e2a6c1f9d7b3e5a0c8f2d6b4e1a9c7f3d5b0e8a",
      "tenantName": "DEMO"
    },
    {
      "action": "DOWNLOAD",
      "actor": "laura.kaestner@muster-it.example",
      "clientIp": "203.0.113.24",
      "createdAt": "2026-10-02T13:15:40Z",
      "customerNo": "99999",
      "details": "{\"version\":1}",
      "documentId": "3f6c2a1e-8b4d-4c7a-9e21-5d0b7a9c1f42",
      "entryHash": "9e5b1d7a3f0c6e2b8d4a1f7c3e9b5d0a6c2f8e4b1d7a3c9f5e0b6d2a8c4f1e7b",
      "id": 18044,
      "prevHash": "3c7a1e9f5b2d8c4e0a6f1b7d3e9c5a2f8b4d0e6c1a7f3b9d5e2c8a4f0b6d1e9c",
      "tenantName": "DEMO"
    }
  ],
  "total": 2
}
```

### Example request

```bash
curl -X GET 'https://api.mbcom.cloud/api/dms/v1/documents/3f2b8c1e-7d4a-4e9b-9c2a-5b1d6e8f0a12/audit' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
