{
    "openapi": "3.1.0",
    "info": {
        "title": "FlowSupport API",
        "version": "v1",
        "description": "REST API for the FlowSupport inboxes (WhatsApp and email): read, answer and assign conversations, set status and labels, keep internal notes and link them to the CRM."
    },
    "servers": [
        {
            "url": "https://api.flowsuite.one",
            "description": "FlowSuite API"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "context",
            "description": "Overview"
        },
        {
            "name": "inboxes",
            "description": "Inboxes"
        },
        {
            "name": "conversations",
            "description": "Conversations"
        },
        {
            "name": "messages",
            "description": "Messages"
        },
        {
            "name": "notes",
            "description": "Internal notes"
        },
        {
            "name": "catalogs",
            "description": "Labels and templates"
        },
        {
            "name": "reports",
            "description": "Reports"
        }
    ],
    "paths": {
        "/flowsupport/context": {
            "get": {
                "operationId": "flowsupport-context",
                "summary": "Get inboxes, states and limits",
                "description": "Returns every reachable inbox with your own access level, its channel's capabilities, the connection state and the assignable team members per inbox, plus the four states of a conversation, the two share levels you can grant and the limits for file attachments.",
                "tags": [
                    "context"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "inboxes": [
                                            {
                                                "uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                                "name": "Support",
                                                "channel": "whatsapp",
                                                "status": "ready",
                                                "capabilities": {
                                                    "text": true,
                                                    "files": true,
                                                    "new_conversation": true,
                                                    "groups": true,
                                                    "mentions": true,
                                                    "label_sync": true,
                                                    "quote_reply": false,
                                                    "reactions": false,
                                                    "edit_message": false,
                                                    "delete_message": false,
                                                    "recipient_kind": "phone",
                                                    "max_text_length": 5000,
                                                    "max_files": 5,
                                                    "max_file_kilobytes": 25600
                                                },
                                                "connection": {
                                                    "status": "ready",
                                                    "last_heartbeat_at": "2026-10-08T09:14:32+02:00",
                                                    "heartbeat_age_seconds": 21,
                                                    "stale": false,
                                                    "delivers_now": true
                                                },
                                                "level": "owner",
                                                "may_send": true,
                                                "may_manage": true,
                                                "may_share": true,
                                                "new_chat_blocked": false,
                                                "assignable_users": [
                                                    {
                                                        "user_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                                        "name": "Anna Berger"
                                                    }
                                                ]
                                            }
                                        ],
                                        "conversation_statuses": [
                                            "open",
                                            "in_progress",
                                            "waiting",
                                            "done"
                                        ],
                                        "share_levels": [
                                            "read",
                                            "reply"
                                        ],
                                        "attachment_limits": {
                                            "max_files": 5,
                                            "max_kilobytes": 25600,
                                            "mime_types": [
                                                "image/jpeg",
                                                "application/pdf"
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes": {
            "get": {
                "operationId": "flowsupport-inboxes-index",
                "summary": "List inboxes",
                "description": "All inboxes this key reaches, with your own access level, the channel's capabilities, the connection state and whether you may send, share and manage.",
                "tags": [
                    "inboxes"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                            "name": "Support",
                                            "channel": "whatsapp",
                                            "visibility": "private",
                                            "status": "ready",
                                            "own_number": "4915100000000",
                                            "owner_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                            "owner_name": "Anna Berger",
                                            "outbound_wait_hours": 4,
                                            "max_new_chats_per_hour": 10,
                                            "max_messages_per_hour": 100,
                                            "capabilities": {
                                                "text": true,
                                                "files": true,
                                                "new_conversation": true,
                                                "groups": true,
                                                "mentions": true,
                                                "label_sync": true,
                                                "quote_reply": false,
                                                "reactions": false,
                                                "edit_message": false,
                                                "delete_message": false,
                                                "recipient_kind": "phone",
                                                "max_text_length": 5000,
                                                "max_files": 5,
                                                "max_file_kilobytes": 25600
                                            },
                                            "connection": {
                                                "status": "ready",
                                                "last_heartbeat_at": "2026-10-08T09:14:32+02:00",
                                                "heartbeat_age_seconds": 21,
                                                "stale": false,
                                                "delivers_now": true
                                            },
                                            "level": "owner",
                                            "may_send": true,
                                            "may_manage": true,
                                            "may_share": true,
                                            "new_chat_blocked": false
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}": {
            "get": {
                "operationId": "flowsupport-inboxes-show",
                "summary": "Get an inbox",
                "description": "A single inbox with your own access level and, in addition, the team members who can be assigned in this inbox. An inbox without an access level answers with HTTP 404.",
                "tags": [
                    "inboxes"
                ],
                "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-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                        "name": "Support",
                                        "status": "ready",
                                        "outbound_wait_hours": 4,
                                        "max_new_chats_per_hour": 10,
                                        "max_messages_per_hour": 100,
                                        "capabilities": {
                                            "text": true,
                                            "files": true,
                                            "new_conversation": true,
                                            "groups": true,
                                            "mentions": true,
                                            "label_sync": true,
                                            "quote_reply": false,
                                            "reactions": false,
                                            "edit_message": false,
                                            "delete_message": false,
                                            "recipient_kind": "phone",
                                            "max_text_length": 5000,
                                            "max_files": 5,
                                            "max_file_kilobytes": 25600
                                        },
                                        "connection": {
                                            "status": "ready",
                                            "last_heartbeat_at": "2026-10-08T09:14:32+02:00",
                                            "heartbeat_age_seconds": 21,
                                            "stale": false,
                                            "delivers_now": true
                                        },
                                        "level": "owner",
                                        "may_send": true,
                                        "assignable_users": [
                                            {
                                                "user_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                                "name": "Anna Berger"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "flowsupport-inboxes-update",
                "summary": "Rename an inbox",
                "description": "Changes the inbox's name and the address it shows as its own. Both fields are sent together: if the own address is missing, it is cleared. Requires the right to manage inboxes, even for the inbox owner; without this right the route answers with HTTP 403.",
                "tags": [
                    "inboxes"
                ],
                "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-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                        "name": "Kundenservice",
                                        "own_number": "4915100000000",
                                        "status": "ready",
                                        "level": "owner"
                                    }
                                }
                            }
                        }
                    },
                    "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": "The name, at most 255 characters."
                                    },
                                    "own_address": {
                                        "type": "string",
                                        "description": "The inbox's own address, for WhatsApp the phone number, at most 20 characters. If the field is missing or empty, the address is cleared. own_number is accepted as an equivalent name."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/pacing": {
            "put": {
                "operationId": "flowsupport-inboxes-pacing",
                "summary": "Set an inbox's sending pace",
                "description": "Sets the wait time and the two hourly limits. The limits reject nothing; they decide how fast the queue is handed to the channel. All three values are sent together. Allowed for the inbox owner and anyone who may manage inboxes. If the inbox is in use right now, the route answers with HTTP 503 and the error code inbox_busy; the call can then be repeated.",
                "tags": [
                    "inboxes"
                ],
                "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-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                        "name": "Support",
                                        "outbound_wait_hours": 24,
                                        "max_new_chats_per_hour": 20,
                                        "max_messages_per_hour": 200,
                                        "level": "owner"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "outbound_wait_hours": {
                                        "type": "integer",
                                        "description": "How many hours an item waits for the channel before it expires. 1 to 168."
                                    },
                                    "max_new_chats_per_hour": {
                                        "type": "integer",
                                        "description": "How many new conversations the inbox starts per hour. 1 to 1000."
                                    },
                                    "max_messages_per_hour": {
                                        "type": "integer",
                                        "description": "How many messages the inbox hands over per hour. 1 to 1000."
                                    }
                                },
                                "required": [
                                    "outbound_wait_hours",
                                    "max_new_chats_per_hour",
                                    "max_messages_per_hour"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/label-sync": {
            "get": {
                "operationId": "flowsupport-inbox-label-sync-show",
                "summary": "Get an inbox's label sync",
                "description": "The state of syncing labels with the channel: whether it is on, whether the account supports it and the label set has been read completely, and the number of pending, failed and conflicting transfers. Requires the same right as changing it.",
                "tags": [
                    "inboxes"
                ],
                "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": {
                                        "enabled": false,
                                        "supported": true,
                                        "initialized": true,
                                        "resync_requested": false,
                                        "pending": 0,
                                        "failed": 0,
                                        "conflicts": 0
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "flowsupport-inbox-label-sync-update",
                "summary": "Turn label sync on or off",
                "description": "Turns syncing labels with the channel on or off. Turning it on for the first time merges the inbox's labels with those on the device and therefore requires device_verified. It can only be turned on once supported and initialized are true, and only with at most 20 labels. Turning it off discards pending transfers. Allowed for the inbox owner and anyone who may manage inboxes.",
                "tags": [
                    "inboxes"
                ],
                "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": {
                                        "enabled": true,
                                        "supported": true,
                                        "initialized": true,
                                        "resync_requested": false,
                                        "pending": 4,
                                        "failed": 0,
                                        "conflicts": 0
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "enabled": {
                                        "type": "boolean",
                                        "description": "true turns syncing on, false turns it off."
                                    },
                                    "device_verified": {
                                        "type": "boolean",
                                        "description": "Confirms that the sync was checked on the device with the real account. Required when turning it on for the first time, otherwise without effect."
                                    }
                                },
                                "required": [
                                    "enabled"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/shares": {
            "get": {
                "operationId": "flowsupport-inbox-shares-index",
                "summary": "List an inbox's shares",
                "description": "The access levels granted on an inbox. Reading this list requires the same right as changing it: whoever may not share does not learn who else has access either. The owner does not appear here; their level follows from the inbox itself.",
                "tags": [
                    "inboxes"
                ],
                "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": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                            "name": "Anna Berger",
                                            "email": "anna@example.com",
                                            "level": "reply",
                                            "granted_by_uuid": "7a2c0e19-55bb-4c31-9f80-2d6e4f1a8c33",
                                            "created_at": "2026-09-12T08:14:00+02:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsupport-inbox-shares-store",
                "summary": "Share an inbox",
                "description": "Shares the inbox with a team member at a level. A second share to the same person changes the level instead of creating a second row, and answers with HTTP 201 in both cases.",
                "tags": [
                    "inboxes"
                ],
                "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": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                        "name": "Anna Berger",
                                        "level": "reply",
                                        "created_at": "2026-09-12T08:14:00+02:00"
                                    }
                                }
                            }
                        }
                    },
                    "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. A person outside the team leads to a validation error."
                                    },
                                    "level": {
                                        "type": "string",
                                        "description": "read or reply. owner cannot be granted."
                                    }
                                },
                                "required": [
                                    "user_uuid",
                                    "level"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/shares/{userUuid}": {
            "delete": {
                "operationId": "flowsupport-inbox-shares-destroy",
                "summary": "Revoke a share",
                "description": "Removes a team member's access to the inbox. Revoking a share that does not exist is not an error.",
                "tags": [
                    "inboxes"
                ],
                "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": "Freigabe entzogen."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/suspend": {
            "post": {
                "operationId": "flowsupport-inboxes-suspend",
                "summary": "Suspend an inbox",
                "description": "Ends receiving and visibility of the inbox. Messages, attachments and media stay unchanged; what is withdrawn is the view, not the data.",
                "tags": [
                    "inboxes"
                ],
                "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": "Postfach stillgelegt."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/request-deletion": {
            "post": {
                "operationId": "flowsupport-inboxes-request-deletion",
                "summary": "Mark an inbox for deletion",
                "description": "Marks the inbox with all its messages and media for deletion. This step cannot be undone via the API.",
                "tags": [
                    "inboxes"
                ],
                "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": "Postfach zur Löschung vorgemerkt."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations": {
            "get": {
                "operationId": "flowsupport-conversations-index",
                "summary": "List conversations",
                "description": "The conversations of all reachable inboxes, most recent activity first. Without a filter the list covers every inbox this key sees.",
                "tags": [
                    "conversations"
                ],
                "parameters": [
                    {
                        "name": "inbox_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Limit to one inbox.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "open, in_progress, waiting or done.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "assigned_user_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Only conversations of this team member.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "label_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Only conversations with this label.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Searches the conversation name and the counterpart's name and phone number.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "unread",
                        "in": "query",
                        "required": false,
                        "description": "Only conversations with unread incoming messages.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items 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": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                            "name": "Frau Müller",
                                            "inbox_uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                            "inbox_name": "Support",
                                            "external_thread": "4915112345678@c.us",
                                            "is_group": false,
                                            "status": "open",
                                            "assigned_user_uuid": null,
                                            "linked_client_uuid": null,
                                            "labels": [],
                                            "unread_messages": 2,
                                            "last_message_at": "2026-09-20T15:02:00+02:00"
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 50,
                                        "total": 1,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsupport-conversations-store",
                "summary": "Start a conversation with a phone number",
                "description": "Opens a conversation with a phone number that has not written to us. Three outcomes: HTTP 200 with the existing conversation, HTTP 201 with the newly opened conversation, or HTTP 202 with a lookup if the phone number first has to be checked with WhatsApp by the listener. If the inbox is not connected, its hourly limit for new chats is used up or WhatsApp's own quota is reached, nothing is rejected: the conversation is created right away and returned with HTTP 202 together with `queued: true` and `estimated_start_at`; check and sending wait in the inbox's queue. An unreadable, unreachable or ambiguous phone number answers with HTTP 422.",
                "tags": [
                    "conversations"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "a4f7c2b8-1d09-4e66-b3a1-7c5f2e0d9b44",
                                        "status": "pending",
                                        "number": "+4915112345678",
                                        "open": true,
                                        "conversation_uuid": null
                                    },
                                    "message": "Die Rufnummer wird geprüft. Den Stand liefert der Abruf des Vorgangs."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "inbox_uuid": {
                                        "type": "string",
                                        "description": "The inbox to write from. Requires the permission to send."
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "The phone number as typed. The platform converts it to the international format itself."
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Display name of the counterpart, if known."
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "CRM contact the counterpart is linked to."
                                    }
                                },
                                "required": [
                                    "inbox_uuid",
                                    "phone"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}": {
            "get": {
                "operationId": "flowsupport-conversations-show",
                "summary": "Get a conversation",
                "description": "A conversation with its counterparts, labels, CRM links, the number of unread messages and this key's rights on it.",
                "tags": [
                    "conversations"
                ],
                "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": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "name": "Frau Müller",
                                        "status": "open",
                                        "unread_messages": 2,
                                        "participants": [
                                            {
                                                "uuid": "5d0a7e13-88f2-4c9b-a610-3e7b1d4c6f20",
                                                "name": "Frau Müller",
                                                "number": "+4915112345678",
                                                "external_address": "4915112345678@c.us",
                                                "linked_contact_uuid": null
                                            }
                                        ],
                                        "permissions": {
                                            "may_change_status": true,
                                            "may_assign": true,
                                            "may_link": true,
                                            "may_write_labels": true
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/status": {
            "put": {
                "operationId": "flowsupport-conversations-status",
                "summary": "Change a conversation's state",
                "description": "Sets the processing state. A closed conversation is reopened automatically by a new incoming message.",
                "tags": [
                    "conversations"
                ],
                "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": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "status": "done"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status": {
                                        "type": "string",
                                        "description": "open, in_progress, waiting or done."
                                    }
                                },
                                "required": [
                                    "status"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/assignee": {
            "put": {
                "operationId": "flowsupport-conversations-assignee",
                "summary": "Set or remove the assignee",
                "description": "Hands the conversation to a team member or removes the assignment. A member without access to this inbox is rejected with HTTP 422 instead of being entered silently.",
                "tags": [
                    "conversations"
                ],
                "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": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "assigned_user_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                        "assigned_user_name": "Anna Berger"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "assigned_user_uuid": {
                                        "type": "string",
                                        "description": "UUID of the team member, or null to remove. The field must be present."
                                    }
                                },
                                "required": [
                                    "assigned_user_uuid"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/labels": {
            "put": {
                "operationId": "flowsupport-conversations-labels",
                "summary": "Set a conversation's labels",
                "description": "The list you pass is the desired end state, not a toggle: missing labels are added, labels not named are removed. Sending the same request twice therefore changes nothing. A label that does not belong to this inbox is rejected with HTTP 422.",
                "tags": [
                    "conversations"
                ],
                "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": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "labels": [
                                            {
                                                "uuid": "e9b3f7a1-40cd-4b52-9d18-6a0c2f5e7b33",
                                                "name": "Dringend",
                                                "color": 3
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "label_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "List of label UUIDs, at most 50. An empty list removes all labels."
                                    }
                                },
                                "required": [
                                    "label_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/links": {
            "put": {
                "operationId": "flowsupport-conversations-links",
                "summary": "Set the CRM links",
                "description": "Links the conversation to a client, project, contact or lead. A field you leave out stays unchanged, an explicit null removes the link. A record this key may not link is rejected with HTTP 422 instead of silently doing nothing.",
                "tags": [
                    "conversations"
                ],
                "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": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "linked_client_uuid": "b7d1e4f0-3a92-4c58-88b1-2f6d0a9c4e71",
                                        "linked_project_uuid": null,
                                        "linked_contact_uuid": null,
                                        "linked_lead_uuid": null
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "CRM client, or null to remove."
                                    },
                                    "project_uuid": {
                                        "type": "string",
                                        "description": "Project of the linked client, or null."
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "CRM contact, or null."
                                    },
                                    "lead_uuid": {
                                        "type": "string",
                                        "description": "Lead, or null."
                                    },
                                    "prefer": {
                                        "type": "string",
                                        "description": "client or lead. Decides which side wins if both are set. Default is client."
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/read": {
            "post": {
                "operationId": "flowsupport-conversations-read",
                "summary": "Mark a conversation as read",
                "description": "Sets the read position to the newest message. The response states the remaining number of unread messages.",
                "tags": [
                    "conversations"
                ],
                "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": {
                                        "unread_messages": 0
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/messages": {
            "get": {
                "operationId": "flowsupport-messages-index",
                "summary": "Get a conversation's history",
                "description": "The messages of a conversation, newest first. Channel-internal protocol lines do not appear, just as in the interface. Each message names its channel (channel: whatsapp or email). Emails also carry subject, from, to and cc (addresses as objects with email and name), your own emails additionally send_status. For WhatsApp messages these fields are null. The HTML content and the source of an email are returned by the two endpoints /messages/{uuid}/html and /messages/{uuid}/raw.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items 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": "2e8c1f04-77ab-4d39-9c52-0b4a6e3d15f7",
                                            "conversation_uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                            "from_me": false,
                                            "type": "chat",
                                            "body": "Guten Tag, ist meine Rechnung angekommen?",
                                            "revoked": false,
                                            "sender_uuid": "5d0a7e13-88f2-4c9b-a610-3e7b1d4c6f20",
                                            "sender_name": "Frau Müller",
                                            "attachments": [],
                                            "sent_at": "2026-09-20T15:02:00+02:00",
                                            "channel": "whatsapp",
                                            "subject": null,
                                            "from": null,
                                            "to": null,
                                            "cc": null,
                                            "send_status": null
                                        },
                                        {
                                            "uuid": "6a1f9d27-3c84-4e5b-b2a0-9d7e4c1f8b63",
                                            "conversation_uuid": "e4c2a7f1-5b98-4d03-8e16-2f9a0c7b3d54",
                                            "from_me": false,
                                            "type": "email",
                                            "body": "Hallo, wann kommt die Rechnung?",
                                            "revoked": false,
                                            "sender_uuid": "7b3e1c90-4d26-4a8f-9e51-0c6d2b8a4f17",
                                            "sender_name": "Klara Kundin",
                                            "attachments": [],
                                            "sent_at": "2026-09-20T14:40:00+02:00",
                                            "channel": "email",
                                            "subject": "Frage zur Rechnung",
                                            "from": {
                                                "email": "kundin@kunde.example",
                                                "name": "Klara Kundin"
                                            },
                                            "to": [
                                                {
                                                    "email": "support@firma.example",
                                                    "name": null
                                                }
                                            ],
                                            "cc": [],
                                            "send_status": null
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 50,
                                        "total": 2,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsupport-messages-store",
                "summary": "Send a reply",
                "description": "WhatsApp: puts a reply into the delivery queue and answers with HTTP 202. Text and files each become their own item. Email: hands the reply straight to the sending of the email account and answers with HTTP 202 and your own message ({\"success\": true, \"data\": {\"channel\": \"email\", \"message_uuid\": \"...\", \"subject\": \"Re: Frage zur Rechnung\", \"send_status\": \"queued\", \"message\": {...}}}); message has the shape of a history item. Without recipients in to, a reply goes to Reply-To, otherwise to the sender of the newest message. \"Reply all\" adds the other recipients from To and Cc; your own addresses are always dropped. If reply_all is missing, the inbox default applies. Without subject the subject is derived from the conversation (\"Re:\" or \"Fwd:\"). If no sending is set up for the account, the call answers with HTTP 422 and the code sending_not_configured. Files come as multipart/form-data or as UUIDs of pre-uploaded files; an address chosen by the caller is never fetched.",
                "tags": [
                    "messages"
                ],
                "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": {
                                        "submission_uuid": "8b4d2c70-19ae-4f63-b0d5-7c3e1a9f6042",
                                        "items": [
                                            {
                                                "uuid": "f0a6d329-5b17-41e8-9c2d-8e4b7a0f3512",
                                                "kind": "text",
                                                "position": 0,
                                                "status": "pending",
                                                "status_label": "In der Warteschlange",
                                                "body": "Guten Tag, wir kümmern uns darum.",
                                                "attachment": null,
                                                "expires_at": "2026-09-20T19:02:00+02:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "body": {
                                        "type": "string",
                                        "description": "WhatsApp: the text, at most 5000 characters, required if no file is sent. Email: equivalent to text."
                                    },
                                    "html": {
                                        "type": "string",
                                        "description": "Email only: the content as HTML, at most 200,000 characters. Sanitised before sending (no scripts, no active content). Not together with text or body. One of html, text or body is required, except for files or a forward."
                                    },
                                    "text": {
                                        "type": "string",
                                        "description": "Email only: the content as plain text, at most 100,000 characters. Line breaks are kept."
                                    },
                                    "subject": {
                                        "type": "string",
                                        "description": "Email only: your own subject, at most 998 characters; line breaks become spaces. Without it, the derived subject applies."
                                    },
                                    "to": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Email only: additional recipients of a reply, or the recipients of a forward (then required). At most 50 valid addresses."
                                    },
                                    "cc": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Email only: recipients in copy, at most 50 valid addresses."
                                    },
                                    "bcc": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Email only: recipients in blind copy, at most 50 valid addresses."
                                    },
                                    "reply_all": {
                                        "type": "boolean",
                                        "description": "Email only: reply to all. Without it, the inbox default applies. Not together with forward_of."
                                    },
                                    "forward_of": {
                                        "type": "string",
                                        "description": "Email only: UUID of a message in the same conversation that is forwarded, including its attachments. A message from another conversation is rejected with HTTP 422."
                                    },
                                    "attachments": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "binary"
                                        },
                                        "description": "WhatsApp: up to five files, email: up to ten. At most 25 MB each, only the file types named in the overview."
                                    },
                                    "upload_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs of pre-uploaded files of this inbox, in sending order. Together with attachments at most five (WhatsApp) or ten (email)."
                                    },
                                    "request_id": {
                                        "type": "string",
                                        "description": "UUID for safe retries. The same request with the same value returns the original submission instead of sending a second time."
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/messages/{outboundUuid}/retry": {
            "post": {
                "operationId": "flowsupport-messages-retry",
                "summary": "Retry a delivery",
                "description": "Puts a failed or expired item back into the queue. An item in any other state is rejected with HTTP 409.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "outboundUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Erneuter Zustellversuch angestoßen.",
                                    "data": {
                                        "uuid": "f0a6d329-5b17-41e8-9c2d-8e4b7a0f3512",
                                        "status": "pending"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/messages/{outboundUuid}/cancel": {
            "post": {
                "operationId": "flowsupport-messages-cancel",
                "summary": "Cancel a delivery",
                "description": "Cancels an item that has not been sent yet. An item that has already been delivered is rejected with HTTP 409.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "outboundUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Ausgehende Nachricht abgebrochen.",
                                    "data": {
                                        "uuid": "f0a6d329-5b17-41e8-9c2d-8e4b7a0f3512",
                                        "status": "cancelled"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/messages/search": {
            "get": {
                "operationId": "flowsupport-messages-search",
                "summary": "Search messages",
                "description": "Full-text search across the message texts of all reachable inboxes. Search terms under three characters are not in the index and return nothing. If the index is unavailable, the response reports available: false instead of an error.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "description": "The search term.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Hits 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,
                                    "available": true,
                                    "data": [
                                        {
                                            "uuid": "2e8c1f04-77ab-4d39-9c52-0b4a6e3d15f7",
                                            "conversation_uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                            "body": "Die Rechnung liegt bei.",
                                            "sent_at": "2026-09-20T15:02:00+02:00"
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 50,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/messages/{uuid}/attachments/{attachmentUuid}/download": {
            "get": {
                "operationId": "flowsupport-messages-attachment-download",
                "summary": "Get an attachment",
                "description": "Returns a time-limited address for an attachment's file, valid for 15 minutes. The attachment of a revoked message answers with HTTP 404.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "attachmentUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "variant",
                        "in": "query",
                        "required": false,
                        "description": "original, thumb or playback. Default is original; if the requested version is missing, the original is returned.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "url": "https://media.example.com/9d2f4c1a/attachments/bild.jpg?signature=...",
                                        "expires_in": 900,
                                        "mime_type": "image/jpeg",
                                        "filename": "bild.jpg"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/messages/{uuid}/html": {
            "get": {
                "operationId": "flowsupport-messages-html",
                "summary": "Get an email's HTML content",
                "description": "Returns the sanitised HTML content of an email as a standalone document (Content-Type: text/html; charset=utf-8). A strict Content Security Policy prevents scripts, forms, embedding in other sites and any reloading, including external images. If the HTML content is too large to store, the document contains the full text. A WhatsApp message answers with HTTP 404.",
                "tags": [
                    "messages"
                ],
                "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"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/messages/{uuid}/raw": {
            "get": {
                "operationId": "flowsupport-messages-raw",
                "summary": "Download an email's source",
                "description": "Downloads the original message in RFC 822 format (Content-Type: message/rfc822, file name .eml). For your own email, this is the version that was sent until it has been matched with the \"Sent\" folder. A WhatsApp message, or a message without stored source, answers with HTTP 404.",
                "tags": [
                    "messages"
                ],
                "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"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/uploads": {
            "post": {
                "operationId": "flowsupport-uploads-store",
                "summary": "Pre-upload a file",
                "description": "Accepts a file as multipart/form-data and keeps it ready for this inbox for 60 minutes. The returned uuid is named under upload_uuids when sending or on a note. Requires at least the reply level. The sending limits apply: at most 25 MB and the file types named in the overview. Uploading the same file again returns the same item.",
                "tags": [
                    "messages"
                ],
                "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": "3f9a1c52-6d0e-4b87-a2f4-1c7e9b5d0a36",
                                        "inbox_uuid": "9d2f4c1a-6b3e-4a17-8f0d-2c5b7e9a1f34",
                                        "filename": "angebot.pdf",
                                        "mime_type": "application/pdf",
                                        "size": 184223,
                                        "expired": false,
                                        "expires_at": "2026-09-20T16:02:00+02:00"
                                    }
                                }
                            }
                        }
                    },
                    "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."
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/uploads/inline": {
            "post": {
                "operationId": "flowsupport-uploads-store-inline",
                "summary": "Pre-upload a small file as Base64",
                "description": "Like the multipart upload, but with the content as Base64 in a JSON body. Meant for callers without multipart. The file type is detected from the content, not the name. The size is limited to about 2.8 MB; larger files go through the multipart upload.",
                "tags": [
                    "messages"
                ],
                "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": "3f9a1c52-6d0e-4b87-a2f4-1c7e9b5d0a36",
                                        "inbox_uuid": "9d2f4c1a-6b3e-4a17-8f0d-2c5b7e9a1f34",
                                        "filename": "foto.jpg",
                                        "mime_type": "image/jpeg",
                                        "size": 48211,
                                        "expired": false,
                                        "expires_at": "2026-09-20T16:02:00+02:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "filename": {
                                        "type": "string",
                                        "description": "The file name as the recipient should see it, at most 180 characters."
                                    },
                                    "content_base64": {
                                        "type": "string",
                                        "description": "The file content as standard Base64. A data: prefix and whitespace are allowed."
                                    }
                                },
                                "required": [
                                    "filename",
                                    "content_base64"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/uploads/{uuid}": {
            "get": {
                "operationId": "flowsupport-uploads-show",
                "summary": "View a pre-uploaded file",
                "description": "Name, type, size and expiry of a pre-uploaded file. Only whoever uploaded it can see it; everyone else gets HTTP 404.",
                "tags": [
                    "messages"
                ],
                "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": "3f9a1c52-6d0e-4b87-a2f4-1c7e9b5d0a36",
                                        "filename": "angebot.pdf",
                                        "mime_type": "application/pdf",
                                        "size": 184223,
                                        "expired": false,
                                        "expires_at": "2026-09-20T16:02:00+02:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsupport-uploads-destroy",
                "summary": "Discard a pre-uploaded file",
                "description": "Removes a pre-uploaded file immediately instead of waiting for it to expire. Items already queued and notes already written are not affected.",
                "tags": [
                    "messages"
                ],
                "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": "Datei verworfen."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/number-lookups/{uuid}": {
            "get": {
                "operationId": "flowsupport-number-lookups-show",
                "summary": "Get the state of a number lookup",
                "description": "The state of a lookup that starting a conversation created with HTTP 202. As long as open is true, the listener is still working on it. As soon as a conversation has been created, conversation_uuid names it.",
                "tags": [
                    "messages"
                ],
                "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": "a4f7c2b8-1d09-4e66-b3a1-7c5f2e0d9b44",
                                        "status": "resolved",
                                        "number": "+4915112345678",
                                        "open": false,
                                        "conversation_uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "error_code": null
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/notes": {
            "get": {
                "operationId": "flowsupport-notes-index",
                "summary": "List a conversation's notes",
                "description": "The internal notes of a conversation, newest first.",
                "tags": [
                    "notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items 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": "6c2f9b81-3e07-4a5d-9210-8f4b7c0e2d63",
                                            "conversation_uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                            "note": "Kundin ruft morgen zurück.",
                                            "author_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                            "author_name": "Anna Berger",
                                            "attachments": [],
                                            "edited_at": null,
                                            "created_at": "2026-09-20T15:10:00+02:00"
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 50,
                                        "total": 1,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsupport-notes-store",
                "summary": "Write a note",
                "description": "Creates an internal note with text, files or both. Requires at least the reply level on the inbox. Files are uploaded beforehand and named here by their UUIDs. If a file could not be stored, this is listed under warnings.",
                "tags": [
                    "notes"
                ],
                "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": "6c2f9b81-3e07-4a5d-9210-8f4b7c0e2d63",
                                        "note": "Kundin ruft morgen zurück.",
                                        "author_name": "Anna Berger",
                                        "created_at": "2026-09-20T15:10:00+02:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "description": "The text, at most 5000 characters. Required if no file is named."
                                    },
                                    "upload_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs of pre-uploaded files of this inbox, at most five. Videos are not allowed on notes."
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/notes/{noteUuid}": {
            "patch": {
                "operationId": "flowsupport-notes-update",
                "summary": "Change a note",
                "description": "Rewrites a note. Only the person who wrote it may do so; everyone else gets HTTP 403.",
                "tags": [
                    "notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "noteUuid",
                        "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": "6c2f9b81-3e07-4a5d-9210-8f4b7c0e2d63",
                                        "note": "Kundin ruft übermorgen zurück.",
                                        "edited_at": "2026-09-20T16:00:00+02:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "description": "The new text, at most 5000 characters."
                                    }
                                },
                                "required": [
                                    "note"
                                ]
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsupport-notes-destroy",
                "summary": "Remove a note",
                "description": "Removes a note. The author may do so, and so may the inbox owner.",
                "tags": [
                    "notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "noteUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Notiz entfernt."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/labels": {
            "get": {
                "operationId": "flowsupport-labels-index",
                "summary": "List labels",
                "description": "The labels of all reachable inboxes, alphabetically.",
                "tags": [
                    "catalogs"
                ],
                "parameters": [
                    {
                        "name": "inbox_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Limit to one inbox.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "e9b3f7a1-40cd-4b52-9d18-6a0c2f5e7b33",
                                            "name": "Dringend",
                                            "color": 3,
                                            "inbox_uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsupport-labels-store",
                "summary": "Create a label",
                "description": "Creates a label in an inbox. Requires at least the reply level. If syncing with WhatsApp is active, the maximum of 20 labels per inbox applies.",
                "tags": [
                    "catalogs"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "e9b3f7a1-40cd-4b52-9d18-6a0c2f5e7b33",
                                        "name": "Dringend",
                                        "color": 3
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "inbox_uuid": {
                                        "type": "string",
                                        "description": "The inbox the label belongs to."
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "The name, at most 100 characters."
                                    },
                                    "color": {
                                        "type": "integer",
                                        "description": "The colour from the channel's palette, 0 to 19."
                                    }
                                },
                                "required": [
                                    "inbox_uuid",
                                    "name",
                                    "color"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/labels/{uuid}": {
            "patch": {
                "operationId": "flowsupport-labels-update",
                "summary": "Rename or recolour a label",
                "description": "Changes name and colour. A label's inbox cannot be changed.",
                "tags": [
                    "catalogs"
                ],
                "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": "e9b3f7a1-40cd-4b52-9d18-6a0c2f5e7b33",
                                        "name": "Eilig",
                                        "color": 5
                                    }
                                }
                            }
                        }
                    },
                    "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": "The name, at most 100 characters."
                                    },
                                    "color": {
                                        "type": "integer",
                                        "description": "The colour, 0 to 19."
                                    }
                                },
                                "required": [
                                    "name",
                                    "color"
                                ]
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsupport-labels-destroy",
                "summary": "Delete a label",
                "description": "Deletes the label and removes it from all conversations of the inbox.",
                "tags": [
                    "catalogs"
                ],
                "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": "Label gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/templates": {
            "get": {
                "operationId": "flowsupport-templates-index",
                "summary": "List reply templates",
                "description": "The visible text snippets, most used first. may_edit says whether this key may also change the template.",
                "tags": [
                    "catalogs"
                ],
                "parameters": [
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items 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": "1a7e5c93-6b20-4d18-8f45-9c0d3e7a2b61",
                                            "name": "Begrüßung",
                                            "content": "Guten Tag, wie können wir helfen?",
                                            "is_private": false,
                                            "inbox_uuid": null,
                                            "usage_count": 12,
                                            "author_name": "Anna Berger",
                                            "may_edit": 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"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsupport-templates-store",
                "summary": "Create a reply template",
                "description": "Creates a text snippet. Without inbox_uuid it applies team-wide. Binding it to an inbox requires at least the reply level on exactly that inbox.",
                "tags": [
                    "catalogs"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "1a7e5c93-6b20-4d18-8f45-9c0d3e7a2b61",
                                        "name": "Begrüßung",
                                        "content": "Guten Tag, wie können wir helfen?",
                                        "is_private": false,
                                        "may_edit": true
                                    }
                                }
                            }
                        }
                    },
                    "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": "The name, at most 120 characters."
                                    },
                                    "content": {
                                        "type": "string",
                                        "description": "The text, at most 5000 characters."
                                    },
                                    "is_private": {
                                        "type": "boolean",
                                        "description": "true keeps the template with its author. Default is false."
                                    },
                                    "inbox_uuid": {
                                        "type": "string",
                                        "description": "Binds the template to an inbox."
                                    }
                                },
                                "required": [
                                    "name",
                                    "content"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/templates/{uuid}": {
            "patch": {
                "operationId": "flowsupport-templates-update",
                "summary": "Change a reply template",
                "description": "Writes name, text and visibility together. The author may change it, and so may the team owner. A template's inbox cannot be changed.",
                "tags": [
                    "catalogs"
                ],
                "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": "1a7e5c93-6b20-4d18-8f45-9c0d3e7a2b61",
                                        "name": "Begrüßung kurz",
                                        "content": "Guten Tag.",
                                        "may_edit": true
                                    }
                                }
                            }
                        }
                    },
                    "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": "The name, at most 120 characters."
                                    },
                                    "content": {
                                        "type": "string",
                                        "description": "The text, at most 5000 characters."
                                    },
                                    "is_private": {
                                        "type": "boolean",
                                        "description": "Visibility. Without it, the previous value stays."
                                    }
                                },
                                "required": [
                                    "name",
                                    "content"
                                ]
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsupport-templates-destroy",
                "summary": "Delete a reply template",
                "description": "Deletes the text snippet. The same rights apply as for changing it.",
                "tags": [
                    "catalogs"
                ],
                "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": "Vorlage gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/reports/open": {
            "get": {
                "operationId": "flowsupport-reports-open",
                "summary": "Open conversations",
                "description": "What is still waiting for a reply: the number of open conversations, how many of them are unassigned, and the twenty most recently active as a list.",
                "tags": [
                    "reports"
                ],
                "parameters": [
                    {
                        "name": "inbox_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Limit to one inbox.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "open": 7,
                                        "unassigned": 3,
                                        "conversations": [
                                            {
                                                "uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                                "name": "Frau Müller",
                                                "status": "open",
                                                "last_message_at": "2026-09-20T15:02:00+02:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/reports/assignments": {
            "get": {
                "operationId": "flowsupport-reports-assignments",
                "summary": "Assignments",
                "description": "Who carries how many open conversations, and how many of them fall to your own key. The row with user_uuid null collects the unassigned ones.",
                "tags": [
                    "reports"
                ],
                "parameters": [
                    {
                        "name": "inbox_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Limit to one inbox.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "mine": 2,
                                        "assignments": [
                                            {
                                                "user_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                                "name": "Anna Berger",
                                                "open": 2
                                            },
                                            {
                                                "user_uuid": null,
                                                "name": null,
                                                "open": 3
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/reports/outbound": {
            "get": {
                "operationId": "flowsupport-reports-outbound",
                "summary": "Delivery queue",
                "description": "The number of items per delivery state, so that a reply that has not been delivered yet is visible before another one is written. Message texts are not included.",
                "tags": [
                    "reports"
                ],
                "parameters": [
                    {
                        "name": "inbox_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Limit to one inbox.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "queue": {
                                            "pending": 2,
                                            "failed": 1
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "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"
                    }
                }
            }
        }
    }
}