## The folder tree with document counts (tenant:dms:read)

`GET /api/dms/v1/folders`

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

All folders of the tenant, flat (build the tree with `parentId`), ordered by name, with the documents directly in each folder; plus the documents without a folder and in total.

### Responses

- **200** Folders (`application/json`)

Fields of the 200 answer:

- `items` (array of Folder, required): Every folder of the tenant the caller may see (not paged)
  - `access` (string, required): What the caller may do in the folder (one of `READ`, `WRITE`)
  - `createdAt` (string (date-time), required): Creation time
  - `createdBy` (string, required): Who created the folder
  - `documentCount` (integer, required): Documents directly in the folder (not in subfolders)
  - `id` (string (uuid), required): Folder id
  - `name` (string, required): Folder name, unique among its siblings (max length 255)
  - `parentId` (string (uuid), nullable, required): `null` for a top-level folder
  - `restricted` (boolean, required): The folder or a folder above it limits who may use it
  - `updatedAt` (string (date-time), required): Time of the last change
  - `version` (integer, required): Increases with every change; send it with `updateFolder`
- `totalCount` (integer, required): All documents
- `unfiledCount` (integer, required): Documents without a folder

Example 200 answer:

```json
{
  "items": [
    {
      "access": "WRITE",
      "createdAt": "2026-01-02T08:00:00Z",
      "createdBy": "laura.kaestner@muster-it.example",
      "documentCount": 0,
      "id": "1d3f5a7c-9e1b-4d3f-8a5c-7e9b1d3f5a7c",
      "name": "Buchhaltung",
      "parentId": null,
      "restricted": true,
      "updatedAt": "2026-01-02T08:00:00Z",
      "version": 1
    },
    {
      "access": "WRITE",
      "createdAt": "2026-01-02T08:00:00Z",
      "createdBy": "laura.kaestner@muster-it.example",
      "documentCount": 42,
      "id": "3b1f6a2c-7d4e-4f1a-9c2b-8e5d0a1f7b63",
      "name": "Eingangsrechnungen 2026",
      "parentId": "1d3f5a7c-9e1b-4d3f-8a5c-7e9b1d3f5a7c",
      "restricted": true,
      "updatedAt": "2026-06-15T10:12:00Z",
      "version": 3
    }
  ],
  "totalCount": 128,
  "unfiledCount": 7
}
```

### Example request

```bash
curl -X GET 'https://api.mbcom.cloud/api/dms/v1/folders' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
