# `POST /vfs/mkdir` Protected. Requires a valid session cookie (`credentials: 'include'`). Create directory in virtual filesystem Creates a directory (and any necessary parent directories) in the virtual filesystem for the authenticated user's selected company. ## Body (JSON) | Field | Required | Type | Description | |-------|----------|------|-------------| | `path` | yes | string | Directory path to create (e.g. `reports/2026/q1`) | ```json { "path": "…" } ``` ## Signals On success, emits SSE signal: `vfs` (see [`GET /events`](../events.md)). ## Response `200` Directory created successfully ```json { "success": true, "dir": "…" } ``` ## Errors | Status | Description | |--------|-------------| | 400 | Path is required, invalid characters, traversal, or no company selected — `{"error":"…"}` | | 401 | Unauthorized — `{"error":"…"}` | | 403 | Not authorized, or cannot create directory inside read-only database paths — `{"error":"…"}` | --- _Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._