{
    "openapi": "3.1.0",
    "info": {
        "title": "FlowDrive API",
        "version": "v1",
        "description": "REST API for the file storage: read, create, move, copy and delete folders, files and external links, uploads through presigned addresses, time-limited download links and public sharing."
    },
    "servers": [
        {
            "url": "https://api.flowsuite.one",
            "description": "FlowSuite API"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "context",
            "description": "Overview"
        },
        {
            "name": "entries-read",
            "description": "Reading entries"
        },
        {
            "name": "entries-write",
            "description": "Creating and changing entries"
        },
        {
            "name": "entries-trash",
            "description": "Trash"
        },
        {
            "name": "versions-favorites",
            "description": "Versions, favorites and recently used"
        },
        {
            "name": "share-links",
            "description": "Share links"
        },
        {
            "name": "personal-shares",
            "description": "Personal shares"
        },
        {
            "name": "flowai-documents",
            "description": "FlowAI documents"
        },
        {
            "name": "shared-drives",
            "description": "Shared drives"
        },
        {
            "name": "reports",
            "description": "Reports"
        }
    ],
    "paths": {
        "/flowdrive/context": {
            "get": {
                "operationId": "flowdrive-context",
                "summary": "Get areas, shared drives and limits",
                "description": "Returns the addressable areas (personal, shared_drive, client, project, contact), all shared drives with your own permission level, the team's storage in use and the upload limits. Every file extension is accepted (allowed_extensions is null); inline_extensions lists the extensions that are shown directly in the browser, all others are delivered as a download.",
                "tags": [
                    "context"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "scopes": [
                                            "personal",
                                            "shared_drive",
                                            "client",
                                            "project",
                                            "contact"
                                        ],
                                        "shared_drives": [
                                            {
                                                "uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                                "name": "Vertrieb",
                                                "level": "manage"
                                            }
                                        ],
                                        "storage": {
                                            "total": 184320917,
                                            "shared_drives": 120000000,
                                            "crm": 40000000,
                                            "files": 812
                                        },
                                        "limits": {
                                            "direct_upload_max_bytes": 26214400,
                                            "presigned_upload_max_bytes": 1073741824,
                                            "allowed_extensions": null,
                                            "inline_extensions": [
                                                "pdf",
                                                "jpg",
                                                "png",
                                                "mp4",
                                                "txt"
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/areas": {
            "get": {
                "operationId": "flowdrive-areas",
                "summary": "Get areas for apps",
                "description": "The roots an app shows: My FlowDrive (private), the shared team drive (team), every shared drive with access (drive:{uuid}) with your own level, and the FlowCRM area (crm). entry_count counts the top-level entries, for crm the containers. The key value is passed as area to GET /flowdrive/entries.",
                "tags": [
                    "context"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "key": "private",
                                            "kind": "private",
                                            "uuid": null,
                                            "name": "Mein FlowDrive",
                                            "level": "manage",
                                            "entry_count": 12
                                        },
                                        {
                                            "key": "team",
                                            "kind": "team",
                                            "uuid": null,
                                            "name": "Geteilter FlowDrive",
                                            "level": "manage",
                                            "entry_count": 4
                                        },
                                        {
                                            "key": "drive:9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                            "kind": "drive",
                                            "uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                            "name": "Vertrieb",
                                            "level": "edit",
                                            "entry_count": 7
                                        },
                                        {
                                            "key": "crm",
                                            "kind": "crm",
                                            "uuid": null,
                                            "name": "FlowCRM",
                                            "level": "manage",
                                            "entry_count": 3
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/changes": {
            "get": {
                "operationId": "flowdrive-changes",
                "summary": "Sync changes",
                "description": "Change feed for syncing apps. Without cursor it starts with a full enumeration of all visible entries (full_sync: true), after that it returns only changes: upserts are new or changed entries, deletions name entries in the trash (trashed), permanently deleted ones (purged) and ones moved to another team (moved). Pass meta.next_cursor with the next call; as long as meta.has_more is true, keep reading right away. The feed runs a few seconds behind real time. An upsert does not necessarily mean new content: only a changed content_token shows that the bytes of a file have changed. reset_required: true means the cursor was invalid or older than 30 days and the enumeration starts over. accessible_drive_uuids lists the shared drives the caller currently has access to; entries of other drives should be removed. With include_managed=1 the feed also contains the team's FlowSend system folder (parent_uuid null, area team) and the media in it (parent_uuid = uuid of the folder), each with managed_by flowsend and read-only, for every team member; moving them to the trash and deleting them permanently appear as deletions. The setting belongs to the cursor: a cursor read with the other setting responds with reset_required: true and a new enumeration.",
                "tags": [
                    "context"
                ],
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor from meta.next_cursor of the last response.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum per list, 1 to 500, default 200.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "include_managed",
                        "in": "query",
                        "required": false,
                        "description": "1 adds the team's FlowSend system folder and its media to the feed (managed_by flowsend, read-only). Without the parameter or with 0, the feed stays unchanged. Allowed values are 1 and 0, other values respond with HTTP 422. Changing the setting with an existing cursor responds with reset_required: true.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "full_sync": false,
                                        "reset_required": false,
                                        "upserts": [
                                            {
                                                "uuid": "3c5b0a11-...",
                                                "name": "Angebot.pdf",
                                                "kind": "file",
                                                "parent_uuid": "7e1a9c33-...",
                                                "area": "team",
                                                "etag": "5f1c...",
                                                "content_token": "a94a8fe5..."
                                            }
                                        ],
                                        "deletions": [
                                            {
                                                "uuid": "b81e0f2a-...",
                                                "reason": "trashed"
                                            }
                                        ],
                                        "accessible_drive_uuids": [
                                            "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f"
                                        ]
                                    },
                                    "meta": {
                                        "next_cursor": "eyJwIjoiZCIsInQiOjE3...",
                                        "has_more": false,
                                        "server_time": "2026-11-22T10:15:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries": {
            "get": {
                "operationId": "flowdrive-entries-index",
                "summary": "List or search entries",
                "description": "Lists folders, files and external links. Visible are your own private entries, the entries of the shared team drive, entries on clients, projects and visible contacts, and the contents of the shared drives you have access to. Folders come before files, then the list is sorted by sort. Every entry also carries area, etag, thumbnail_status, thumbnail_url (short-lived preview address or null) and level, can_edit, can_share, can_delete and can_download for the caller, plus is_favorite, version_count and content_token. content_token is a content revision of files: the value changes only when the file content changes (replacing, restoring a version, a newly generated CRM document), not when renaming, moving, on a new preview or when FlowDrive analyses the content in the background. Unlike etag it is therefore suited to decide whether a cached file has to be downloaded again. Folders and external links carry null. managed_by names the module that manages an entry: flowsend for the FlowSend system folder and its media, otherwise null. Such entries are read-only (can_edit, can_share and can_delete are false); renaming, deleting, sharing as well as creating, uploading and copying into the FlowSend folder respond with HTTP 403 and error managed_read_only. With parent_uuid of the FlowSend folder (uuid from the managed block), the list returns its media, for every team member; they can be retrieved through download-url like any file.",
                "tags": [
                    "entries-read"
                ],
                "parameters": [
                    {
                        "name": "scope",
                        "in": "query",
                        "required": false,
                        "description": "personal, shared_drive, client, project or contact. Without a value, all visible areas are read.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "scope_uuid",
                        "in": "query",
                        "required": false,
                        "description": "UUID of the shared drive, client, project or contact. Required for every area except personal.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "parent_uuid",
                        "in": "query",
                        "required": false,
                        "description": "UUID of the folder whose content is listed. Without a value, the top level is returned.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Searches the whole area for parts of names and ignores parent_uuid. Searching the Shared FlowDrive (area=team) and searching without area and scope also find the team's FlowSend system folder and its media (managed_by flowsend, read-only).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "area",
                        "in": "query",
                        "required": false,
                        "description": "Alternative to scope: private, team, crm or drive:{uuid} (see GET /flowdrive/areas). area=crm without parent_uuid and search returns the clients, projects and contacts with files as containers (kind crm_client, crm_project, crm_contact); their content is read through scope=client|project|contact. Like any other list, the containers can be fetched page by page through page and per_page (fixed order: clients, projects, contacts, each by name) and carry the same meta with current_page, per_page, total and last_page.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "include_managed",
                        "in": "query",
                        "required": false,
                        "description": "Only with area=team: 1 adds, on page 1 of the top level (without parent_uuid, without search, kind empty or folder), the key managed with the module-managed folders as in the web app: FlowCRM (uuid null if clients, projects or contacts with visible files exist; content through area=crm&crm_node=root), FlowAI (uuid null if FlowAI has created documents for the caller; content through GET /flowdrive/flowai/artifacts) and FlowSend (uuid of the system folder as soon as the team has one; content through parent_uuid). Each entry: key, managed_by, name, uuid, entry_count. Without the parameter the response stays unchanged. Allowed values are 1 and 0, other values respond with HTTP 422.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "crm_node",
                        "in": "query",
                        "required": false,
                        "description": "Only with area=crm, never with parent_uuid or search: one level of the nested FlowCRM tree as in the web app, in the container format of area=crm and paginated. root returns the clients (entry_count = own entries plus project containers) followed by a container of kind crm_contacts (uuid null, entry_count = number of contacts with files), contacts the contact containers (crm_contact), client:{uuid} the project containers (crm_project) of that client (HTTP 404 for a client of another team). The files of a client, project or contact are still read through scope=client|project|contact with scope_uuid. area=crm without crm_node stays the existing flat list.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "kind",
                        "in": "query",
                        "required": false,
                        "description": "Limit to folder, file or link.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "name (default), size, created_at, updated_at or type. Folders always come first.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "required": false,
                        "description": "asc (default) or desc.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Entries per page, 1 to 200, default 50.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, default 1.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "3c5b0a11-2d44-4f6e-9a77-88cc1d2e3f40",
                                            "name": "Angebote",
                                            "kind": "folder",
                                            "scope": "team",
                                            "size": null,
                                            "mime_type": null,
                                            "parent_uuid": null,
                                            "shared_drive_uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                            "trashed": false,
                                            "area": "drive",
                                            "etag": "5f1c...",
                                            "thumbnail_status": null,
                                            "thumbnail_url": null,
                                            "level": "edit",
                                            "can_edit": true,
                                            "can_share": false,
                                            "can_delete": false,
                                            "can_download": false,
                                            "content_token": null,
                                            "managed_by": null
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 50,
                                        "total": 1,
                                        "last_page": 1
                                    },
                                    "managed": [
                                        {
                                            "key": "flowcrm",
                                            "managed_by": "flowcrm",
                                            "name": "FlowCRM",
                                            "uuid": null,
                                            "entry_count": 3
                                        },
                                        {
                                            "key": "flowai",
                                            "managed_by": "flowai",
                                            "name": "FlowAI",
                                            "uuid": null,
                                            "entry_count": 2
                                        },
                                        {
                                            "key": "flowsend",
                                            "managed_by": "flowsend",
                                            "name": "FlowSend",
                                            "uuid": "5a0e8c71-1f2b-4c3d-9e4f-6a7b8c9d0e1f",
                                            "entry_count": 14
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowdrive-entries-store",
                "summary": "Upload a file directly",
                "description": "Multipart upload for small files. The limit is given in \"limits.direct_upload_max_bytes\" in the overview (25 MB by default) and is well below the limit of the presigned route, because these bytes pass through the application. Larger files go through the upload address and confirmation.",
                "tags": [
                    "entries-write"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3c5b0a11-...",
                                        "name": "Angebot.pdf",
                                        "kind": "file",
                                        "size": 284410,
                                        "mime_type": "application/pdf"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "The file itself. Every file extension is accepted."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Free text, at most 2000 characters."
                                    },
                                    "parent_uuid": {
                                        "type": "string",
                                        "description": "UUID of the target folder."
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "UUID of the client."
                                    },
                                    "project_uuid": {
                                        "type": "string",
                                        "description": "UUID of the project."
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "UUID of the contact."
                                    },
                                    "shared_drive_uuid": {
                                        "type": "string",
                                        "description": "UUID of the shared drive."
                                    },
                                    "target_root": {
                                        "type": "string",
                                        "description": "private (My FlowDrive) or team (root of the shared team drive, writable for every team member). Only without parent_uuid and without a reference UUID."
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/{uuid}": {
            "get": {
                "operationId": "flowdrive-entries-show",
                "summary": "Get a single entry",
                "description": "Returns an entry together with its path from the top folder of its area down to the entry itself. A UUID from another team is answered like an unknown UUID with HTTP 404.",
                "tags": [
                    "entries-read"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3c5b0a11-...",
                                        "name": "Angebot Muster GmbH.pdf",
                                        "kind": "file",
                                        "size": 284410,
                                        "size_human": "277,7 KB",
                                        "mime_type": "application/pdf",
                                        "parent_uuid": "7e1a9c33-...",
                                        "trashed": false
                                    },
                                    "breadcrumbs": [
                                        {
                                            "uuid": "7e1a9c33-...",
                                            "name": "Angebote",
                                            "kind": "folder"
                                        },
                                        {
                                            "uuid": "3c5b0a11-...",
                                            "name": "Angebot Muster GmbH.pdf",
                                            "kind": "file"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "flowdrive-entries-update",
                "summary": "Rename an entry",
                "description": "Changes name and description. Changing the location is a separate action. If the new name collides at the same location, a counter is appended. Requires the edit level.",
                "tags": [
                    "entries-write"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3c5b0a11-...",
                                        "name": "Angebot final.pdf",
                                        "kind": "file"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "New name, at most 240 characters."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "New free text, at most 2000 characters."
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowdrive-entries-destroy",
                "summary": "Move an entry to the trash",
                "description": "Moves an entry and everything below it to the trash. Requires the manage level. System folders and entries still used in a newsletter are rejected.",
                "tags": [
                    "entries-trash"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "In den Papierkorb verschoben."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/{uuid}/content": {
            "get": {
                "operationId": "flowdrive-entries-content",
                "summary": "Get the extracted text of a file",
                "description": "Returns the already indexed text of a file, the same text the AI tools read. Nothing is extracted again: if the file has not been indexed yet, \"indexed\" is false and \"text\" is empty. For folders the route responds with HTTP 422.",
                "tags": [
                    "entries-read"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3c5b0a11-...",
                                        "name": "Angebot Muster GmbH.pdf",
                                        "mime_type": "application/pdf",
                                        "indexed": true,
                                        "text": "Angebot Nr. 2026-0184 ..."
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/{uuid}/download-url": {
            "get": {
                "operationId": "flowdrive-entries-download-url",
                "summary": "Create a time-limited download link",
                "description": "Creates a presigned address pointing directly at the stored bytes. The validity is given in \"expires_at\". File types a browser can execute (svg, html, xml) are always delivered as a download through signed headers and never displayed inline. For an external link, its target address is returned with \"expires_at\": null.",
                "tags": [
                    "entries-read"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "url": "https://s3.example.com/team-1/drives/...?X-Amz-Signature=...",
                                        "expires_at": "2026-09-21T15:30:00+00:00",
                                        "kind": "file"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/{uuid}/download": {
            "get": {
                "operationId": "flowdrive-entries-download",
                "summary": "Download a file directly",
                "description": "Returns the file for download. If it is in object storage, the route responds with a redirect (HTTP 302) to the presigned address so that the bytes do not pass through the application; follow this redirect. For folders and external links the route responds with HTTP 422.",
                "tags": [
                    "entries-read"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/folders": {
            "post": {
                "operationId": "flowdrive-folders-store",
                "summary": "Create a folder",
                "description": "Creates a folder. If the name already exists at the target, a counter is appended automatically. The name is limited to 240 characters so that this counter and umlauts still fit.",
                "tags": [
                    "entries-write"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "7e1a9c33-...",
                                        "name": "Angebote",
                                        "kind": "folder",
                                        "scope": "team",
                                        "parent_uuid": null
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the folder, at most 240 characters."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Free text, at most 2000 characters."
                                    },
                                    "parent_uuid": {
                                        "type": "string",
                                        "description": "UUID of the parent folder."
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "UUID of the client the folder belongs to."
                                    },
                                    "project_uuid": {
                                        "type": "string",
                                        "description": "UUID of the project the folder belongs to."
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "UUID of the contact the folder belongs to."
                                    },
                                    "shared_drive_uuid": {
                                        "type": "string",
                                        "description": "UUID of the shared drive. Requires at least the edit level."
                                    },
                                    "target_root": {
                                        "type": "string",
                                        "description": "private (My FlowDrive) or team (root of the shared team drive, writable for every team member). Only without parent_uuid and without a reference UUID."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/external-links": {
            "post": {
                "operationId": "flowdrive-external-links-store",
                "summary": "Create an external link",
                "description": "Creates a link to an outside address. Only http and https addresses are allowed; anything else is rejected with HTTP 422.",
                "tags": [
                    "entries-write"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "5b7c1d20-...",
                                        "name": "Preisliste 2026",
                                        "kind": "link",
                                        "external_url": "https://example.com/preise"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Display name, at most 240 characters."
                                    },
                                    "url": {
                                        "type": "string",
                                        "description": "Target address, only http or https, at most 2048 characters."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Free text, at most 2000 characters."
                                    },
                                    "parent_uuid": {
                                        "type": "string",
                                        "description": "UUID of the parent folder."
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "UUID of the client."
                                    },
                                    "project_uuid": {
                                        "type": "string",
                                        "description": "UUID of the project."
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "UUID of the contact."
                                    },
                                    "shared_drive_uuid": {
                                        "type": "string",
                                        "description": "UUID of the shared drive."
                                    },
                                    "target_root": {
                                        "type": "string",
                                        "description": "private (My FlowDrive) or team (root of the shared team drive, writable for every team member). Only without parent_uuid and without a reference UUID."
                                    }
                                },
                                "required": [
                                    "name",
                                    "url"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/upload-url": {
            "post": {
                "operationId": "flowdrive-entries-upload-url",
                "summary": "Request an upload address",
                "description": "Step one of the presigned upload. Returns an address to which the file is sent with HTTP PUT; the bytes never pass through the application. The size is checked before an address is issued (by default at most 1 GB per file); every file extension is accepted. The stored content type is derived from the file name on the server; a \"mime_type\" you pass is deliberately not used for that.",
                "tags": [
                    "entries-write"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "put_url": "https://s3.example.com/team-1/drives/...?X-Amz-Signature=...",
                                        "put_headers": {
                                            "Content-Type": "application/pdf"
                                        },
                                        "s3_key": "team-1/drives/0f9a...pdf",
                                        "expires_at": "2026-09-21T15:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "File name with extension, at most 240 characters."
                                    },
                                    "size": {
                                        "type": "integer",
                                        "description": "Size in bytes."
                                    },
                                    "mime_type": {
                                        "type": "string",
                                        "description": "Informational only; the stored content type is derived from the file extension."
                                    },
                                    "parent_uuid": {
                                        "type": "string",
                                        "description": "UUID of the target folder. Checked already at this step."
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "UUID of the client."
                                    },
                                    "project_uuid": {
                                        "type": "string",
                                        "description": "UUID of the project."
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "UUID of the contact."
                                    },
                                    "shared_drive_uuid": {
                                        "type": "string",
                                        "description": "UUID of the shared drive."
                                    },
                                    "target_root": {
                                        "type": "string",
                                        "description": "private (My FlowDrive) or team (root of the shared team drive, writable for every team member). Only without parent_uuid and without a reference UUID."
                                    }
                                },
                                "required": [
                                    "name",
                                    "size"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/confirm": {
            "post": {
                "operationId": "flowdrive-entries-confirm",
                "summary": "Confirm an upload",
                "description": "Step two of the presigned upload. The key must belong to your own team, the object must already be in storage, and the actual length in storage takes precedence over the reported size. A key that has already been confirmed returns the existing entry instead of a second one. on_conflict controls a file with the same name at the target: keep_both (default) creates \"Name (1).ext\", replace replaces the content of the file from replace_uuid (response 200 with replaced: true), skip creates nothing and discards the object (200 with skipped: true), ask responds with HTTP 409 error name_conflict together with existing and can_replace; object and key are then kept and can be confirmed again. With ask this also applies when another writer (the web app, FlowAI, a copy) creates the same name at the same time: the check is repeated right before the entry is created instead of silently assigning \"Name (1).ext\". Errors with replace (all in the flat format {\"success\": false, \"error\": \"\", \"message\": \"...\"}; the object is kept in each case so that the same key can be confirmed with keep_both): HTTP 403 forbidden if the edit level is missing, also if it was revoked between the check and locking the target file; HTTP 422 replace_target_mismatch if replace_uuid is not the file with the same name and extension at the target, or if the target file was moved, renamed or reassigned between the check and the lock; HTTP 422 replace_target_missing if the target file was deleted or moved to the trash in that time or is no longer a plain file; HTTP 409 replace_target_changed if expected_content_token was sent and the target file now has different content (someone else replaced it or restored a version). With expected_content_token the replacement becomes conditional: the comparison runs under the row lock of the target file, so an intermediate change is never overwritten silently, and the object can be confirmed as a conflict copy with keep_both. Without the parameter, replace keeps replacing unconditionally; repeating the same confirmation after success has no effect. Other errors: HTTP 422 invalid_key (key does not belong to the team), object_missing (object is not in storage), file_too_large, upload_rejected (type or content rejected); HTTP 409 upload_trashed (confirmed entry is in the trash).",
                "tags": [
                    "entries-write"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3c5b0a11-...",
                                        "name": "Angebot.pdf",
                                        "kind": "file",
                                        "size": 284410
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "s3_key": {
                                        "type": "string",
                                        "description": "The key from the response of the upload address."
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Displayed file name, at most 240 characters."
                                    },
                                    "size": {
                                        "type": "integer",
                                        "description": "Informational only; the length in storage is what counts."
                                    },
                                    "mime_type": {
                                        "type": "string",
                                        "description": "Informational only; the type is derived from the file extension."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Free text, at most 2000 characters."
                                    },
                                    "on_conflict": {
                                        "type": "string",
                                        "description": "keep_both (default), replace, skip or ask."
                                    },
                                    "replace_uuid": {
                                        "type": "string",
                                        "description": "Required with replace: UUID of the file with the same name and extension at the target; requires the edit level."
                                    },
                                    "expected_content_token": {
                                        "type": "string",
                                        "description": "Only with replace: content_token of the target file your change is based on (40 hex characters). Replaces only as long as the file still has this content, otherwise HTTP 409 replace_target_changed."
                                    },
                                    "parent_uuid": {
                                        "type": "string",
                                        "description": "UUID of the target folder."
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "UUID of the client."
                                    },
                                    "project_uuid": {
                                        "type": "string",
                                        "description": "UUID of the project."
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "UUID of the contact."
                                    },
                                    "shared_drive_uuid": {
                                        "type": "string",
                                        "description": "UUID of the shared drive."
                                    },
                                    "target_root": {
                                        "type": "string",
                                        "description": "private (My FlowDrive) or team (root of the shared team drive, writable for every team member). Only without parent_uuid and without a reference UUID."
                                    }
                                },
                                "required": [
                                    "s3_key",
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/conflicts": {
            "post": {
                "operationId": "flowdrive-entries-conflicts",
                "summary": "Check name conflicts before uploading",
                "description": "For up to 200 file names, returns the files with the same name that already exist at the target (upper and lower case and accents do not count), so that you can ask before uploading. Folders and links with the same name are not a conflict. can_replace says whether the caller may replace the content.",
                "tags": [
                    "entries-write"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "conflicts": [
                                            {
                                                "name": "Angebot.pdf",
                                                "existing": {
                                                    "uuid": "3c5b0a11-...",
                                                    "name": "Angebot.pdf",
                                                    "size": 284410,
                                                    "updated_at": "2026-11-20T09:12:00+00:00"
                                                },
                                                "can_replace": true
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "names": {
                                        "type": "array",
                                        "items": [],
                                        "description": "File names, 1 to 200, each at most 240 characters."
                                    },
                                    "parent_uuid": {
                                        "type": "string",
                                        "description": "UUID of the target folder."
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "UUID of the client."
                                    },
                                    "project_uuid": {
                                        "type": "string",
                                        "description": "UUID of the project."
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "UUID of the contact."
                                    },
                                    "shared_drive_uuid": {
                                        "type": "string",
                                        "description": "UUID of the shared drive."
                                    },
                                    "target_root": {
                                        "type": "string",
                                        "description": "private (My FlowDrive) or team (root of the shared team drive, writable for every team member). Only without parent_uuid and without a reference UUID."
                                    }
                                },
                                "required": [
                                    "names"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/{uuid}/move": {
            "post": {
                "operationId": "flowdrive-entries-move",
                "summary": "Move an entry",
                "description": "Moves an entry into another folder or, with \"parent_uuid\": null, to the top level of its current area. Folders take their entire content with them. The field must be sent explicitly, because leaving it out could not be told apart from an intended move to the top. If the server rejects the move because of a rule, it responds with HTTP 422 and an error code in error, for example private_foreign_items (the moved folder contains entries of other people and the target is private), into_descendant (the target is inside the moved folder), changed_concurrently (entry or target were just changed, try again) or flowsend_boundary.",
                "tags": [
                    "entries-write"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3c5b0a11-...",
                                        "name": "Angebot.pdf",
                                        "parent_uuid": "7e1a9c33-..."
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "parent_uuid": {
                                        "type": "string",
                                        "description": "UUID of the target folder or null for the top level. The target must be a folder and requires the edit level. Not needed if target_root is sent."
                                    },
                                    "target_root": {
                                        "type": "string",
                                        "description": "Instead of parent_uuid: private moves to the root of My FlowDrive, team to the root of the shared team drive. Links to a client, project, contact or shared drive are removed in the process."
                                    }
                                },
                                "required": [
                                    "parent_uuid"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/{uuid}/copy": {
            "post": {
                "operationId": "flowdrive-entries-copy",
                "summary": "Copy an entry",
                "description": "Copies a file, an external link or an entire folder with its content to another location. The copy runs in the background: the request checks all rules immediately and responds with HTTP 202 and the copy operation (operation, status queued). GET /flowdrive/copies/{uuid} with the UUID of the operation returns progress and result; once it has finished, root_entry_uuids contains the UUID of the top copied entry. The target is determined as when creating: with \"parent_uuid\" the copy lands in that folder and takes over its area. Without a folder, exactly one of client_uuid, project_uuid, contact_uuid or shared_drive_uuid decides, and the copy is placed at the top level of that area. If none is given, it lands at the top level of the caller's \"My FlowDrive\" (area personal). With \"target_root\": \"team\" it lands at the top level of the team's Shared FlowDrive instead, which every team member with FlowDrive access may write to; \"target_root\": \"private\" is the same as leaving it out. target_root cannot be combined with parent_uuid or any of the area UUIDs (HTTP 422 with a validation error on target_root). The source needs the view level, the target requires edit. Copies to clients, projects and contacts also require write access in FlowCRM. Every copy gets a new UUID and its own object in storage; if the name collides at the target, a counter is appended. Not copied are entries in the trash, child items without read access, share links and the analysis results of the original. By default an operation covers at most 5000 entries (every folder counts, including the copied folder itself) and 20 GiB. By default each user may start 20 copy operations per minute, shared between the API and the web app (above that HTTP 429 with rate_limited and Retry-After). Errors with the request: HTTP 403 for missing rights on source or target (access_denied, crm_permission for missing FlowCRM write access); HTTP 404 if source or target folder are not visible in your own team; HTTP 422 with a validation error on parent_uuid if the target is not a folder, on target_root for an unknown value or an invalid combination, as well as with invalid_target (target is inside the copied folder), protected_entry (FlowSend system folder) or limit_exceeded (too many entries or bytes). If the copy fails later in the background, the operation says so (status failed with error); nothing is left behind in that case.",
                "tags": [
                    "entries-write"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "operation": {
                                        "uuid": "5b8e2f10-...",
                                        "status": "queued",
                                        "total_items": 42,
                                        "copied_items": 0,
                                        "failed_sources": 0,
                                        "target_label": "Muster GmbH / Angebote",
                                        "root_entry_uuids": [],
                                        "error": null,
                                        "created_at": "2026-11-12T09:30:00+01:00",
                                        "started_at": null,
                                        "finished_at": null
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "parent_uuid": {
                                        "type": "string",
                                        "description": "UUID of the target folder. It must be a folder, the caller needs the edit level there, and it must not be inside the copied folder itself."
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "UUID of the client, if the copy should go to the top level of its files."
                                    },
                                    "project_uuid": {
                                        "type": "string",
                                        "description": "UUID of the project, if the copy should go to the top level of its files."
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "UUID of the contact. For a private contact the copy stays private."
                                    },
                                    "shared_drive_uuid": {
                                        "type": "string",
                                        "description": "UUID of the shared drive; requires the edit level there."
                                    },
                                    "target_root": {
                                        "type": "string",
                                        "description": "Top level without an area UUID: private (the caller's My FlowDrive, default) or team (the team's Shared FlowDrive). Not together with parent_uuid, client_uuid, project_uuid, contact_uuid or shared_drive_uuid."
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/copies/{uuid}": {
            "get": {
                "operationId": "flowdrive-copies-show",
                "summary": "Get a copy operation",
                "description": "Returns status and progress of a copy operation started by POST /flowdrive/entries/{uuid}/copy. status is queued (waiting), running, completed (everything copied), partial (some sources could not be copied, the rest has been created) or failed (nothing created). total_items is the number of planned entries, copied_items grows during the copy. root_entry_uuids contains the top entries of the finished copies, error the reason for a failure in the user's language. Poll the operation at most every few seconds until status is completed, partial or failed. An operation is visible only to the user who started it and only in the team in which it was started; otherwise the API responds with HTTP 404.",
                "tags": [
                    "entries-write"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "operation": {
                                        "uuid": "5b8e2f10-...",
                                        "status": "completed",
                                        "total_items": 42,
                                        "copied_items": 42,
                                        "failed_sources": 0,
                                        "target_label": "Muster GmbH / Angebote",
                                        "root_entry_uuids": [
                                            "9d2f4b70-..."
                                        ],
                                        "error": null,
                                        "created_at": "2026-11-12T09:30:00+01:00",
                                        "started_at": "2026-11-12T09:30:01+01:00",
                                        "finished_at": "2026-11-12T09:30:19+01:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/{uuid}/restore": {
            "post": {
                "operationId": "flowdrive-entries-restore",
                "summary": "Restore an entry",
                "description": "Brings an entry and everything below it back from the trash. Requires the manage level. If the entry is not in the trash, the route responds with HTTP 422.",
                "tags": [
                    "entries-trash"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3c5b0a11-...",
                                        "name": "Angebot.pdf",
                                        "trashed": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/{uuid}/purge": {
            "delete": {
                "operationId": "flowdrive-entries-purge",
                "summary": "Delete an entry permanently",
                "description": "Permanently deletes an entry in the trash and removes the stored bytes. Requires the manage level. If the entry is not in the trash, the route responds with HTTP 422.",
                "tags": [
                    "entries-trash"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Endgültig gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/{uuid}/versions": {
            "get": {
                "operationId": "flowdrive-versions-index",
                "summary": "List the versions of a file",
                "description": "Older contents of a file, newest first. Needs read access to the file.",
                "tags": [
                    "versions-favorites"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "5e0c7a2b-...",
                                            "size": 48211,
                                            "size_human": "47,1 KB",
                                            "mime_type": "application/pdf",
                                            "created_at": "2026-11-20T09:12:00+00:00",
                                            "created_by_uuid": "1f3e...",
                                            "created_by_name": "Lena Hoffmann"
                                        }
                                    ],
                                    "meta": {
                                        "keep_per_file": 10,
                                        "retention_days": 90
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/versions/{uuid}/download-url": {
            "get": {
                "operationId": "flowdrive-versions-download-url",
                "summary": "Create a download link for a version",
                "description": "Time-limited download link of the version, always as an attachment with the name of the file. Needs read access.",
                "tags": [
                    "versions-favorites"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "url": "https://s3.example/...",
                                        "expires_at": "2026-11-22T11:15:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/versions/{uuid}/restore": {
            "post": {
                "operationId": "flowdrive-versions-restore",
                "summary": "Restore a version",
                "description": "Makes the version the current content again; the previous content becomes a version itself. UUID, name, location and share links of the file stay the same. Needs edit access. The response is the updated entry.",
                "tags": [
                    "versions-favorites"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3c5b0a11-...",
                                        "name": "Angebot.pdf",
                                        "kind": "file",
                                        "version_count": 2,
                                        "is_favorite": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/versions/{uuid}": {
            "delete": {
                "operationId": "flowdrive-versions-destroy",
                "summary": "Delete a version",
                "description": "Deletes the version permanently. Needs edit access.",
                "tags": [
                    "versions-favorites"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/favorites": {
            "get": {
                "operationId": "flowdrive-favorites-index",
                "summary": "List favorites",
                "description": "Entries the caller starred in the current team, most recently starred first. Entries the caller no longer has access to are left out.",
                "tags": [
                    "versions-favorites"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "3c5b0a11-...",
                                            "name": "Angebot.pdf",
                                            "kind": "file",
                                            "is_favorite": true
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/{uuid}/favorite": {
            "put": {
                "operationId": "flowdrive-favorites-store",
                "summary": "Mark an entry as a favorite",
                "description": "Stars a file or folder. Idempotent, needs read access. The response is the entry.",
                "tags": [
                    "versions-favorites"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3c5b0a11-...",
                                        "is_favorite": true
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowdrive-favorites-destroy",
                "summary": "Remove a favorite",
                "description": "Removes the star. Idempotent. The response is the entry.",
                "tags": [
                    "versions-favorites"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3c5b0a11-...",
                                        "is_favorite": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/recent": {
            "get": {
                "operationId": "flowdrive-recent-index",
                "summary": "Recently used",
                "description": "Entries the caller recently opened (download link, download, text), uploaded or edited (replaced, renamed, version restored), newest first. Entries in the trash or without access are left out.",
                "tags": [
                    "versions-favorites"
                ],
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "1 to 200, default 50.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "action": "opened",
                                            "last_at": "2026-11-22T10:01:00+00:00",
                                            "entry": {
                                                "uuid": "3c5b0a11-...",
                                                "name": "Angebot.pdf",
                                                "kind": "file"
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/{uuid}/share-links": {
            "get": {
                "operationId": "flowdrive-share-links-index",
                "summary": "List the share links of an entry",
                "description": "Lists all public links of an entry, newest first. A password that has been set is never returned, only whether one exists.",
                "tags": [
                    "share-links"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "a1b2c3d4-...",
                                            "token": "2f9c...",
                                            "public_url": "https://app.example.com/share/drive/2f9c...",
                                            "target_type": "file",
                                            "allow_download": true,
                                            "has_password": false,
                                            "expires_at": "2026-10-01T00:00:00+00:00",
                                            "is_expired": false
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowdrive-share-links-store",
                "summary": "Create a share link",
                "description": "Creates a public link. An entry in a shared drive needs the manage level, a private entry needs ownership, and for an entry on a contact the contact's current visibility decides. An entry in the trash cannot be shared.",
                "tags": [
                    "share-links"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "a1b2c3d4-...",
                                        "token": "2f9c...",
                                        "public_url": "https://app.example.com/share/drive/2f9c...",
                                        "allow_download": true,
                                        "has_password": false,
                                        "expires_at": null,
                                        "is_expired": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "allow_download": {
                                        "type": "boolean",
                                        "description": "true allows downloading, false only viewing."
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "Optional password, at least 4 characters. Stored only as a hash."
                                    },
                                    "expires_at": {
                                        "type": "string",
                                        "description": "Expiry time, must be in the future."
                                    }
                                },
                                "required": [
                                    "allow_download"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/share-links/{uuid}": {
            "delete": {
                "operationId": "flowdrive-share-links-destroy",
                "summary": "Revoke a share link",
                "description": "Withdraws a public link. The address is invalid immediately afterwards. A link of another team is answered like an unknown UUID with HTTP 404.",
                "tags": [
                    "share-links"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Freigabe-Link entfernt."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/entries/{uuid}/shares": {
            "get": {
                "operationId": "flowdrive-shares-index",
                "summary": "Shares of an entry",
                "description": "Active personal shares of the entry. Same permission as for creating a share link.",
                "tags": [
                    "personal-shares"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "…",
                                            "type": "internal",
                                            "permission": "view",
                                            "entry_uuid": "…",
                                            "grantee": {
                                                "uuid": "…",
                                                "name": "Lena Hoffmann",
                                                "email": "lena@example.com",
                                                "avatar_url": "…"
                                            },
                                            "email": null,
                                            "message": null,
                                            "expires_at": null,
                                            "last_accessed_at": null,
                                            "created_by_name": "…",
                                            "created_at": "…"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowdrive-shares-store",
                "summary": "Share an entry personally",
                "description": "Shares with a team member (type=internal) or invites an external address (type=external). An existing share for the same person is updated; inviting the same address again replaces the link.",
                "tags": [
                    "personal-shares"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "…",
                                        "type": "external",
                                        "permission": "upload",
                                        "email": "kunde@example.com",
                                        "grantee": null,
                                        "expires_at": "2026-12-01T00:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "description": "internal or external."
                                    },
                                    "user_uuid": {
                                        "type": "string",
                                        "description": "Required with internal: member of your own team."
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Required with external."
                                    },
                                    "permission": {
                                        "type": "string",
                                        "description": "internal: view or edit. external: view, download or upload (folders only)."
                                    },
                                    "expires_at": {
                                        "type": "string",
                                        "description": "Expiry time in the future."
                                    },
                                    "message": {
                                        "type": "string",
                                        "description": "Message in the invitation (external), at most 1000 characters."
                                    }
                                },
                                "required": [
                                    "type",
                                    "permission"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/shares/{uuid}": {
            "patch": {
                "operationId": "flowdrive-shares-update",
                "summary": "Change a share",
                "description": "Changes permission and expiry. expires_at: null removes the expiry.",
                "tags": [
                    "personal-shares"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "permission": {
                                        "type": "string",
                                        "description": "New level."
                                    },
                                    "expires_at": {
                                        "type": "string",
                                        "description": "New expiry or null."
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowdrive-shares-destroy",
                "summary": "Revoke a share",
                "description": "Ends the share immediately. The person who received an internal share can also leave it this way.",
                "tags": [
                    "personal-shares"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/members": {
            "get": {
                "operationId": "flowdrive-members",
                "summary": "Team members for selection",
                "description": "Members of your own team without the caller, at most 50.",
                "tags": [
                    "personal-shares"
                ],
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Filter by name or email.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "…",
                                            "name": "Lena Hoffmann",
                                            "email": "lena@example.com",
                                            "avatar_url": "…"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/shared-with-me": {
            "get": {
                "operationId": "flowdrive-shared-with-me",
                "summary": "Shared with me",
                "description": "Entries team members have shared with the caller, as normal entries with shared_by_name, share_permission and share_uuid. Subfolders are opened with GET /flowdrive/entries?parent_uuid=… . GET /flowdrive/entries?area=shared returns the same.",
                "tags": [
                    "personal-shares"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "…",
                                            "name": "Angebote",
                                            "kind": "folder",
                                            "level": "view",
                                            "shared_by_name": "Max Muster",
                                            "share_permission": "view",
                                            "share_uuid": "…"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/flowai/artifacts": {
            "get": {
                "operationId": "flowdrive-flowai-artifacts-index",
                "summary": "List FlowAI documents",
                "description": "Lists the documents of the FlowAI folder, newest first. name and mime_type describe the file that /content delivers: a document with a Markdown source is delivered as PDF (or as Word if Word was requested), a stored PDF, Word document or spreadsheet as the stored file. size is null if the file is only generated on download. can_download is false if the caller lacks FlowAI.",
                "tags": [
                    "flowai-documents"
                ],
                "parameters": [
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Documents per page, 1 to 200, default 50.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, default 1.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "8b3f2e10-4c5d-4e6f-8a7b-9c0d1e2f3a4b",
                                            "name": "Monatsbericht.pdf",
                                            "kind": "file",
                                            "mime_type": "application/pdf",
                                            "size": null,
                                            "created_at": "2026-11-24T09:12:00+00:00",
                                            "updated_at": "2026-11-24T09:12:00+00:00",
                                            "created_by_name": "Sascha",
                                            "managed_by": "flowai",
                                            "can_download": true
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 50,
                                        "total": 1,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/flowai/artifacts/{uuid}/content": {
            "get": {
                "operationId": "flowdrive-flowai-artifacts-content",
                "summary": "Download a FlowAI document",
                "description": "Returns the bytes of a document as an attachment (Content-Disposition: attachment, X-Content-Type-Options: nosniff), like the download button in the web app: the stored file or the export of the Markdown source to its final format. A document outside the list responds with HTTP 404. Without FlowAI access the route responds with HTTP 403 and error flowai_access_denied (not a module code, FlowDrive access remains). If the document cannot be generated right now, it responds with HTTP 503 and error render_unavailable (for PDF with Retry-After and retry_after), with empty content with HTTP 422 render_empty and with any other error with HTTP 500 render_failed; the last two carry a reference for support. Because Markdown documents are generated on every download, each user may make 30 downloads per minute by default; above that the route responds with HTTP 429, error rate_limited, Retry-After and retry_after.",
                "tags": [
                    "flowai-documents"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/drives": {
            "get": {
                "operationId": "flowdrive-drives-index",
                "summary": "List shared drives",
                "description": "Lists all shared drives the caller has access to, each with your own permission level.",
                "tags": [
                    "shared-drives"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "9d2f4c1a-...",
                                            "name": "Vertrieb",
                                            "level": "manage",
                                            "created_by_name": "Sascha"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowdrive-drives-store",
                "summary": "Create a shared drive",
                "description": "Creates a shared drive. The caller immediately receives the manage level.",
                "tags": [
                    "shared-drives"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "9d2f4c1a-...",
                                        "name": "Vertrieb",
                                        "level": "manage"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the drive, at most 255 characters."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/drives/{uuid}": {
            "get": {
                "operationId": "flowdrive-drives-show",
                "summary": "Get a shared drive",
                "description": "Returns a single shared drive with your own permission level. Requires at least the view level.",
                "tags": [
                    "shared-drives"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "9d2f4c1a-...",
                                        "name": "Vertrieb",
                                        "level": "view"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "flowdrive-drives-update",
                "summary": "Rename a shared drive",
                "description": "Renames a shared drive. Requires the manage level.",
                "tags": [
                    "shared-drives"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "9d2f4c1a-...",
                                        "name": "Vertrieb Nord",
                                        "level": "manage"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "New name, at most 255 characters."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowdrive-drives-destroy",
                "summary": "Delete a shared drive",
                "description": "Permanently deletes a shared drive together with all files and folders in it and their stored bytes. The drive is unreachable immediately, the bytes are removed shortly afterwards in the background; there is no trash and no way back. If the drive contains the FlowSend folder or media that FlowSend still uses, or if its folders contain entries that belong to another FlowDrive area, the route responds with HTTP 422 (`delete_blocked`) and changes nothing. Requires the manage level.",
                "tags": [
                    "shared-drives"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Geteiltes Drive endgültig gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/drives/{uuid}/members": {
            "get": {
                "operationId": "flowdrive-drives-members-index",
                "summary": "List the members of a shared drive",
                "description": "Lists all members with their permission level. Requires at least the view level.",
                "tags": [
                    "shared-drives"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "user_uuid": "4f8a9c5d-...",
                                            "name": "Melanie",
                                            "email": "melanie@example.com",
                                            "level": "edit"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowdrive-drives-members-store",
                "summary": "Add a member or change their level",
                "description": "Adds a member or changes their level; both are the same call. The user must belong to the team, otherwise the route responds with HTTP 404. Requires the manage level.",
                "tags": [
                    "shared-drives"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "user_uuid": "4f8a9c5d-...",
                                        "name": "Melanie",
                                        "level": "edit"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_uuid": {
                                        "type": "string",
                                        "description": "UUID of the team member."
                                    },
                                    "level": {
                                        "type": "string",
                                        "description": "view, edit or manage."
                                    }
                                },
                                "required": [
                                    "user_uuid",
                                    "level"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/drives/{uuid}/members/{userUuid}": {
            "delete": {
                "operationId": "flowdrive-drives-members-destroy",
                "summary": "Remove a member",
                "description": "Revokes a member's access. The last managing member cannot remove themselves, because the drive would otherwise have no owner; this case responds with HTTP 422. Requires the manage level.",
                "tags": [
                    "shared-drives"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "userUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Mitglied entfernt."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/reports/storage": {
            "get": {
                "operationId": "flowdrive-reports-storage",
                "summary": "Get storage in use",
                "description": "Returns the team's storage in use in bytes, split by shared drives and entries on clients or projects, plus the number of files. The figures apply to the whole team, not to the individual user.",
                "tags": [
                    "reports"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "total": 184320917,
                                        "shared_drives": 120000000,
                                        "crm": 40000000,
                                        "files": 812
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/reports/trash": {
            "get": {
                "operationId": "flowdrive-reports-trash",
                "summary": "List the trash",
                "description": "Lists the entries in the trash, newest first, limited to what the caller may see. Instead of a total, the response reports \"has_more\", because visibility is decided per entry.",
                "tags": [
                    "reports"
                ],
                "parameters": [
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Entries per page, 1 to 200, default 20.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, default 1.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "3c5b0a11-...",
                                            "name": "Altes Angebot.pdf",
                                            "kind": "file",
                                            "trashed": true,
                                            "deleted_at": "2026-09-14T08:12:00+00:00"
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 20,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowdrive/reports/shares": {
            "get": {
                "operationId": "flowdrive-reports-shares",
                "summary": "List all share links",
                "description": "Lists every public link of the team whose entry the caller may see. Meant for regular reviews: which files can currently be reached without signing in.",
                "tags": [
                    "reports"
                ],
                "parameters": [
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Entries per page, 1 to 200, default 20.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, default 1.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "a1b2c3d4-...",
                                            "public_url": "https://app.example.com/share/drive/2f9c...",
                                            "entry_uuid": "3c5b0a11-...",
                                            "allow_download": true,
                                            "has_password": true,
                                            "expires_at": "2026-10-01T00:00:00+00:00",
                                            "is_expired": false
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 20,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "API key (pk_… or at_…) as Authorization: Bearer <key>. Any other way of sending it is rejected with 401."
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "success": {
                        "type": "boolean"
                    },
                    "error": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    },
                    "errors": {
                        "type": "object"
                    }
                }
            }
        }
    }
}