{
    "openapi": "3.1.0",
    "info": {
        "title": "FlowSaaS API",
        "version": "v1",
        "description": "REST API for the feedback portals: portals and their branding, statuses and tags, ideas with votes and comments, the published roadmap and the webhooks."
    },
    "servers": [
        {
            "url": "https://api.flowsuite.one",
            "description": "FlowSuite API"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "context",
            "description": "Overview and reports"
        },
        {
            "name": "portals",
            "description": "Portals"
        },
        {
            "name": "vocabulary",
            "description": "Statuses and tags"
        },
        {
            "name": "posts",
            "description": "Ideas"
        },
        {
            "name": "comments",
            "description": "Comments"
        },
        {
            "name": "roadmap",
            "description": "Roadmap"
        },
        {
            "name": "webhooks",
            "description": "Webhooks"
        }
    ],
    "paths": {
        "/flowsaas/context": {
            "get": {
                "operationId": "flowsaas-context",
                "summary": "Get portals, vocabulary and own permissions",
                "description": "Returns all of the team's portals with statuses, tags and open moderation counts, plus the possible moderation states, the available webhook events and whether this key has the manager permission.",
                "tags": [
                    "context"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "is_manager": true,
                                        "moderation_states": [
                                            "pending",
                                            "approved",
                                            "rejected",
                                            "spam"
                                        ],
                                        "webhook_events": [
                                            "post.created",
                                            "post.status_changed",
                                            "post.updated",
                                            "comment.created",
                                            "vote.created"
                                        ],
                                        "portals": [
                                            {
                                                "uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                                "name": "Produktfeedback",
                                                "public_url": "https://creativeskyline.de/p/produktfeedback",
                                                "statuses": [],
                                                "tags": [],
                                                "pending_posts": 2,
                                                "pending_comments": 0
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/reports/moderation": {
            "get": {
                "operationId": "flowsaas-reports-moderation",
                "summary": "Get open moderation",
                "description": "Counts the waiting ideas and comments across all of the team's portals and returns up to twenty of each, newest first.",
                "tags": [
                    "context"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "pending_posts": 2,
                                        "pending_comments": 1,
                                        "posts": [],
                                        "comments": []
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/reports/top-ideas": {
            "get": {
                "operationId": "flowsaas-reports-top-ideas",
                "summary": "Get the most popular ideas",
                "description": "The twenty approved ideas with the most votes. Merged ideas are left out; their votes count towards the idea they were merged into.",
                "tags": [
                    "context"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "ideas": [
                                            {
                                                "uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                                "title": "Dunkelmodus",
                                                "votes_count": 42
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/reports/roadmap": {
            "get": {
                "operationId": "flowsaas-reports-roadmap",
                "summary": "Get the published roadmap",
                "description": "The first fifty roadmap items of all portals in their published order, each with the title, column and vote count of the idea behind it.",
                "tags": [
                    "context"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "items": [
                                            {
                                                "uuid": "5f1e7b90-2c44-4a19-9f3d-7c8b1a2e6d05",
                                                "title": "Dunkelmodus",
                                                "status_name": "In Arbeit",
                                                "votes_count": 42,
                                                "sort_order": 0
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/reports/activity": {
            "get": {
                "operationId": "flowsaas-reports-activity",
                "summary": "Get activity of the last 30 days",
                "description": "Counts new ideas and comments of the last thirty days and returns the ten most recent ideas.",
                "tags": [
                    "context"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "window_days": 30,
                                        "new_ideas": 7,
                                        "new_comments": 12,
                                        "latest": []
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/portals": {
            "get": {
                "operationId": "flowsaas-portals-index",
                "summary": "List portals",
                "description": "All of the team's portals, newest first, with the number of their ideas and of the waiting posts.",
                "tags": [
                    "portals"
                ],
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Searches the portal's name and address.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "required": false,
                        "description": "Only active or only inactive portals.",
                        "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": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                            "name": "Produktfeedback",
                                            "slug": "produktfeedback",
                                            "public_url": "https://creativeskyline.de/p/produktfeedback",
                                            "is_public": true,
                                            "is_active": true,
                                            "tag_limit": 3,
                                            "posts_count": 18,
                                            "pending_posts_count": 2
                                        }
                                    ],
                                    "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": "flowsaas-portals-store",
                "summary": "Create a portal",
                "description": "Creates a portal in the team of the API key, including the five default statuses and the four default tags. Requires the manager permission.",
                "tags": [
                    "portals"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                        "name": "Produktfeedback",
                                        "slug": "produktfeedback",
                                        "is_public": true,
                                        "is_active": 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": "Display name, at least three characters."
                                    },
                                    "slug": {
                                        "type": "string",
                                        "description": "Public address under /p/. Must be unique across the installation; derived from the name if omitted."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Short description for the portal page."
                                    },
                                    "is_public": {
                                        "type": "boolean",
                                        "description": "Whether the portal is publicly reachable. Default true."
                                    },
                                    "subdomain": {
                                        "type": "string",
                                        "description": "Own subdomain, stored only; the portal is currently reachable only under /p/. Defaults to the slug."
                                    },
                                    "default_language": {
                                        "type": "string",
                                        "description": "de, en or pt. Default de."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/portals/{uuid}": {
            "get": {
                "operationId": "flowsaas-portals-show",
                "summary": "Get a portal",
                "description": "A portal with its statuses, its tags and the open moderation counts.",
                "tags": [
                    "portals"
                ],
                "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": "Produktfeedback",
                                        "statuses": [],
                                        "tags": [],
                                        "pending_posts": 2,
                                        "pending_comments": 0
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "flowsaas-portals-update",
                "summary": "Update a portal",
                "description": "Changes the fields sent; everything else stays untouched. If the request contains is_public, is_active or seo_indexable, the manager permission is required.",
                "tags": [
                    "portals"
                ],
                "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": "Produktwünsche",
                                        "tag_limit": 3
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Display name."
                                    },
                                    "slug": {
                                        "type": "string",
                                        "description": "Public address. Changing it breaks existing links."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Short description."
                                    },
                                    "is_public": {
                                        "type": "boolean",
                                        "description": "Public reachability. Manager permission required."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Switch the portal on or off. Manager permission required."
                                    },
                                    "seo_indexable": {
                                        "type": "boolean",
                                        "description": "Indexing by search engines. Manager permission required."
                                    },
                                    "subdomain": {
                                        "type": "string",
                                        "description": "Own subdomain. Stored only, no effect at the moment."
                                    },
                                    "custom_domain": {
                                        "type": "string",
                                        "description": "Own domain. Stored only, no effect at the moment."
                                    },
                                    "dark_mode_enabled": {
                                        "type": "boolean",
                                        "description": "Dark mode in the portal."
                                    },
                                    "default_language": {
                                        "type": "string",
                                        "description": "de, en or pt."
                                    },
                                    "voting_without_auth": {
                                        "type": "boolean",
                                        "description": "Allow voting without signing in."
                                    },
                                    "post_approval_required": {
                                        "type": "boolean",
                                        "description": "Show new ideas only after approval."
                                    },
                                    "comment_approval_required": {
                                        "type": "boolean",
                                        "description": "Show new comments only after approval."
                                    },
                                    "allow_anonymous_read": {
                                        "type": "boolean",
                                        "description": "Allow reading without signing in. Stored only; the portal is currently always readable without signing in."
                                    },
                                    "lock_completed_ideas": {
                                        "type": "boolean",
                                        "description": "Lock completed ideas for votes and comments."
                                    },
                                    "tag_limit": {
                                        "type": "integer",
                                        "description": "Maximum number of tags per idea. 0 means no limit."
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsaas-portals-destroy",
                "summary": "Delete a portal",
                "description": "Deletes the portal with all ideas, votes, comments, statuses, tags, roadmap items and webhooks. Requires the manager permission and cannot be undone.",
                "tags": [
                    "portals"
                ],
                "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": "Portal \"Produktfeedback\" gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/portals/{uuid}/toggle-active": {
            "post": {
                "operationId": "flowsaas-portals-toggle-active",
                "summary": "Switch a portal on or off",
                "description": "Flips the is_active switch without changing anything else in the portal. Requires the manager permission.",
                "tags": [
                    "portals"
                ],
                "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",
                                        "is_active": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/portals/{uuid}/delete-all-ideas": {
            "post": {
                "operationId": "flowsaas-portals-delete-all-ideas",
                "summary": "Delete all ideas of a portal",
                "description": "Deletes every idea of the portal with its votes, comments, history and roadmap items. The portal itself and its vocabulary remain. Requires the manager permission and cannot be undone.",
                "tags": [
                    "portals"
                ],
                "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": {
                                        "deleted_posts": 18
                                    },
                                    "message": "Alle Ideen dieses Portals wurden gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/portals/{uuid}/company": {
            "get": {
                "operationId": "flowsaas-portals-company-show",
                "summary": "Get branding",
                "description": "Logos, colours and display name of the portal. A portal without branding responds with its UUID and otherwise empty fields.",
                "tags": [
                    "portals"
                ],
                "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": {
                                        "portal_uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                        "name": "Creative Skyline",
                                        "logo_url": "https://creativeskyline.de/storage/portals/logos/logo.png",
                                        "primary_color": "#6392D9"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "flowsaas-portals-company-update",
                "summary": "Update branding",
                "description": "Writes the fields sent and creates the record on the first change. The image fields expect finished URLs; the API does not download any file itself.",
                "tags": [
                    "portals"
                ],
                "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": {
                                        "portal_uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                        "name": "Creative Skyline",
                                        "primary_color": "#6392D9"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name shown in the portal header."
                                    },
                                    "logo_url": {
                                        "type": "string",
                                        "description": "URL of the logo for light mode."
                                    },
                                    "logo_dark_url": {
                                        "type": "string",
                                        "description": "URL of the logo for dark mode."
                                    },
                                    "logo_landscape_url": {
                                        "type": "string",
                                        "description": "URL of the landscape logo."
                                    },
                                    "logo_landscape_dark_url": {
                                        "type": "string",
                                        "description": "URL of the landscape logo for dark mode."
                                    },
                                    "logo_layout_mode": {
                                        "type": "string",
                                        "description": "square or landscape."
                                    },
                                    "logo_display_mode": {
                                        "type": "string",
                                        "description": "logo_and_name or logo_only."
                                    },
                                    "logo_link": {
                                        "type": "string",
                                        "description": "Target the logo links to."
                                    },
                                    "favicon_url": {
                                        "type": "string",
                                        "description": "URL of the favicon."
                                    },
                                    "open_graph_image_url": {
                                        "type": "string",
                                        "description": "URL of the preview image for social networks."
                                    },
                                    "primary_color": {
                                        "type": "string",
                                        "description": "Accent colour as a hex value, for example #6392D9."
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/portals/{uuid}/statuses": {
            "get": {
                "operationId": "flowsaas-portals-statuses-index",
                "summary": "List a portal's statuses",
                "description": "All statuses of the portal in their own order. The list is not paginated; it is always complete.",
                "tags": [
                    "vocabulary"
                ],
                "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": "3a7c2f11-8b4e-4d62-9a05-1c6e8f0b2d43",
                                            "name": "Feedback",
                                            "color": "#6392D9",
                                            "is_completed": false,
                                            "sort_order": 1
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsaas-portals-statuses-store",
                "summary": "Create a status",
                "description": "Appends a status to the end of the portal's list.",
                "tags": [
                    "vocabulary"
                ],
                "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": "3a7c2f11-8b4e-4d62-9a05-1c6e8f0b2d43",
                                        "name": "Wird geprüft",
                                        "sort_order": 6
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Display name of the status."
                                    },
                                    "color": {
                                        "type": "string",
                                        "description": "Colour as a six-digit hex value, for example #6392D9."
                                    },
                                    "is_completed": {
                                        "type": "boolean",
                                        "description": "Marks the status as completed. Together with lock_completed_ideas it locks votes and comments."
                                    },
                                    "sort_order": {
                                        "type": "integer",
                                        "description": "Position in the list. Appended to the end if omitted."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/portals/{uuid}/statuses/reorder": {
            "post": {
                "operationId": "flowsaas-portals-statuses-reorder",
                "summary": "Reorder statuses",
                "description": "Sets the order of the portal's statuses to the list sent. UUIDs of other portals of the same team are skipped.",
                "tags": [
                    "vocabulary"
                ],
                "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": "3a7c2f11-8b4e-4d62-9a05-1c6e8f0b2d43",
                                            "name": "Fertig",
                                            "sort_order": 1
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "The status UUIDs in the desired order."
                                    }
                                },
                                "required": [
                                    "status_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/statuses/{uuid}": {
            "put": {
                "operationId": "flowsaas-statuses-update",
                "summary": "Update a status",
                "description": "Changes the name, colour, completed flag or position of a status.",
                "tags": [
                    "vocabulary"
                ],
                "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": "3a7c2f11-8b4e-4d62-9a05-1c6e8f0b2d43",
                                        "name": "In Prüfung",
                                        "color": "#10B981",
                                        "is_completed": true
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Display name."
                                    },
                                    "color": {
                                        "type": "string",
                                        "description": "Six-digit hex value."
                                    },
                                    "is_completed": {
                                        "type": "boolean",
                                        "description": "Completed flag."
                                    },
                                    "sort_order": {
                                        "type": "integer",
                                        "description": "Position in the list."
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsaas-statuses-destroy",
                "summary": "Delete a status",
                "description": "Deletes the status and moves every idea that had it to the first remaining status of the portal. Requires the manager permission.",
                "tags": [
                    "vocabulary"
                ],
                "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": "Status gelöscht; betroffene Ideen wurden umgehängt."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/portals/{uuid}/tags": {
            "get": {
                "operationId": "flowsaas-portals-tags-index",
                "summary": "List a portal's tags",
                "description": "All tags of the portal in their own order, including the withdrawn ones.",
                "tags": [
                    "vocabulary"
                ],
                "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": "b2d4e6f8-1a3c-4e5f-8907-abcdef012345",
                                            "name": "Bug 🐞",
                                            "is_active": true,
                                            "sort_order": 2
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsaas-portals-tags-store",
                "summary": "Create a tag",
                "description": "Appends a tag to the end of the portal's list.",
                "tags": [
                    "vocabulary"
                ],
                "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": "b2d4e6f8-1a3c-4e5f-8907-abcdef012345",
                                        "name": "Dokumentation",
                                        "is_active": 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": "Display name of the tag."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Explanation for the portal page."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Whether the tag is offered. Default true."
                                    },
                                    "sort_order": {
                                        "type": "integer",
                                        "description": "Position in the list. Appended to the end if omitted."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/portals/{uuid}/tags/reorder": {
            "post": {
                "operationId": "flowsaas-portals-tags-reorder",
                "summary": "Reorder tags",
                "description": "Sets the order of the portal's tags to the list sent. UUIDs of other portals of the same team are skipped.",
                "tags": [
                    "vocabulary"
                ],
                "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": "b2d4e6f8-1a3c-4e5f-8907-abcdef012345",
                                            "name": "Dokumentation",
                                            "sort_order": 1
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "The tag UUIDs in the desired order."
                                    }
                                },
                                "required": [
                                    "tag_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/tags/{uuid}": {
            "put": {
                "operationId": "flowsaas-tags-update",
                "summary": "Update a tag",
                "description": "Changes the name, explanation, position or whether the tag is still offered. A withdrawn tag stays on every idea that has it.",
                "tags": [
                    "vocabulary"
                ],
                "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": "b2d4e6f8-1a3c-4e5f-8907-abcdef012345",
                                        "is_active": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Display name."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Explanation."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Whether the tag is offered."
                                    },
                                    "sort_order": {
                                        "type": "integer",
                                        "description": "Position in the list."
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsaas-tags-destroy",
                "summary": "Delete a tag",
                "description": "Deletes the tag; it is removed from every idea that had it. Requires the manager permission.",
                "tags": [
                    "vocabulary"
                ],
                "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": "Schlagwort gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/posts": {
            "get": {
                "operationId": "flowsaas-posts-index",
                "summary": "List ideas",
                "description": "The ideas of all of the team's portals. Merged ideas are left out unless include_merged is set.",
                "tags": [
                    "posts"
                ],
                "parameters": [
                    {
                        "name": "portal_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Limit to one portal.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Only ideas in this status.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tag_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Only ideas with this tag.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "moderation_status",
                        "in": "query",
                        "required": false,
                        "description": "pending, approved, rejected or spam.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Searches the idea's title and text.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "is_private",
                        "in": "query",
                        "required": false,
                        "description": "Only hidden or only visible ideas.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "is_on_roadmap",
                        "in": "query",
                        "required": false,
                        "description": "Only ideas on the roadmap.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "include_merged",
                        "in": "query",
                        "required": false,
                        "description": "Include merged ideas.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "newest, oldest, votes or comments. Default newest.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "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",
                                            "portal_uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                            "title": "Dunkelmodus",
                                            "status_name": "Backlog",
                                            "moderation_status": "approved",
                                            "is_public": true,
                                            "votes_count": 42,
                                            "comments_count": 3,
                                            "author_name": "Sascha",
                                            "author_kind": "user"
                                        }
                                    ],
                                    "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": "flowsaas-posts-store",
                "summary": "Create an idea",
                "description": "Creates an idea in the given portal, attributed to the user of the API key and approved straight away. Without a status it lands in the portal's first status; without tags it gets the first tag on offer.",
                "tags": [
                    "posts"
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "title": "Dunkelmodus",
                                        "moderation_status": "approved",
                                        "author_kind": "user"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "portal_uuid": {
                                        "type": "string",
                                        "description": "The portal the idea is created in."
                                    },
                                    "title": {
                                        "type": "string",
                                        "description": "Title, at least three characters."
                                    },
                                    "body": {
                                        "type": "string",
                                        "description": "Description of the idea."
                                    },
                                    "status_uuid": {
                                        "type": "string",
                                        "description": "Status of the portal. A status of another portal is ignored."
                                    },
                                    "tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Tags of the portal. The portal's tag_limit applies."
                                    },
                                    "is_private": {
                                        "type": "boolean",
                                        "description": "Hide the idea from visitors."
                                    },
                                    "is_on_roadmap": {
                                        "type": "boolean",
                                        "description": "Also create a roadmap item."
                                    }
                                },
                                "required": [
                                    "portal_uuid",
                                    "title"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/posts/{uuid}": {
            "get": {
                "operationId": "flowsaas-posts-show",
                "summary": "Get an idea",
                "description": "An idea with its tags and its complete status history.",
                "tags": [
                    "posts"
                ],
                "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",
                                        "title": "Dunkelmodus",
                                        "tags": [],
                                        "status_history": [
                                            {
                                                "old_status": "Feedback",
                                                "new_status": "Backlog",
                                                "changed_by_name": "Sascha"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "flowsaas-posts-update",
                "summary": "Update an idea",
                "description": "Changes the fields sent. The status is not one of them; it has its own endpoint. An empty tag_uuids list removes all tags.",
                "tags": [
                    "posts"
                ],
                "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",
                                        "title": "Dunkelmodus, bitte",
                                        "tags": []
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Title."
                                    },
                                    "body": {
                                        "type": "string",
                                        "description": "Description."
                                    },
                                    "is_private": {
                                        "type": "boolean",
                                        "description": "Visibility for visitors."
                                    },
                                    "is_pinned": {
                                        "type": "boolean",
                                        "description": "Pin the idea to the top. Stored only; the portal does not use it at the moment."
                                    },
                                    "is_archived": {
                                        "type": "boolean",
                                        "description": "Archive the idea. Stored only; the portal does not use it at the moment."
                                    },
                                    "tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "The tags that should apply afterwards."
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsaas-posts-destroy",
                "summary": "Delete an idea",
                "description": "Deletes the idea with its votes, comments and history. Requires the manager permission.",
                "tags": [
                    "posts"
                ],
                "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": "Idee gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/posts/{uuid}/status": {
            "put": {
                "operationId": "flowsaas-posts-status-update",
                "summary": "Change the status of an idea",
                "description": "Moves the idea to another status of its own portal. Writes a history entry, triggers the portal webhooks and notifies all supporters. A status of another portal responds with HTTP 422 and error status_not_in_portal.",
                "tags": [
                    "posts"
                ],
                "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_uuid": "3a7c2f11-8b4e-4d62-9a05-1c6e8f0b2d43",
                                        "status_name": "In Arbeit"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status_uuid": {
                                        "type": "string",
                                        "description": "The new status, from the idea's portal."
                                    },
                                    "comment": {
                                        "type": "string",
                                        "description": "Reason recorded in the history."
                                    }
                                },
                                "required": [
                                    "status_uuid"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/posts/{uuid}/approve": {
            "post": {
                "operationId": "flowsaas-posts-approve",
                "summary": "Approve an idea",
                "description": "Approves a waiting idea for the portal and notifies its author. Requires the manager permission.",
                "tags": [
                    "posts"
                ],
                "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",
                                        "moderation_status": "approved"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/posts/{uuid}/reject": {
            "post": {
                "operationId": "flowsaas-posts-reject",
                "summary": "Reject an idea",
                "description": "Rejects an idea and notifies its author. The reason is stored with the idea; the notification itself contains a fixed standard sentence, not the reason. Requires the manager permission.",
                "tags": [
                    "posts"
                ],
                "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",
                                        "moderation_status": "rejected",
                                        "rejection_reason": "Doppelt vorhanden."
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "description": "Reason for the rejection."
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/posts/{uuid}/spam": {
            "post": {
                "operationId": "flowsaas-posts-spam",
                "summary": "Mark an idea as spam",
                "description": "Marks an idea as spam. Its author, if they confirmed their email address, receives a short notice that the post was flagged. Requires the manager permission.",
                "tags": [
                    "posts"
                ],
                "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",
                                        "moderation_status": "spam"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/posts/{uuid}/vote": {
            "post": {
                "operationId": "flowsaas-posts-vote-store",
                "summary": "Vote for an idea",
                "description": "Casts a vote on behalf of the user of the API key. A second vote by the same person is not an error: added is then false and the count stays the same.",
                "tags": [
                    "posts"
                ],
                "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": {
                                        "added": true,
                                        "votes_count": 43
                                    },
                                    "message": "Stimme abgegeben."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsaas-posts-vote-destroy",
                "summary": "Withdraw a vote",
                "description": "Withdraws the vote of the user of the API key. If there was none, removed is false.",
                "tags": [
                    "posts"
                ],
                "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": {
                                        "removed": true,
                                        "votes_count": 42
                                    },
                                    "message": "Stimme zurückgezogen."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/posts/{uuid}/toggle-private": {
            "post": {
                "operationId": "flowsaas-posts-toggle-private",
                "summary": "Hide or show an idea",
                "description": "Flips the visibility for portal visitors and reports the change to the portal webhooks.",
                "tags": [
                    "posts"
                ],
                "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",
                                        "is_private": true,
                                        "is_public": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/posts/{uuid}/merge": {
            "post": {
                "operationId": "flowsaas-posts-merge",
                "summary": "Merge an idea as a duplicate",
                "description": "Merges the idea from the path into the given target idea of the same portal. Votes and public comments move along; internal notes stay with the duplicate. The response shows the target idea.",
                "tags": [
                    "posts"
                ],
                "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": "d3e5f7a9-0b2c-4d6e-8f01-234567890abc",
                                        "votes_count": 45
                                    },
                                    "message": "Als Duplikat zusammengeführt."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "master_post_uuid": {
                                        "type": "string",
                                        "description": "The idea that remains. Must belong to the same portal and be a different idea."
                                    }
                                },
                                "required": [
                                    "master_post_uuid"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/posts/{uuid}/promote-to-roadmap": {
            "post": {
                "operationId": "flowsaas-posts-promote-to-roadmap",
                "summary": "Put an idea on the roadmap",
                "description": "Creates a roadmap item for the idea and marks it accordingly. If it is already on the roadmap, the route responds with HTTP 422 and error already_on_roadmap.",
                "tags": [
                    "posts"
                ],
                "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": "5f1e7b90-2c44-4a19-9f3d-7c8b1a2e6d05",
                                        "post_uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "title": "Dunkelmodus",
                                        "sort_order": 0
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/posts/{uuid}/similar": {
            "get": {
                "operationId": "flowsaas-posts-similar",
                "summary": "Get similar ideas",
                "description": "Up to ten approved, not completed ideas of the same portal with similar wording, those with the most votes first. The idea itself is not included. The same search the portal offers while someone is writing.",
                "tags": [
                    "posts"
                ],
                "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": "d3e5f7a9-0b2c-4d6e-8f01-234567890abc",
                                            "title": "Dunkelmodus wäre schön",
                                            "votes_count": 12
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/posts/{uuid}/comments": {
            "get": {
                "operationId": "flowsaas-posts-comments-index",
                "summary": "List the comments of an idea",
                "description": "All comments of the idea, oldest first, including internal notes and waiting posts.",
                "tags": [
                    "comments"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "moderation_status",
                        "in": "query",
                        "required": false,
                        "description": "pending, approved, rejected or spam.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "is_internal",
                        "in": "query",
                        "required": false,
                        "description": "Only internal notes or only public comments.",
                        "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": "7a9c1e35-4d68-4b02-9e7a-3f5c1d8b0e24",
                                            "post_uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                            "body": "Danke für den Hinweis.",
                                            "is_internal": false,
                                            "moderation_status": "approved",
                                            "author_kind": "user"
                                        }
                                    ],
                                    "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": "flowsaas-posts-comments-store",
                "summary": "Write a comment",
                "description": "Writes a comment on behalf of the user of the API key. It counts as approved straight away. A parent comment must belong to the same idea, otherwise the route responds with HTTP 422 and error parent_not_in_post.",
                "tags": [
                    "comments"
                ],
                "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": "7a9c1e35-4d68-4b02-9e7a-3f5c1d8b0e24",
                                        "body": "Danke für den Hinweis.",
                                        "is_internal": false,
                                        "moderation_status": "approved"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "body": {
                                        "type": "string",
                                        "description": "The text of the comment, at most 2000 characters."
                                    },
                                    "is_internal": {
                                        "type": "boolean",
                                        "description": "true turns it into a team note. Default false, so publicly visible."
                                    },
                                    "parent_comment_uuid": {
                                        "type": "string",
                                        "description": "The comment being replied to. Must belong to this idea."
                                    }
                                },
                                "required": [
                                    "body"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/comments/{uuid}/reply": {
            "post": {
                "operationId": "flowsaas-comments-reply",
                "summary": "Reply to a comment",
                "description": "Replies to the comment in the path. The idea follows from this comment, so a reply can never end up in someone else's thread.",
                "tags": [
                    "comments"
                ],
                "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": "8b0d2f46-5e79-4c13-8f0b-4a6d2e9c1f35",
                                        "parent_comment_uuid": "7a9c1e35-4d68-4b02-9e7a-3f5c1d8b0e24",
                                        "body": "Wir melden uns."
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "body": {
                                        "type": "string",
                                        "description": "The text of the reply, at most 2000 characters."
                                    },
                                    "is_internal": {
                                        "type": "boolean",
                                        "description": "true turns it into a team note."
                                    }
                                },
                                "required": [
                                    "body"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/comments/{uuid}/approve": {
            "post": {
                "operationId": "flowsaas-comments-approve",
                "summary": "Approve a comment",
                "description": "Approves a waiting comment for the portal and notifies its author. Requires the manager permission.",
                "tags": [
                    "comments"
                ],
                "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": "7a9c1e35-4d68-4b02-9e7a-3f5c1d8b0e24",
                                        "moderation_status": "approved"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/comments/{uuid}/reject": {
            "post": {
                "operationId": "flowsaas-comments-reject",
                "summary": "Reject a comment",
                "description": "Rejects a comment and notifies its author. Requires the manager permission.",
                "tags": [
                    "comments"
                ],
                "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": "7a9c1e35-4d68-4b02-9e7a-3f5c1d8b0e24",
                                        "moderation_status": "rejected"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/comments/{uuid}/spam": {
            "post": {
                "operationId": "flowsaas-comments-spam",
                "summary": "Mark a comment as spam",
                "description": "Marks a comment as spam without notifying anyone. Requires the manager permission.",
                "tags": [
                    "comments"
                ],
                "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": "7a9c1e35-4d68-4b02-9e7a-3f5c1d8b0e24",
                                        "moderation_status": "spam"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/comments/{uuid}/moderation": {
            "put": {
                "operationId": "flowsaas-comments-moderation-update",
                "summary": "Set the moderation state of a comment",
                "description": "Sets the state explicitly. Unlike the three shortcuts, this endpoint also reaches pending and so puts a comment back into the queue. Requires the manager permission.",
                "tags": [
                    "comments"
                ],
                "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": "7a9c1e35-4d68-4b02-9e7a-3f5c1d8b0e24",
                                        "moderation_status": "pending"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "moderation_status": {
                                        "type": "string",
                                        "description": "pending, approved, rejected or spam."
                                    }
                                },
                                "required": [
                                    "moderation_status"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/roadmap-items": {
            "get": {
                "operationId": "flowsaas-roadmap-items-index",
                "summary": "List roadmap items",
                "description": "The roadmap items of all of the team's portals in their published order.",
                "tags": [
                    "roadmap"
                ],
                "parameters": [
                    {
                        "name": "portal_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Limit to one portal.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Only items in this column.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "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": "5f1e7b90-2c44-4a19-9f3d-7c8b1a2e6d05",
                                            "portal_uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                            "post_uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                            "title": "Dunkelmodus",
                                            "status_name": "In Arbeit",
                                            "votes_count": 42,
                                            "sort_order": 0
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 50,
                                        "total": 1,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/roadmap-items/{uuid}": {
            "get": {
                "operationId": "flowsaas-roadmap-items-show",
                "summary": "Get a roadmap item",
                "description": "A roadmap item with the title, column and vote count of the idea behind it.",
                "tags": [
                    "roadmap"
                ],
                "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": "5f1e7b90-2c44-4a19-9f3d-7c8b1a2e6d05",
                                        "title": "Dunkelmodus",
                                        "status_name": "In Arbeit",
                                        "votes_count": 42
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "flowsaas-roadmap-items-update",
                "summary": "Change the position of a roadmap item",
                "description": "Changes only the position within the current column. To change the column, use the move endpoint.",
                "tags": [
                    "roadmap"
                ],
                "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": "5f1e7b90-2c44-4a19-9f3d-7c8b1a2e6d05",
                                        "sort_order": 4
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "sort_order": {
                                        "type": "integer",
                                        "description": "New position, starting at 0."
                                    }
                                },
                                "required": [
                                    "sort_order"
                                ]
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsaas-roadmap-items-destroy",
                "summary": "Remove a roadmap item",
                "description": "Takes the item off the roadmap. The idea remains with its votes and comments and only loses its roadmap flag. Requires the manager permission.",
                "tags": [
                    "roadmap"
                ],
                "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": "Roadmap-Eintrag entfernt."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/roadmap-items/{uuid}/move": {
            "post": {
                "operationId": "flowsaas-roadmap-items-move",
                "summary": "Move a roadmap item",
                "description": "Moves the item to another column and to a position within it. This is a status change of the idea: it writes history, triggers the webhooks and notifies the supporters. The other items of the target column are renumbered.",
                "tags": [
                    "roadmap"
                ],
                "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": "5f1e7b90-2c44-4a19-9f3d-7c8b1a2e6d05",
                                        "status_name": "In Arbeit",
                                        "sort_order": 0
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status_uuid": {
                                        "type": "string",
                                        "description": "The target column, a status of the same portal."
                                    },
                                    "sort_order": {
                                        "type": "integer",
                                        "description": "Position in the target column, starting at 0."
                                    }
                                },
                                "required": [
                                    "status_uuid",
                                    "sort_order"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/roadmap-items/{uuid}/vote": {
            "post": {
                "operationId": "flowsaas-roadmap-items-vote",
                "summary": "Vote for a roadmap item",
                "description": "The vote goes to the idea behind the item, because that is where the roadmap keeps its counts. A second vote by the same person is not an error.",
                "tags": [
                    "roadmap"
                ],
                "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": {
                                        "added": true,
                                        "votes_count": 43
                                    },
                                    "message": "Stimme abgegeben."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/portals/{uuid}/webhooks": {
            "get": {
                "operationId": "flowsaas-portals-webhooks-index",
                "summary": "List a portal's webhooks",
                "description": "All webhooks of the portal, newest first, each without its secret.",
                "tags": [
                    "webhooks"
                ],
                "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": "e4f6a8b0-2c4d-4e6f-8091-a2b3c4d5e6f7",
                                            "url": "https://example.com/hooks/flowsaas",
                                            "events": [
                                                "post.created"
                                            ],
                                            "is_active": true,
                                            "last_triggered_at": "2026-09-20T15:02:00+02:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsaas-portals-webhooks-store",
                "summary": "Create a webhook",
                "description": "Registers a webhook on the portal. The response contains the secret for signature verification once. Requires the manager permission.",
                "tags": [
                    "webhooks"
                ],
                "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": "e4f6a8b0-2c4d-4e6f-8091-a2b3c4d5e6f7",
                                        "url": "https://example.com/hooks/flowsaas",
                                        "events": [
                                            "post.created"
                                        ],
                                        "is_active": true,
                                        "secret": "Hn3k9QxT2bVr7LpZ4wYs8CmA1dFgJ6e0"
                                    },
                                    "message": "Der Schlüssel wird nur dieses eine Mal angezeigt. Bitte sicher aufbewahren."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "description": "The delivery target address."
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": [],
                                        "description": "At least one of post.created, post.status_changed, post.updated, comment.created, vote.created."
                                    },
                                    "secret": {
                                        "type": "string",
                                        "description": "Your own secret, at least 16 characters. One is generated if omitted."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Whether deliveries start right away. Default true."
                                    }
                                },
                                "required": [
                                    "url",
                                    "events"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/webhooks/{uuid}": {
            "get": {
                "operationId": "flowsaas-webhooks-show",
                "summary": "Get a webhook",
                "description": "A webhook with its target address, subscribed events and the time of the last successful delivery. The secret is not included.",
                "tags": [
                    "webhooks"
                ],
                "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": "e4f6a8b0-2c4d-4e6f-8091-a2b3c4d5e6f7",
                                        "url": "https://example.com/hooks/flowsaas",
                                        "events": [
                                            "post.created"
                                        ],
                                        "is_active": true
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "flowsaas-webhooks-update",
                "summary": "Update a webhook",
                "description": "Changes the fields sent. Without secret the stored secret stays the same, so a change of address does not break signature verification at the receiver. Requires the manager permission.",
                "tags": [
                    "webhooks"
                ],
                "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": "e4f6a8b0-2c4d-4e6f-8091-a2b3c4d5e6f7",
                                        "url": "https://example.com/hooks/neu",
                                        "is_active": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "description": "New target address."
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": [],
                                        "description": "The events that should apply afterwards."
                                    },
                                    "secret": {
                                        "type": "string",
                                        "description": "New secret, at least 16 characters. Not returned."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Switch deliveries on or off."
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsaas-webhooks-destroy",
                "summary": "Delete a webhook",
                "description": "Deletes the webhook together with its delivery log. Requires the manager permission.",
                "tags": [
                    "webhooks"
                ],
                "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": "Webhook gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/webhooks/{uuid}/test": {
            "post": {
                "operationId": "flowsaas-webhooks-test",
                "summary": "Send a test delivery",
                "description": "Sends a signed test message to the stored address and reports the result. A receiver that responds with an error is a successful call with an unsuccessful result: delivered is then false. Requires the manager permission.",
                "tags": [
                    "webhooks"
                ],
                "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": {
                                        "delivered": true,
                                        "http_status": 200,
                                        "response_body": "ok"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsaas/webhooks/{uuid}/logs": {
            "get": {
                "operationId": "flowsaas-webhooks-logs",
                "summary": "Get the delivery log",
                "description": "The webhook's delivery attempts, newest first, each with the payload sent and the receiver's response.",
                "tags": [
                    "webhooks"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "event_type",
                        "in": "query",
                        "required": false,
                        "description": "Limit to one event, for example post.created.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "succeeded",
                        "in": "query",
                        "required": false,
                        "description": "Only successful or only unsuccessful deliveries.",
                        "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": "9c1e3f57-6a8b-4d2e-9f01-3b5d7c9e1a24",
                                            "event_reference": "1f2e3d4c-5b6a-4790-8123-456789abcdef",
                                            "event_type": "post.created",
                                            "http_status": 200,
                                            "succeeded_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"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "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"
                    }
                }
            }
        }
    }
}