{
  "openapi": "3.1.0",
  "info": {
    "title": "Cocktail Manager API",
    "version": "1.0.0",
    "description": "External REST API of the Cocktail Manager. Authenticate with a workspace API key (Bearer JWT). The `/api/v1` paths are the stable, versioned contract; unversioned paths are deprecated."
  },
  "servers": [
    {
      "url": "https://app.cocktail-manager.de",
      "description": "Produktion"
    },
    {
      "url": "https://staging.cocktail-manager.de",
      "description": "Staging"
    },
    {
      "url": "http://localhost:3000",
      "description": "Lokale Entwicklung"
    }
  ],
  "security": [
    {
      "WorkspaceApiKeyAuth": []
    },
    {
      "InstanceApiKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "WorkspaceApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Workspace API key (JWT), scoped to a single workspace. Create one under Workspace → Settings → API Keys and send it as `Authorization: Bearer <token>`. Each key carries a set of permissions; the required permission is documented per operation (see the `Permission` schema for the full list)."
      },
      "InstanceApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Instance master API key — the `INSTANCE_MASTER_API_KEY` server env value, sent as `Authorization: Bearer <token>`. It is instance-wide (NOT scoped to a workspace) and bypasses the per-operation permission checks, so it authorizes every workspace operation. Intended for self-hosting / instance administration, not for third-party integrations. Call `GET /me` to introspect a token (its `isMaster` flag is true for this key)."
      },
      "SessionCookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "better-auth.session_token",
        "description": "Logged-in user session (browser cookie). Used by the few workspace-member operations that act on the caller's own identity (e.g. leaving a workspace, creating/revoking API keys) and therefore do NOT accept API keys — neither a workspace key nor the instance master key."
      }
    },
    "schemas": {
      "Permission": {
        "type": "string",
        "enum": [
          "COCKTAILS_READ",
          "COCKTAILS_CREATE",
          "COCKTAILS_UPDATE",
          "COCKTAILS_DELETE",
          "INGREDIENTS_READ",
          "INGREDIENTS_CREATE",
          "INGREDIENTS_UPDATE",
          "INGREDIENTS_DELETE",
          "GARNISHES_READ",
          "GARNISHES_CREATE",
          "GARNISHES_UPDATE",
          "GARNISHES_DELETE",
          "GLASSES_READ",
          "GLASSES_CREATE",
          "GLASSES_UPDATE",
          "GLASSES_DELETE",
          "UNITS_READ",
          "UNITS_UPDATE",
          "QUEUE_READ",
          "QUEUE_CREATE",
          "QUEUE_UPDATE",
          "QUEUE_DELETE",
          "STATISTICS_READ",
          "STATISTICS_CREATE",
          "STATISTICS_DELETE",
          "CARDS_READ",
          "CARDS_CREATE",
          "CARDS_UPDATE",
          "CARDS_DELETE",
          "CALCULATIONS_READ",
          "CALCULATIONS_CREATE",
          "CALCULATIONS_UPDATE",
          "CALCULATIONS_DELETE",
          "WORKSPACE_READ",
          "WORKSPACE_UPDATE",
          "USERS_READ",
          "USERS_UPDATE",
          "USERS_DELETE",
          "ICE_READ",
          "ICE_CREATE",
          "ICE_UPDATE",
          "ICE_DELETE",
          "RATINGS_READ",
          "RATINGS_CREATE",
          "RATINGS_DELETE",
          "MONITOR_READ",
          "MONITOR_UPDATE"
        ],
        "description": "Granular API-key permission scopes. See Authentication → Permissions for the full matrix."
      },
      "Me": {
        "type": "object",
        "properties": {
          "workspaceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Workspace the token is scoped to, or null for the instance master key."
          },
          "workspace": {
            "$ref": "#/components/schemas/WorkspaceRef"
          },
          "permissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Permission"
            },
            "description": "Permission scopes granted to this token."
          },
          "apiKey": {
            "$ref": "#/components/schemas/ApiKeyRef"
          },
          "isMaster": {
            "type": "boolean",
            "description": "True when authenticated with the instance master key (full, non-workspace-scoped access)."
          }
        },
        "required": [
          "workspaceId",
          "workspace",
          "permissions",
          "apiKey",
          "isMaster"
        ]
      },
      "WorkspaceRef": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "ApiKeyRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "example": "VALIDATION_ERROR"
              },
              "message": {
                "type": "string"
              },
              "issues": {}
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "Workspace": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ]
          },
          "isDemo": {
            "type": "boolean"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "When a demo workspace expires, or null."
          },
          "isExternallyManaged": {
            "type": "boolean",
            "description": "Whether membership/roles are managed via an external identity provider."
          },
          "settings": {
            "$ref": "#/components/schemas/WorkspaceSettings"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkspaceMember"
            }
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "image",
          "isDemo",
          "expiresAt",
          "isExternallyManaged",
          "settings",
          "members"
        ]
      },
      "WorkspaceSettings": {
        "type": "object",
        "properties": {
          "translations": {
            "type": [
              "string",
              "null"
            ]
          },
          "usePrices": {
            "type": [
              "string",
              "null"
            ]
          },
          "statisticDayStartTime": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "Workspace settings keyed by setting name; values are strings or null."
      },
      "WorkspaceMember": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "$ref": "#/components/schemas/WorkspaceRole"
          },
          "lastOpened": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "When the member last opened this workspace."
          }
        },
        "required": [
          "userId",
          "name",
          "email",
          "image",
          "role",
          "lastOpened"
        ]
      },
      "WorkspaceRole": {
        "type": "string",
        "enum": [
          "OWNER",
          "ADMIN",
          "MANAGER",
          "USER"
        ]
      },
      "WorkspaceUpdateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "name"
        ]
      },
      "DeletionResult": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "description": "Number of records deleted."
          }
        },
        "required": [
          "count"
        ]
      },
      "Action": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "actionGroup": {
            "type": "string",
            "description": "Grouping bucket, e.g. \"MIXING\" or \"POURING\"."
          }
        },
        "required": [
          "id",
          "name",
          "actionGroup"
        ]
      },
      "ActionCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "actionGroup": {
            "type": "string",
            "minLength": 1
          },
          "translations": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional display-name translations keyed by language code, e.g. { \"en\": \"Shake\" }."
          }
        },
        "required": [
          "name",
          "actionGroup"
        ]
      },
      "ActionUpdateInput": {
        "type": "object",
        "properties": {
          "actionGroup": {
            "type": "string",
            "minLength": 1
          },
          "translations": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional display-name translations keyed by language code, e.g. { \"en\": \"Shake\" }."
          }
        },
        "required": [
          "actionGroup"
        ]
      },
      "SignageFormat": {
        "type": "object",
        "properties": {
          "format": {
            "$ref": "#/components/schemas/MonitorFormat"
          },
          "backgroundColor": {
            "type": [
              "string",
              "null"
            ]
          },
          "backgroundMode": {
            "$ref": "#/components/schemas/SignageBackgroundMode"
          },
          "slideDurationSeconds": {
            "type": "integer"
          },
          "mirrorSourceFormat": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MonitorFormat"
              },
              {
                "type": [
                  "string",
                  "null"
                ],
                "description": "If set, this format mirrors the slides of the given source format."
              }
            ]
          },
          "slides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignageSlide"
            }
          }
        },
        "required": [
          "format",
          "backgroundColor",
          "backgroundMode",
          "slideDurationSeconds",
          "mirrorSourceFormat",
          "slides"
        ]
      },
      "MonitorFormat": {
        "type": "string",
        "enum": [
          "LANDSCAPE",
          "PORTRAIT"
        ]
      },
      "SignageBackgroundMode": {
        "type": "string",
        "enum": [
          "COLOR",
          "BLURRED"
        ]
      },
      "SignageSlide": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "order": {
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "weekdays": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Active weekdays (0=Sun … 6=Sat); empty = every day."
          },
          "validFrom": {
            "type": [
              "string",
              "null"
            ],
            "description": "Active-from date (YYYY-MM-DD), or null."
          },
          "validTo": {
            "type": [
              "string",
              "null"
            ],
            "description": "Active-to date (YYYY-MM-DD), or null."
          },
          "dateExclusive": {
            "type": "boolean"
          },
          "imageUrl": {
            "type": "string",
            "description": "URL to fetch the slide image bytes."
          }
        },
        "required": [
          "id",
          "order",
          "enabled",
          "weekdays",
          "validFrom",
          "validTo",
          "dateExclusive",
          "imageUrl"
        ]
      },
      "SignageSettingsUpdateInput": {
        "type": "object",
        "properties": {
          "landscape": {
            "type": "object",
            "properties": {
              "backgroundColor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "backgroundMode": {
                "$ref": "#/components/schemas/SignageBackgroundMode"
              },
              "slideDurationSeconds": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "mirrorSourceFormat": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MonitorFormat"
                  },
                  {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                ]
              },
              "slides": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SignageSlideOrder"
                }
              }
            },
            "required": [
              "slideDurationSeconds",
              "slides"
            ]
          },
          "portrait": {
            "type": "object",
            "properties": {
              "backgroundColor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "backgroundMode": {
                "$ref": "#/components/schemas/SignageBackgroundMode"
              },
              "slideDurationSeconds": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "mirrorSourceFormat": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MonitorFormat"
                  },
                  {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                ]
              },
              "slides": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SignageSlideOrder"
                }
              }
            },
            "required": [
              "slideDurationSeconds",
              "slides"
            ]
          }
        }
      },
      "SignageSlideOrder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "order": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "order"
        ]
      },
      "SignageSlideCreateInput": {
        "type": "object",
        "properties": {
          "format": {
            "$ref": "#/components/schemas/MonitorFormat"
          },
          "slides": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "description": "Base64-encoded slide images (data URIs) to append."
          }
        },
        "required": [
          "format",
          "slides"
        ]
      },
      "SignageSlidePatchInput": {
        "type": "object",
        "properties": {
          "slideIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1
          },
          "enabled": {
            "type": "boolean"
          },
          "weekdays": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "validFrom": {
            "type": [
              "string",
              "null"
            ]
          },
          "validTo": {
            "type": [
              "string",
              "null"
            ]
          },
          "dateExclusive": {
            "type": "boolean"
          }
        },
        "required": [
          "slideIds"
        ]
      },
      "TranslationUpdateResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ]
      },
      "TranslationUpdateInput": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1,
            "description": "The translation key (e.g. an action/unit/ice name)."
          },
          "translations": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Display names keyed by language code, e.g. { \"de\": \"Shaken\" }."
          }
        },
        "required": [
          "key",
          "translations"
        ]
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "keyPrefix": {
            "type": "string",
            "description": "First characters of the internal key id, for identification."
          },
          "revoked": {
            "type": "boolean"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          },
          "lastUsedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          },
          "createdBy": {
            "$ref": "#/components/schemas/ApiKeyCreator"
          },
          "permissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Permission"
            }
          }
        },
        "required": [
          "id",
          "name",
          "keyPrefix",
          "revoked",
          "expiresAt",
          "lastUsedAt",
          "createdAt",
          "createdBy",
          "permissions"
        ]
      },
      "ApiKeyCreator": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "email"
        ]
      },
      "ApiKeyCreateResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "key": {
            "type": "string",
            "description": "The signed API key (JWT). Returned ONLY once — store it now."
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          },
          "permissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Permission"
            }
          }
        },
        "required": [
          "id",
          "name",
          "key",
          "expiresAt",
          "createdAt",
          "permissions"
        ]
      },
      "ApiKeyCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO expiry timestamp, or null/omitted for no expiry."
          },
          "permissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Permission"
            },
            "description": "Permission scopes to grant the key."
          }
        },
        "required": [
          "name"
        ]
      },
      "AuditLog": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "entityType": {
            "type": "string",
            "description": "Type of the affected entity, e.g. `Glass`."
          },
          "entityId": {
            "type": "string",
            "description": "ID of the affected entity."
          },
          "action": {
            "type": "string",
            "description": "Action performed, e.g. `CREATE`, `UPDATE`, `DELETE`."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          },
          "user": {
            "$ref": "#/components/schemas/AuditLogUser"
          }
        },
        "required": [
          "id",
          "entityType",
          "entityId",
          "action",
          "createdAt",
          "user"
        ]
      },
      "AuditLogUser": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Avatar URL, or null."
          }
        },
        "required": [
          "id",
          "name",
          "image"
        ],
        "description": "The acting user, or null if the user was removed."
      },
      "CalculationSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "showSalesStuff": {
            "type": "boolean"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          },
          "group": {
            "$ref": "#/components/schemas/CalculationGroupRef"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalculationItem"
            }
          }
        },
        "required": [
          "id",
          "name",
          "showSalesStuff",
          "updatedAt",
          "group",
          "items"
        ]
      },
      "CalculationGroupRef": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "isDefaultExpanded": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "isDefaultExpanded"
        ],
        "description": "Group this calculation belongs to, or null."
      },
      "CalculationItem": {
        "type": "object",
        "properties": {
          "cocktail": {
            "$ref": "#/components/schemas/CalculationCocktailRef"
          },
          "plannedAmount": {
            "type": "integer",
            "description": "Planned number of cocktails for this item."
          },
          "customPrice": {
            "type": [
              "number",
              "null"
            ],
            "description": "Overridden price for this item, or null."
          }
        },
        "required": [
          "cocktail",
          "plannedAmount",
          "customPrice"
        ]
      },
      "CalculationCocktailRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "CalculationCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "showSalesStuff": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether to show sales figures (default true)."
          },
          "groupId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Group to assign the calculation to, or null/omitted for none."
          },
          "calculationItems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "cocktailId": {
                  "type": "string"
                },
                "plannedAmount": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Planned number of cocktails for this item."
                },
                "customPrice": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Overridden price for this item, or null."
                }
              },
              "required": [
                "cocktailId",
                "plannedAmount"
              ]
            },
            "description": "Cocktail items in this calculation."
          },
          "ingredientShoppingUnits": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ingredientId": {
                  "type": "string"
                },
                "unitId": {
                  "type": "string"
                },
                "checked": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              },
              "required": [
                "ingredientId",
                "unitId"
              ]
            },
            "description": "Ingredient shopping units for this calculation."
          }
        },
        "required": [
          "name",
          "calculationItems",
          "ingredientShoppingUnits"
        ]
      },
      "Calculation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CalculationSummary"
          },
          {
            "type": "object",
            "properties": {
              "ingredientShoppingUnits": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CalculationShoppingUnit"
                }
              }
            },
            "required": [
              "ingredientShoppingUnits"
            ]
          }
        ]
      },
      "CalculationShoppingUnit": {
        "type": "object",
        "properties": {
          "ingredient": {
            "$ref": "#/components/schemas/CalculationIngredientRef"
          },
          "unit": {
            "$ref": "#/components/schemas/CalculationUnitRef"
          },
          "checked": {
            "type": "boolean"
          }
        },
        "required": [
          "ingredient",
          "unit",
          "checked"
        ]
      },
      "CalculationIngredientRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "CalculationUnitRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "CalculationUpdateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "showSalesStuff": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether to show sales figures."
          },
          "groupId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Group to assign the calculation to; null/omitted disconnects it."
          },
          "calculationItems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "cocktailId": {
                  "type": "string"
                },
                "plannedAmount": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Planned number of cocktails for this item."
                },
                "customPrice": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Overridden price for this item, or null."
                }
              },
              "required": [
                "cocktailId",
                "plannedAmount"
              ]
            },
            "description": "Cocktail items; fully replaces the existing items."
          },
          "ingredientShoppingUnits": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ingredientId": {
                  "type": "string"
                },
                "unitId": {
                  "type": "string"
                },
                "checked": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              },
              "required": [
                "ingredientId",
                "unitId"
              ]
            },
            "description": "Ingredient shopping units; fully replaces the existing ones."
          }
        },
        "required": [
          "name",
          "calculationItems",
          "ingredientShoppingUnits"
        ]
      },
      "CalculationExportJsonInput": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Ids of the calculations to export."
          }
        },
        "required": [
          "ids"
        ]
      },
      "CalculationGroup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "isDefaultExpanded": {
            "type": "boolean"
          },
          "calculationCount": {
            "type": "integer",
            "description": "Number of calculations assigned to this group."
          }
        },
        "required": [
          "id",
          "name",
          "isDefaultExpanded",
          "calculationCount"
        ]
      },
      "CalculationGroupCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "isDefaultExpanded": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the group is expanded by default (default false)."
          }
        },
        "required": [
          "name"
        ]
      },
      "CalculationGroupUpdateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "isDefaultExpanded": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the group is expanded by default."
          }
        },
        "required": [
          "name"
        ]
      },
      "GroupAssignmentResult": {
        "type": "object",
        "properties": {
          "updatedCount": {
            "type": "integer"
          }
        },
        "required": [
          "updatedCount"
        ]
      },
      "CalculationGroupAssignInput": {
        "type": "object",
        "properties": {
          "calculationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "description": "Calculations to (re)assign."
          },
          "groupId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Target group, or null to remove group assignment."
          }
        },
        "required": [
          "calculationIds"
        ]
      },
      "CalculationImportJsonInput": {
        "type": "object",
        "properties": {
          "phase": {
            "type": "string",
            "enum": [
              "validate",
              "prepare-mapping",
              "execute"
            ],
            "description": "Import phase to run."
          },
          "exportData": {
            "description": "Raw export dump (single object or array) as produced by POST /calculations/export/json (round-trip format, kept verbatim)."
          },
          "decisions": {
            "description": "Per-entity import decisions, required for the \"execute\" phase."
          },
          "cocktailMappings": {
            "description": "Cocktail name → id mappings for the \"execute\" phase."
          },
          "ingredientMappings": {
            "description": "Ingredient name → id mappings for the \"execute\" phase."
          },
          "unitMappings": {
            "description": "Unit name → id mappings for the \"execute\" phase."
          }
        },
        "required": [
          "phase"
        ],
        "additionalProperties": {}
      },
      "CardSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "Optional date the card is scheduled for."
          },
          "archived": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "date",
          "archived"
        ]
      },
      "Card": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CardSummary"
          },
          {
            "type": "object",
            "properties": {
              "groups": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CardGroup"
                }
              }
            },
            "required": [
              "groups"
            ]
          }
        ]
      },
      "CardGroup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "groupNumber": {
            "type": "integer",
            "description": "Ordering index of the group within the card."
          },
          "groupPrice": {
            "type": [
              "number",
              "null"
            ],
            "description": "Uniform price applied to the whole group, or null."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardItem"
            }
          }
        },
        "required": [
          "id",
          "name",
          "groupNumber",
          "groupPrice",
          "items"
        ]
      },
      "CardItem": {
        "type": "object",
        "properties": {
          "cocktail": {
            "$ref": "#/components/schemas/CardCocktailRef"
          },
          "itemNumber": {
            "type": "integer",
            "description": "Ordering index of the item within its group."
          },
          "specialPrice": {
            "type": [
              "number",
              "null"
            ],
            "description": "Overridden price for this item on this card, or null."
          }
        },
        "required": [
          "cocktail",
          "itemNumber",
          "specialPrice"
        ]
      },
      "CardCocktailRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "CardCreateInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Optional client-supplied CUID."
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Optional date the card is scheduled for."
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Optional client-supplied CUID."
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "groupNumber": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Ordering index; auto-assigned when omitted."
                },
                "groupPrice": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Uniform group price, or null."
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "cocktailId": {
                        "type": "string"
                      },
                      "itemNumber": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "description": "Ordering index; auto-assigned when omitted."
                      },
                      "specialPrice": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "description": "Overridden price for this item, or null."
                      }
                    },
                    "required": [
                      "cocktailId"
                    ]
                  },
                  "description": "Items in this group."
                }
              },
              "required": [
                "name"
              ]
            },
            "description": "Groups (with their items) to create."
          }
        },
        "required": [
          "name"
        ]
      },
      "CardUpdateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Optional date the card is scheduled for."
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Optional client-supplied CUID."
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "groupNumber": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Ordering index; auto-assigned when omitted."
                },
                "groupPrice": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Uniform group price, or null."
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "cocktailId": {
                        "type": "string"
                      },
                      "itemNumber": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "description": "Ordering index; auto-assigned when omitted."
                      },
                      "specialPrice": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "description": "Overridden price for this item, or null."
                      }
                    },
                    "required": [
                      "cocktailId"
                    ]
                  },
                  "description": "Items in this group."
                }
              },
              "required": [
                "name"
              ]
            },
            "description": "Groups (with their items); fully replaces the existing groups/items."
          }
        },
        "required": [
          "name"
        ]
      },
      "CardCloneInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Name for the cloned card."
          }
        },
        "required": [
          "name"
        ]
      },
      "CocktailSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "isArchived": {
            "type": "boolean",
            "description": "Whether the cocktail is archived."
          },
          "hasImage": {
            "type": "boolean",
            "description": "Whether the cocktail has an image."
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL to fetch the cocktail image bytes, or null when hasImage is false."
          },
          "glass": {
            "$ref": "#/components/schemas/CocktailGlassRef"
          },
          "garnishes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CocktailGarnishNameRef"
            },
            "description": "Garnish name refs; present only when requested via ?include=garnishes."
          },
          "ingredients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CocktailIngredientNameRef"
            },
            "description": "Distinct ingredient name refs across all steps; present only when requested via ?include=ingredients."
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "tags",
          "price",
          "isArchived",
          "hasImage",
          "imageUrl",
          "glass"
        ]
      },
      "CocktailGlassRef": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "deposit": {
            "type": "number",
            "description": "Glass deposit in currency units."
          },
          "hasImage": {
            "type": "boolean",
            "description": "Whether the glass has an image."
          }
        },
        "required": [
          "id",
          "name",
          "deposit",
          "hasImage"
        ]
      },
      "CocktailGarnishNameRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "CocktailIngredientNameRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "shortName": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "shortName"
        ]
      },
      "Cocktail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "isArchived": {
            "type": "boolean",
            "description": "Whether the cocktail is archived."
          },
          "hasImage": {
            "type": "boolean",
            "description": "Whether the cocktail has an image."
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL to fetch the cocktail image bytes, or null when hasImage is false."
          },
          "glass": {
            "$ref": "#/components/schemas/CocktailGlassRef"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "history": {
            "type": [
              "string",
              "null"
            ]
          },
          "ice": {
            "$ref": "#/components/schemas/CocktailIceRef"
          },
          "garnishes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CocktailGarnish"
            }
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CocktailStep"
            }
          },
          "averageRating": {
            "type": [
              "number",
              "null"
            ],
            "description": "Mean of all rating values, or null when there are no ratings."
          },
          "ratingCount": {
            "type": "integer",
            "description": "Number of ratings."
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "tags",
          "price",
          "isArchived",
          "hasImage",
          "imageUrl",
          "glass",
          "notes",
          "history",
          "ice",
          "garnishes",
          "steps",
          "averageRating",
          "ratingCount"
        ]
      },
      "CocktailIceRef": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "CocktailGarnish": {
        "type": "object",
        "properties": {
          "garnishId": {
            "type": "string"
          },
          "garnishNumber": {
            "type": "integer",
            "description": "Ordering index of the garnish within the recipe."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "optional": {
            "type": "boolean"
          },
          "isAlternative": {
            "type": "boolean"
          },
          "garnish": {
            "$ref": "#/components/schemas/CocktailGarnishRef"
          }
        },
        "required": [
          "garnishId",
          "garnishNumber",
          "description",
          "optional",
          "isAlternative",
          "garnish"
        ]
      },
      "CocktailGarnishRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "description": "Garnish price in currency units (drives material cost)."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasImage": {
            "type": "boolean",
            "description": "Whether the garnish has an image."
          }
        },
        "required": [
          "id",
          "name",
          "price",
          "description",
          "notes",
          "hasImage"
        ]
      },
      "CocktailStep": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "stepNumber": {
            "type": "integer",
            "description": "Ordering index of the step within the recipe."
          },
          "optional": {
            "type": "boolean"
          },
          "action": {
            "$ref": "#/components/schemas/CocktailActionRef"
          },
          "ingredients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CocktailStepIngredient"
            }
          }
        },
        "required": [
          "id",
          "stepNumber",
          "optional",
          "action",
          "ingredients"
        ]
      },
      "CocktailActionRef": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "CocktailStepIngredient": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "amount": {
            "type": [
              "number",
              "null"
            ],
            "description": "Amount in the given unit, or null."
          },
          "optional": {
            "type": "boolean"
          },
          "ingredientNumber": {
            "type": "integer",
            "description": "Ordering index within the step."
          },
          "unit": {
            "$ref": "#/components/schemas/CocktailUnitRef"
          },
          "ingredient": {
            "$ref": "#/components/schemas/CocktailIngredientRef"
          }
        },
        "required": [
          "id",
          "amount",
          "optional",
          "ingredientNumber",
          "unit",
          "ingredient"
        ]
      },
      "CocktailUnitRef": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "CocktailIngredientRef": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "shortName": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hasImage": {
            "type": "boolean",
            "description": "Whether the ingredient has an image."
          }
        },
        "required": [
          "id",
          "name",
          "shortName",
          "description",
          "notes",
          "tags",
          "hasImage"
        ]
      },
      "CocktailCreateInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Optional client-supplied CUID."
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "history": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "iceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Ice id, or null."
          },
          "glassId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Glass id, or null."
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Base64-encoded image (data URI) to attach."
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Existing step id; omit/empty for a new step."
                },
                "stepNumber": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Ordering index of the step within the recipe."
                },
                "optional": {
                  "type": "boolean",
                  "description": "Whether this step is optional (default false)."
                },
                "actionId": {
                  "type": "string",
                  "description": "Action id for this step."
                },
                "ingredients": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Existing ingredient-line id; omit/empty for a new line."
                      },
                      "amount": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "description": "Amount in the given unit, or null."
                      },
                      "optional": {
                        "type": "boolean",
                        "description": "Whether this ingredient is optional (default false)."
                      },
                      "ingredientNumber": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "description": "Ordering index within the step."
                      },
                      "unitId": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Unit id, or null."
                      },
                      "ingredientId": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Ingredient id, or null."
                      }
                    },
                    "required": [
                      "ingredientNumber"
                    ]
                  },
                  "description": "Ingredient lines within this step."
                }
              },
              "required": [
                "stepNumber",
                "actionId"
              ]
            },
            "description": "Preparation steps (with their ingredients)."
          },
          "garnishes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "garnishId": {
                  "type": "string"
                },
                "garnishNumber": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Ordering index of the garnish within the recipe."
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "optional": {
                  "type": "boolean",
                  "description": "Whether this garnish is optional (default false)."
                },
                "isAlternative": {
                  "type": "boolean",
                  "description": "Whether this garnish is an alternative (default false)."
                }
              },
              "required": [
                "garnishId",
                "garnishNumber"
              ]
            },
            "description": "Garnishes attached to the cocktail."
          }
        },
        "required": [
          "name"
        ]
      },
      "CocktailUpdateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "history": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "iceId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Ice id, or null."
          },
          "glassId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Glass id, or null."
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Base64 image; omitting it removes the current image."
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Existing step id; omit/empty for a new step."
                },
                "stepNumber": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Ordering index of the step within the recipe."
                },
                "optional": {
                  "type": "boolean",
                  "description": "Whether this step is optional (default false)."
                },
                "actionId": {
                  "type": "string",
                  "description": "Action id for this step."
                },
                "ingredients": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Existing ingredient-line id; omit/empty for a new line."
                      },
                      "amount": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "description": "Amount in the given unit, or null."
                      },
                      "optional": {
                        "type": "boolean",
                        "description": "Whether this ingredient is optional (default false)."
                      },
                      "ingredientNumber": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "description": "Ordering index within the step."
                      },
                      "unitId": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Unit id, or null."
                      },
                      "ingredientId": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Ingredient id, or null."
                      }
                    },
                    "required": [
                      "ingredientNumber"
                    ]
                  },
                  "description": "Ingredient lines within this step."
                }
              },
              "required": [
                "stepNumber",
                "actionId"
              ]
            },
            "description": "Steps (with ingredients). Differentially applied via ids: lines with ids are updated, without ids created, missing ids deleted."
          },
          "garnishes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "garnishId": {
                  "type": "string"
                },
                "garnishNumber": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Ordering index of the garnish within the recipe."
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "optional": {
                  "type": "boolean",
                  "description": "Whether this garnish is optional (default false)."
                },
                "isAlternative": {
                  "type": "boolean",
                  "description": "Whether this garnish is an alternative (default false)."
                }
              },
              "required": [
                "garnishId",
                "garnishNumber"
              ]
            },
            "description": "Garnishes. Differentially applied via garnishId: present are updated/created, missing are deleted."
          }
        },
        "required": [
          "name"
        ]
      },
      "CocktailCloneInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Name for the cloned cocktail."
          }
        },
        "required": [
          "name"
        ]
      },
      "Rating": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the rater, or null."
          },
          "rating": {
            "type": "integer",
            "description": "Rating value."
          },
          "comment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional comment."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          }
        },
        "required": [
          "id",
          "name",
          "rating",
          "comment",
          "createdAt"
        ]
      },
      "RatingCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the rater."
          },
          "rating": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Rating value."
          },
          "comment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional comment."
          }
        },
        "required": [
          "rating"
        ]
      },
      "CocktailExportJsonInput": {
        "type": "object",
        "properties": {
          "cocktailIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Ids of the cocktails to export."
          }
        },
        "required": [
          "cocktailIds"
        ]
      },
      "CocktailExportPdfInput": {
        "type": "object",
        "properties": {
          "cocktailIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Ids of the cocktails to render."
          },
          "exportImage": {
            "type": "boolean",
            "description": "Include the cocktail image (default true)."
          },
          "exportDescription": {
            "type": "boolean",
            "description": "Include the description (default true)."
          },
          "exportNotes": {
            "type": "boolean",
            "description": "Include the notes (default true)."
          },
          "exportHistory": {
            "type": "boolean",
            "description": "Include the history (default true)."
          },
          "newPagePerCocktail": {
            "type": "boolean",
            "description": "Start a new page per cocktail (default true)."
          },
          "showHeader": {
            "type": "boolean",
            "description": "Render a page header (default false)."
          },
          "showFooter": {
            "type": "boolean",
            "description": "Render a page footer with page numbers (default false)."
          }
        },
        "required": [
          "cocktailIds"
        ]
      },
      "CocktailImportJsonInput": {
        "type": "object",
        "properties": {
          "phase": {
            "type": "string",
            "enum": [
              "validate",
              "prepare-mapping",
              "execute"
            ],
            "description": "Import phase to run."
          },
          "exportData": {
            "description": "Raw export dump as produced by POST /cocktails/export/json (round-trip format, kept verbatim)."
          },
          "mappingDecisions": {
            "description": "User mapping decisions, required for the \"execute\" phase."
          }
        },
        "required": [
          "phase"
        ],
        "additionalProperties": {}
      },
      "Garnish": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "description": "Price in currency units."
          },
          "hasImage": {
            "type": "boolean",
            "description": "Whether the garnish has an image."
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL to fetch the garnish image bytes, or null when hasImage is false."
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "notes",
          "price",
          "hasImage",
          "imageUrl"
        ]
      },
      "GarnishCreateInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Optional client-supplied CUID."
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "description": "Price in currency units."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Base64-encoded image (data URI) to attach."
          }
        },
        "required": [
          "name"
        ]
      },
      "GarnishUpdateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Base64 image; omitting it removes the current image."
          }
        },
        "required": [
          "name"
        ]
      },
      "GarnishCloneInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Name for the cloned garnish."
          }
        },
        "required": [
          "name"
        ]
      },
      "GarnishExportInput": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IDs of the garnishes to export."
          }
        },
        "required": [
          "ids"
        ]
      },
      "Glass": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "volume": {
            "type": [
              "number",
              "null"
            ],
            "description": "Volume in cl."
          },
          "deposit": {
            "type": "number",
            "description": "Deposit in currency units."
          },
          "hasImage": {
            "type": "boolean",
            "description": "Whether the glass has an image."
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL to fetch the glass image bytes, or null when hasImage is false."
          }
        },
        "required": [
          "id",
          "name",
          "notes",
          "volume",
          "deposit",
          "hasImage",
          "imageUrl"
        ]
      },
      "GlassCreateInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Optional client-supplied CUID."
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "deposit": {
            "type": [
              "number",
              "null"
            ],
            "description": "Deposit in currency units."
          },
          "volume": {
            "type": [
              "number",
              "null"
            ],
            "description": "Volume in cl."
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Base64-encoded image (data URI) to attach."
          }
        },
        "required": [
          "name",
          "deposit"
        ]
      },
      "GlassUpdateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "deposit": {
            "type": [
              "number",
              "null"
            ]
          },
          "volume": {
            "type": [
              "number",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Base64 image; omitting it removes the current image."
          }
        },
        "required": [
          "name",
          "deposit"
        ]
      },
      "GlassCloneInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Name for the cloned glass."
          }
        },
        "required": [
          "name"
        ]
      },
      "GlassReference": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "GlassExportInput": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IDs of the glasses to export."
          }
        },
        "required": [
          "ids"
        ]
      },
      "Ice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "IceCreateInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Optional client-supplied CUID."
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "translations": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional display-name translations keyed by language code, e.g. { \"en\": \"Crushed ice\" }."
          }
        },
        "required": [
          "name"
        ]
      },
      "IceUpdateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "translations": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional display-name translations keyed by language code, e.g. { \"en\": \"Crushed ice\" }."
          }
        },
        "required": [
          "name"
        ]
      },
      "Ingredient": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "shortName": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "link": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "volumes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IngredientVolume"
            }
          },
          "hasImage": {
            "type": "boolean",
            "description": "Whether the ingredient has an image."
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL to fetch the ingredient image bytes, or null when hasImage is false."
          }
        },
        "required": [
          "id",
          "name",
          "shortName",
          "description",
          "notes",
          "price",
          "link",
          "tags",
          "volumes",
          "hasImage",
          "imageUrl"
        ]
      },
      "IngredientVolume": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "volume": {
            "type": "number",
            "description": "Volume amount in the given unit."
          },
          "unit": {
            "$ref": "#/components/schemas/IngredientVolumeUnit"
          }
        },
        "required": [
          "id",
          "volume",
          "unit"
        ]
      },
      "IngredientVolumeUnit": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "IngredientCreateInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Optional client-supplied CUID."
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "shortName": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "link": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "units": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "unitId": {
                  "type": "string"
                },
                "volume": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Volume amount in the given unit."
                }
              },
              "required": [
                "unitId",
                "volume"
              ]
            },
            "description": "Unit volumes to attach."
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Base64-encoded image (data URI) to attach."
          }
        },
        "required": [
          "name"
        ]
      },
      "IngredientUpdateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "shortName": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "link": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "units": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "unitId": {
                  "type": "string"
                },
                "volume": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Volume amount in the given unit."
                }
              },
              "required": [
                "unitId",
                "volume"
              ]
            },
            "description": "Unit volumes to attach (replaces existing)."
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Base64 image; omitting it removes the current image."
          }
        },
        "required": [
          "name"
        ]
      },
      "IngredientCloneInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Name for the cloned ingredient."
          }
        },
        "required": [
          "name"
        ]
      },
      "IngredientReference": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "IngredientExportInput": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IDs of the ingredients to export."
          }
        },
        "required": [
          "ids"
        ]
      },
      "JoinCode": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "expires": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          },
          "onlyUseOnce": {
            "type": "boolean"
          },
          "used": {
            "type": "integer",
            "description": "How many times the code has been used."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          }
        },
        "required": [
          "code",
          "expires",
          "onlyUseOnce",
          "used",
          "createdAt"
        ]
      },
      "JoinCodeCreateInput": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1
          },
          "expires": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO expiry timestamp, or null/omitted for no expiry."
          },
          "onlyUseOnce": {
            "type": "boolean",
            "description": "Whether the code can only be used once (default false)."
          }
        },
        "required": [
          "code"
        ]
      },
      "JoinRequest": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          },
          "user": {
            "$ref": "#/components/schemas/JoinRequestUser"
          }
        },
        "required": [
          "userId",
          "date",
          "user"
        ]
      },
      "JoinRequestUser": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Requester email — shown to managers to identify the person."
          },
          "image": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "image"
        ]
      },
      "JoinRequestActionResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ]
      },
      "LeaveResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ]
      },
      "QueueItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "cocktail": {
            "$ref": "#/components/schemas/QueueCocktailRef"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "inProgress": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          }
        },
        "required": [
          "id",
          "cocktail",
          "notes",
          "inProgress",
          "createdAt"
        ]
      },
      "QueueCocktailRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "QueueUpdateInput": {
        "type": "object",
        "properties": {
          "inProgress": {
            "type": "boolean",
            "description": "Whether the queue item is currently being prepared."
          }
        },
        "required": [
          "inProgress"
        ]
      },
      "QueueAddInput": {
        "type": "object",
        "properties": {
          "cocktailId": {
            "type": "string",
            "minLength": 1
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional notes. Empty or \"-\" is treated as no notes."
          },
          "amount": {
            "type": "integer",
            "minimum": 1,
            "description": "How many identical items to enqueue (default 1)."
          }
        },
        "required": [
          "cocktailId"
        ]
      },
      "QueueRemoveInput": {
        "type": "object",
        "properties": {
          "cocktailId": {
            "type": "string",
            "minLength": 1
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Notes to match. Empty or \"-\" matches items without notes."
          }
        },
        "required": [
          "cocktailId"
        ]
      },
      "WorkspaceSettingUpdateInput": {
        "type": "object",
        "properties": {
          "setting": {
            "$ref": "#/components/schemas/WorkspaceSettingKey"
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "New value for the setting; null clears it."
          }
        },
        "required": [
          "setting"
        ]
      },
      "WorkspaceSettingKey": {
        "type": "string",
        "enum": [
          "translations",
          "usePrices",
          "statisticDayStartTime"
        ]
      },
      "AdvancedStatisticsCocktailRanking": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvancedStatisticsCocktailRankingRow"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of orders in the selected period."
          }
        },
        "required": [
          "data",
          "total"
        ]
      },
      "AdvancedStatisticsCocktailRankingRow": {
        "type": "object",
        "properties": {},
        "additionalProperties": {},
        "description": "Per-cocktail ranking row: `cocktailId`, `name`, `tags`, `count`, `percentage` (share of period orders), `delta` (% vs. previous period), `previousCount`, `rank`, and `ingredients[]` (each with ingredientId/name/price, amount, unitId/name and availableUnits)."
      },
      "AdvancedStatisticsCocktailDetail": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {},
            "additionalProperties": {},
            "description": "Single-cocktail analytics: `cocktail` `{ id, name, tags, price }`, `total`, `avgPerActiveHour`, `rank`, `delta` (% vs. previous period), `previousTotal`, `revenue`, `previousRevenue`, `timeSeries` `{ date, count }[]` (granularity auto-chosen by range), `hourDistribution` `{ hour, count }[]` (0–23), `dayDistribution` `{ day, count }[]` (0=Sun…6), and `ingredients` (ingredient name list). All-time range is used when startDate/endDate are omitted."
          }
        },
        "required": [
          "data"
        ]
      },
      "AdvancedStatisticsCocktailOrders": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvancedStatisticsCocktailOrderRow"
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "page": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "total": {
                "type": "integer"
              },
              "totalPages": {
                "type": "integer"
              }
            },
            "required": [
              "page",
              "limit",
              "total",
              "totalPages"
            ],
            "description": "Legacy pagination block (page/limit/total/totalPages), distinct from the standard PaginationMeta."
          }
        },
        "required": [
          "data",
          "pagination"
        ]
      },
      "AdvancedStatisticsCocktailOrderRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          },
          "user": {
            "$ref": "#/components/schemas/AdvancedStatisticsOrderUser"
          },
          "cocktailCard": {
            "$ref": "#/components/schemas/AdvancedStatisticsOrderCard"
          }
        },
        "required": [
          "id",
          "date",
          "user",
          "cocktailCard"
        ]
      },
      "AdvancedStatisticsOrderUser": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "email"
        ]
      },
      "AdvancedStatisticsOrderCard": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      },
      "AdvancedStatisticsCocktailAll": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvancedStatisticsCocktailAllRow"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of orders in the period across all cocktails."
          }
        },
        "required": [
          "data",
          "total"
        ]
      },
      "AdvancedStatisticsCocktailAllRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "description": "Order count in the period (0 when no date range or no orders)."
          }
        },
        "required": [
          "id",
          "name",
          "count"
        ]
      },
      "AdvancedStatisticsCompare": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {},
            "additionalProperties": {},
            "description": "Ad-hoc set comparison: `set` `{ name, type, logic }`, `kpis` (total, percentage, cocktailCount, totalStats, totalUniqueCocktailsInPeriod, cocktailPercentage, totalCocktailsInWorkspace, cocktailPercentageAll, revenue, totalRevenue), `cocktails` `{ cocktailId, name, count }[]`, and `aggregated` `{ name, count }[]` (ingredients for TAG_SET, tags for INGREDIENT_SET)."
          }
        },
        "required": [
          "data"
        ]
      },
      "AdvancedStatisticsIngredients": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvancedStatisticsIngredientRow"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of orders in the period."
          }
        },
        "required": [
          "data",
          "total"
        ]
      },
      "AdvancedStatisticsIngredientRow": {
        "type": "object",
        "properties": {
          "ingredient": {
            "type": "string",
            "description": "Ingredient name."
          },
          "count": {
            "type": "integer",
            "description": "Number of orders whose cocktail uses this ingredient."
          },
          "cocktailCount": {
            "type": "integer",
            "description": "Number of distinct cocktails that use this ingredient."
          },
          "percentage": {
            "type": "number",
            "description": "Share of period orders using this ingredient (%)."
          }
        },
        "required": [
          "ingredient",
          "count",
          "cocktailCount",
          "percentage"
        ]
      },
      "AdvancedStatisticsOverview": {
        "type": "object",
        "properties": {},
        "additionalProperties": {},
        "description": "Dashboard overview. `kpis` holds per-period KPI blocks (today/week/month/period/avgPerHour/allTime), each with totals, deltas vs. the previous period, top cocktail `{ name, count }` and revenue. `charts` holds per-period chart data (timeSeries `{ date, count }[]`, topCocktails `{ cocktailId, name, count }[]`, hourDistribution `{ hour, count }[]`). Legacy top-level `timeSeries`/`topCocktails`/`hourDistribution` mirror the `period` chart data."
      },
      "AdvancedStatisticsSavedSet": {
        "type": "object",
        "properties": {},
        "additionalProperties": {},
        "description": "A saved statistics set (id, workspaceId, name, type, logic, items[], createdAt, updatedAt)."
      },
      "AdvancedStatisticsSavedSetCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Set name."
          },
          "type": {
            "type": "string",
            "description": "SavedSetType (COCKTAIL_SET | TAG_SET | INGREDIENT_SET)."
          },
          "logic": {
            "type": [
              "string",
              "null"
            ],
            "description": "SavedSetLogic (AND | OR), or null."
          },
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Member names/ids for the set."
          }
        },
        "required": [
          "name",
          "type",
          "items"
        ]
      },
      "AdvancedStatisticsSavedSetUpdateInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Id of the set to update."
          },
          "name": {
            "type": "string",
            "description": "New name (optional)."
          },
          "logic": {
            "type": [
              "string",
              "null"
            ],
            "description": "New logic (AND | OR) or null (optional)."
          },
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "New member list (optional)."
          }
        },
        "required": [
          "id"
        ]
      },
      "AdvancedStatisticsSetDetail": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {},
            "additionalProperties": {},
            "description": "Analytics for a saved set: `set` `{ id, name, type, logic, items }`, `kpis` (total, percentage, cocktailCount, totalStats, totalUniqueCocktailsInPeriod, cocktailPercentage, totalCocktailsInWorkspace, cocktailPercentageAll), `cocktails` `{ cocktailId, name, count }[]`, and `aggregated` `{ name, count }[]` (ingredients for TAG_SET, tags for INGREDIENT_SET)."
          }
        },
        "required": [
          "data"
        ]
      },
      "AdvancedStatisticsTags": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdvancedStatisticsTagRow"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of orders in the period."
          }
        },
        "required": [
          "data",
          "total"
        ]
      },
      "AdvancedStatisticsTagRow": {
        "type": "object",
        "properties": {
          "tag": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "description": "Number of orders whose cocktail carries this tag."
          },
          "cocktailCount": {
            "type": "integer",
            "description": "Number of distinct cocktails carrying this tag."
          },
          "percentage": {
            "type": "number",
            "description": "Share of period orders carrying this tag (%)."
          }
        },
        "required": [
          "tag",
          "count",
          "cocktailCount",
          "percentage"
        ]
      },
      "CocktailStatisticItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-04T12:00:00.000Z",
            "description": "ISO 8601 timestamp"
          },
          "actionSource": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where the statistic entry originated (free-form source tag), or null."
          },
          "cocktail": {
            "$ref": "#/components/schemas/StatisticCocktailRef"
          },
          "cocktailCard": {
            "$ref": "#/components/schemas/StatisticCocktailCardRef"
          },
          "user": {
            "$ref": "#/components/schemas/StatisticUser"
          }
        },
        "required": [
          "id",
          "date",
          "actionSource",
          "cocktail",
          "cocktailCard",
          "user"
        ]
      },
      "StatisticCocktailRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "StatisticCocktailCardRef": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "description": "The cocktail card the drink was served from, or null."
      },
      "StatisticUser": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name"
        ],
        "description": "The user who logged the statistic, or null if the user was removed."
      },
      "CocktailStatisticCreateInput": {
        "type": "object",
        "properties": {
          "cocktailId": {
            "type": "string",
            "description": "ID of the cocktail that was made."
          },
          "cocktailCardId": {
            "type": "string",
            "description": "ID of the cocktail card. The sentinel value `search` is treated as no card."
          },
          "actionSource": {
            "type": "string",
            "description": "Free-form origin tag for the statistic entry."
          },
          "notes": {
            "type": "string",
            "description": "Queue note to match when removing a queued cocktail (`-` matches an empty note)."
          },
          "ignoreQueue": {
            "type": "boolean",
            "description": "When true, skips the cocktail-queue reconciliation."
          }
        },
        "required": [
          "cocktailId"
        ]
      },
      "Tags": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "Unit": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "UnitCreateInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "translations": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional display-name translations keyed by language code, e.g. { \"en\": \"Centiliter\" }."
          }
        },
        "required": [
          "name"
        ]
      },
      "UnitConversion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "fromUnitId": {
            "type": "string"
          },
          "toUnitId": {
            "type": "string"
          },
          "factor": {
            "type": "number",
            "description": "Multiplier to convert a quantity from the source unit to the target unit."
          },
          "autoGenerated": {
            "type": "boolean",
            "description": "Whether this conversion was derived automatically from other conversions."
          }
        },
        "required": [
          "id",
          "fromUnitId",
          "toUnitId",
          "factor",
          "autoGenerated"
        ]
      },
      "UnitConversionCreateInput": {
        "type": "object",
        "properties": {
          "fromUnitId": {
            "type": "string",
            "minLength": 1
          },
          "toUnitId": {
            "type": "string",
            "minLength": 1
          },
          "factor": {
            "type": [
              "number",
              "null"
            ],
            "description": "Multiplier to convert a quantity from the source unit to the target unit."
          }
        },
        "required": [
          "fromUnitId",
          "toUnitId",
          "factor"
        ]
      },
      "UnitConversionUpdateInput": {
        "type": "object",
        "properties": {
          "factor": {
            "type": [
              "number",
              "null"
            ],
            "description": "Multiplier to convert a quantity from the source unit to the target unit."
          }
        },
        "required": [
          "factor"
        ]
      },
      "WorkspaceUser": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL to the user's avatar image, or null."
          },
          "role": {
            "$ref": "#/components/schemas/Role"
          }
        },
        "required": [
          "userId",
          "name",
          "email",
          "image",
          "role"
        ]
      },
      "Role": {
        "type": "string",
        "enum": [
          "OWNER",
          "ADMIN",
          "MANAGER",
          "USER"
        ]
      },
      "WorkspaceUserUpdateInput": {
        "type": "object",
        "properties": {
          "role": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Role"
              },
              {
                "description": "New workspace role for the membership."
              }
            ]
          }
        },
        "required": [
          "role"
        ]
      }
    },
    "parameters": {}
  },
  "paths": {
    "/api/v1/me": {
      "get": {
        "summary": "Get token identity",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\nReturns the workspace, granted permissions and key metadata for the authenticated API token. Use this to resolve the workspace ID from a token without knowing it up front.",
        "tags": [
          "Workspace / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Get token identity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Me"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}": {
      "get": {
        "summary": "Get workspace",
        "description": "**Required API-key permission:** `WORKSPACE_READ` — Read workspace settings and audit logs\n\nGet workspace details including settings and members. Expired demo workspaces are deleted and return 410.",
        "tags": [
          "Workspace / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Workspace"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "410": {
            "description": "Demo workspace has expired and has been deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_READ"
      },
      "put": {
        "summary": "Update workspace",
        "description": "**Required API-key permission:** `WORKSPACE_UPDATE` — Update workspace settings\n\nUpdate the workspace name.",
        "tags": [
          "Workspace / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Workspace"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_UPDATE"
      },
      "delete": {
        "summary": "Delete workspace",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\nPermanently delete the workspace and all its data.",
        "tags": [
          "Workspace / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspaceId}": {
      "get": {
        "summary": "[Deprecated] Get workspace",
        "description": "**Required API-key permission:** `WORKSPACE_READ` — Read workspace settings and audit logs\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Workspace"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "410": {
            "description": "Demo workspace has expired and has been deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_READ"
      },
      "put": {
        "summary": "[Deprecated] Update workspace",
        "description": "**Required API-key permission:** `WORKSPACE_UPDATE` — Update workspace settings\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Workspace"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_UPDATE"
      },
      "delete": {
        "summary": "[Deprecated] Delete workspace",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/actions": {
      "get": {
        "summary": "List step actions",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\nList all cocktail-recipe step actions of a workspace, optionally filtered by name.",
        "tags": [
          "Cocktails / Step actions"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive name filter."
            },
            "required": false,
            "description": "Case-insensitive name filter.",
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List step actions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Action"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      },
      "post": {
        "summary": "Create step action",
        "description": "**Required API-key permission:** `COCKTAILS_UPDATE` — Update cocktail recipes",
        "tags": [
          "Cocktails / Step actions"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create step action",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/actions": {
      "get": {
        "summary": "[Deprecated] List step actions",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/actions` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Step actions"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive name filter."
            },
            "required": false,
            "description": "Case-insensitive name filter.",
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List step actions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Action"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      },
      "post": {
        "summary": "[Deprecated] Create step action",
        "description": "**Required API-key permission:** `COCKTAILS_UPDATE` — Update cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/actions` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Step actions"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create step action",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/actions/{actionId}": {
      "put": {
        "summary": "Update step action",
        "description": "**Required API-key permission:** `COCKTAILS_UPDATE` — Update cocktail recipes\n\nUpdates the action group and (optionally) the display-name translations.",
        "tags": [
          "Cocktails / Step actions"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "actionId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update step action",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Action not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_UPDATE"
      },
      "delete": {
        "summary": "Delete step action",
        "description": "**Required API-key permission:** `COCKTAILS_UPDATE` — Update cocktail recipes",
        "tags": [
          "Cocktails / Step actions"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "actionId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete step action",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Action not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/actions/{actionId}": {
      "put": {
        "summary": "[Deprecated] Update step action",
        "description": "**Required API-key permission:** `COCKTAILS_UPDATE` — Update cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/actions/{actionId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Step actions"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "actionId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update step action",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Action not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_UPDATE"
      },
      "delete": {
        "summary": "[Deprecated] Delete step action",
        "description": "**Required API-key permission:** `COCKTAILS_UPDATE` — Update cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/actions/{actionId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Step actions"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "actionId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete step action",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Action"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Action not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/admin/signage": {
      "get": {
        "summary": "Get signage configuration",
        "description": "**Required API-key permission:** `MONITOR_READ` — Read signage/monitor configuration and slides\n\nSignage configuration and slides per format (landscape / portrait).",
        "tags": [
          "Monitor / Configuration"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "MONITOR_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get signage configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SignageFormat"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "MONITOR_READ"
      },
      "put": {
        "summary": "Update signage configuration",
        "description": "**Required API-key permission:** `MONITOR_UPDATE` — Update signage/monitor configuration and slides",
        "tags": [
          "Monitor / Configuration"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "MONITOR_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignageSettingsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update signage configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SignageFormat"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "MONITOR_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/admin/signage": {
      "get": {
        "summary": "[Deprecated] Get signage configuration",
        "description": "**Required API-key permission:** `MONITOR_READ` — Read signage/monitor configuration and slides\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/admin/signage` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Monitor / Configuration"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "MONITOR_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get signage configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SignageFormat"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "MONITOR_READ"
      },
      "put": {
        "summary": "[Deprecated] Update signage configuration",
        "description": "**Required API-key permission:** `MONITOR_UPDATE` — Update signage/monitor configuration and slides\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/admin/signage` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Monitor / Configuration"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "MONITOR_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignageSettingsUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update signage configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SignageFormat"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "MONITOR_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/admin/signage/slides": {
      "post": {
        "summary": "Upload signage slides",
        "description": "**Required API-key permission:** `MONITOR_UPDATE` — Update signage/monitor configuration and slides",
        "tags": [
          "Monitor / Slides"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "MONITOR_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignageSlideCreateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Upload signage slides",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SignageSlide"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid slide upload payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "MONITOR_UPDATE"
      },
      "patch": {
        "summary": "Update signage slides (schedule / enabled)",
        "description": "**Required API-key permission:** `MONITOR_UPDATE` — Update signage/monitor configuration and slides",
        "tags": [
          "Monitor / Slides"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "MONITOR_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignageSlidePatchInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update signage slides (schedule / enabled)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SignageSlide"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No slide ids or no update fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Slides not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Exclusive date ranges overlap.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "MONITOR_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/admin/signage/slides": {
      "post": {
        "summary": "[Deprecated] Upload signage slides",
        "description": "**Required API-key permission:** `MONITOR_UPDATE` — Update signage/monitor configuration and slides\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/admin/signage/slides` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Monitor / Slides"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "MONITOR_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignageSlideCreateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Upload signage slides",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SignageSlide"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid slide upload payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "MONITOR_UPDATE"
      },
      "patch": {
        "summary": "[Deprecated] Update signage slides (schedule / enabled)",
        "description": "**Required API-key permission:** `MONITOR_UPDATE` — Update signage/monitor configuration and slides\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/admin/signage/slides` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Monitor / Slides"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "MONITOR_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignageSlidePatchInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update signage slides (schedule / enabled)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SignageSlide"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No slide ids or no update fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Slides not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Exclusive date ranges overlap.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "MONITOR_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/admin/signage/slides/{slideId}": {
      "delete": {
        "summary": "Delete signage slide",
        "description": "**Required API-key permission:** `MONITOR_UPDATE` — Update signage/monitor configuration and slides",
        "tags": [
          "Monitor / Slides"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "MONITOR_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "slideId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete signage slide",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Slide not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "MONITOR_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/admin/signage/slides/{slideId}": {
      "delete": {
        "summary": "[Deprecated] Delete signage slide",
        "description": "**Required API-key permission:** `MONITOR_UPDATE` — Update signage/monitor configuration and slides\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/admin/signage/slides/{slideId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Monitor / Slides"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "MONITOR_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "slideId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete signage slide",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Slide not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "MONITOR_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/admin/signage/slides/{slideId}/image": {
      "get": {
        "summary": "Get signage slide image",
        "description": "**Required API-key permission:** `MONITOR_READ` — Read signage/monitor configuration and slides\n\nReturns the slide image bytes (the `imageUrl` target).",
        "tags": [
          "Monitor / Slides"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "MONITOR_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "slideId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The slide image bytes.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Slide not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "MONITOR_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/admin/translation": {
      "put": {
        "summary": "Upsert a translation",
        "description": "**Required API-key permission:** `WORKSPACE_UPDATE` — Update workspace settings\n\nMerges display-name translations for a key into the workspace translation settings.",
        "tags": [
          "Workspace / Settings"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranslationUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upsert a translation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TranslationUpdateResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/admin/translation": {
      "put": {
        "summary": "[Deprecated] Upsert a translation",
        "description": "**Required API-key permission:** `WORKSPACE_UPDATE` — Update workspace settings\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/admin/translation` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Settings"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranslationUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upsert a translation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TranslationUpdateResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/api-keys": {
      "get": {
        "summary": "List API keys",
        "description": "**Required API-key permission:** `WORKSPACE_READ` — Read workspace settings and audit logs\n\nLists the workspace API keys (metadata only — the key value is shown only once, on create).",
        "tags": [
          "Workspace / API keys"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List API keys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_READ"
      },
      "post": {
        "summary": "Create API key",
        "description": "**Authentication:** requires a logged-in workspace-member session. API keys (workspace or the instance master key) are NOT accepted for this operation.\n\nCreates a workspace API key and returns the signed token ONCE. Session-only — API keys cannot mint other keys.",
        "tags": [
          "Workspace / API keys"
        ],
        "security": [
          {
            "SessionCookieAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApiKeyCreateResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspaceId}/api-keys": {
      "get": {
        "summary": "[Deprecated] List API keys",
        "description": "**Required API-key permission:** `WORKSPACE_READ` — Read workspace settings and audit logs\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/api-keys` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / API keys"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List API keys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_READ"
      },
      "post": {
        "summary": "[Deprecated] Create API key",
        "description": "**Authentication:** requires a logged-in workspace-member session. API keys (workspace or the instance master key) are NOT accepted for this operation.\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/api-keys` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / API keys"
        ],
        "deprecated": true,
        "security": [
          {
            "SessionCookieAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApiKeyCreateResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/api-keys/{keyId}": {
      "get": {
        "summary": "Get API key",
        "description": "**Required API-key permission:** `WORKSPACE_READ` — Read workspace settings and audit logs",
        "tags": [
          "Workspace / API keys"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "keyId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApiKey"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "API key not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_READ"
      },
      "delete": {
        "summary": "Revoke API key",
        "description": "**Authentication:** requires a logged-in workspace-member session. API keys (workspace or the instance master key) are NOT accepted for this operation.\n\nRevokes (deletes) a workspace API key. Session-only — API keys cannot revoke keys.",
        "tags": [
          "Workspace / API keys"
        ],
        "security": [
          {
            "SessionCookieAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "keyId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Revoke API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "API key not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspaceId}/api-keys/{keyId}": {
      "get": {
        "summary": "[Deprecated] Get API key",
        "description": "**Required API-key permission:** `WORKSPACE_READ` — Read workspace settings and audit logs\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/api-keys/{keyId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / API keys"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "keyId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApiKey"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "API key not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_READ"
      },
      "delete": {
        "summary": "[Deprecated] Revoke API key",
        "description": "**Authentication:** requires a logged-in workspace-member session. API keys (workspace or the instance master key) are NOT accepted for this operation.\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/api-keys/{keyId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / API keys"
        ],
        "deprecated": true,
        "security": [
          {
            "SessionCookieAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "keyId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Revoke API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "API key not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/audit-logs": {
      "get": {
        "summary": "List audit logs",
        "description": "**Required API-key permission:** `WORKSPACE_READ` — Read workspace settings and audit logs\n\nList audit log entries of a workspace, newest first. Optionally filtered by entity type/ID. Paginated: the response is a `{ data, pagination }` envelope (not a bare array); `data` holds the `AuditLog[]` page.",
        "tags": [
          "Audit Logs / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by entity type, e.g. `Glass`."
            },
            "required": false,
            "description": "Filter by entity type, e.g. `Glass`.",
            "name": "entityType",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by entity ID."
            },
            "required": false,
            "description": "Filter by entity ID.",
            "name": "entityId",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "description": "1-based page number."
            },
            "required": false,
            "description": "1-based page number.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50,
              "description": "Items per page."
            },
            "required": false,
            "description": "Items per page.",
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List audit logs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AuditLog"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_READ"
      }
    },
    "/api/workspaces/{workspaceId}/audit-logs": {
      "get": {
        "summary": "[Deprecated] List audit logs",
        "description": "**Required API-key permission:** `WORKSPACE_READ` — Read workspace settings and audit logs\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/audit-logs` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Audit Logs / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by entity type, e.g. `Glass`."
            },
            "required": false,
            "description": "Filter by entity type, e.g. `Glass`.",
            "name": "entityType",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by entity ID."
            },
            "required": false,
            "description": "Filter by entity ID.",
            "name": "entityId",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "description": "1-based page number."
            },
            "required": false,
            "description": "1-based page number.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50,
              "description": "Items per page."
            },
            "required": false,
            "description": "Items per page.",
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List audit logs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AuditLog"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/calculations": {
      "get": {
        "summary": "List calculations",
        "description": "**Required API-key permission:** `CALCULATIONS_READ` — Read cost calculations\n\nList all cocktail calculations of a workspace. Returns a slim summary (group ref + slim items); use GET /calculations/{calculationId} for the full calculation.",
        "tags": [
          "Calculations / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List calculations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CalculationSummary"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_READ"
      },
      "post": {
        "summary": "Create calculation",
        "description": "**Required API-key permission:** `CALCULATIONS_CREATE` — Create cost calculations",
        "tags": [
          "Calculations / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculationCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create calculation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalculationSummary"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid group.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/calculations": {
      "get": {
        "summary": "[Deprecated] List calculations",
        "description": "**Required API-key permission:** `CALCULATIONS_READ` — Read cost calculations\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/calculations` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Calculations / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List calculations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CalculationSummary"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_READ"
      },
      "post": {
        "summary": "[Deprecated] Create calculation",
        "description": "**Required API-key permission:** `CALCULATIONS_CREATE` — Create cost calculations\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/calculations` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Calculations / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculationCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create calculation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalculationSummary"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid group.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/calculations/{calculationId}": {
      "get": {
        "summary": "Get calculation",
        "description": "**Required API-key permission:** `CALCULATIONS_READ` — Read cost calculations\n\nReturns the full calculation including fully-hydrated cocktail items and ingredient shopping units.",
        "tags": [
          "Calculations / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "calculationId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get calculation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Calculation"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Calculation not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_READ"
      },
      "put": {
        "summary": "Update calculation",
        "description": "**Required API-key permission:** `CALCULATIONS_UPDATE` — Update cost calculations\n\nReplaces the calculation metadata and its full set of items and ingredient shopping units.",
        "tags": [
          "Calculations / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "calculationId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculationUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update calculation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalculationSummary"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid group.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_UPDATE"
      },
      "delete": {
        "summary": "Delete calculation",
        "description": "**Required API-key permission:** `CALCULATIONS_DELETE` — Delete cost calculations",
        "tags": [
          "Calculations / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "calculationId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete calculation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_DELETE"
      }
    },
    "/api/workspaces/{workspaceId}/calculations/{calculationId}": {
      "get": {
        "summary": "[Deprecated] Get calculation",
        "description": "**Required API-key permission:** `CALCULATIONS_READ` — Read cost calculations\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/calculations/{calculationId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Calculations / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "calculationId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get calculation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Calculation"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Calculation not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_READ"
      },
      "put": {
        "summary": "[Deprecated] Update calculation",
        "description": "**Required API-key permission:** `CALCULATIONS_UPDATE` — Update cost calculations\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/calculations/{calculationId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Calculations / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "calculationId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculationUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update calculation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalculationSummary"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid group.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_UPDATE"
      },
      "delete": {
        "summary": "[Deprecated] Delete calculation",
        "description": "**Required API-key permission:** `CALCULATIONS_DELETE` — Delete cost calculations\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/calculations/{calculationId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Calculations / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "calculationId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete calculation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_DELETE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/calculations/export/json": {
      "post": {
        "summary": "Export calculations as JSON",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\nReturns a self-contained JSON dump of the selected calculations (metadata, cocktail items and ingredient shopping units, resolved to names) that can be re-imported via POST /calculations/import/json. A single selected calculation is returned as a bare object; multiple as an array. The exact dump shape is preserved verbatim for a lossless round-trip (not wrapped in a data envelope).",
        "tags": [
          "Calculations / Import & export"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculationExportJsonInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Export calculations as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "description": "Raw export dump (see CocktailCalculationExportStructure). Returned verbatim, not wrapped in a data envelope."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "No calculations selected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No calculations found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Export failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/calculations/groups": {
      "get": {
        "summary": "List calculation groups",
        "description": "**Required API-key permission:** `CALCULATIONS_READ` — Read cost calculations\n\nList all calculation groups of a workspace, ordered by name.",
        "tags": [
          "Calculations / Groups"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List calculation groups",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CalculationGroup"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_READ"
      },
      "post": {
        "summary": "Create calculation group",
        "description": "**Required API-key permission:** `CALCULATIONS_UPDATE` — Update cost calculations",
        "tags": [
          "Calculations / Groups"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculationGroupCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create calculation group",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalculationGroup"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A group with this name already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/calculations/groups": {
      "get": {
        "summary": "[Deprecated] List calculation groups",
        "description": "**Required API-key permission:** `CALCULATIONS_READ` — Read cost calculations\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/calculations/groups` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Calculations / Groups"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List calculation groups",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CalculationGroup"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_READ"
      },
      "post": {
        "summary": "[Deprecated] Create calculation group",
        "description": "**Required API-key permission:** `CALCULATIONS_UPDATE` — Update cost calculations\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/calculations/groups` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Calculations / Groups"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculationGroupCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create calculation group",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalculationGroup"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A group with this name already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/calculations/groups/{groupId}": {
      "put": {
        "summary": "Update calculation group",
        "description": "**Required API-key permission:** `CALCULATIONS_UPDATE` — Update cost calculations",
        "tags": [
          "Calculations / Groups"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "groupId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculationGroupUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update calculation group",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalculationGroup"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Group not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A group with this name already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_UPDATE"
      },
      "delete": {
        "summary": "Delete calculation group",
        "description": "**Required API-key permission:** `CALCULATIONS_UPDATE` — Update cost calculations\n\nDeletes the group; its calculations are unassigned (group set to null).",
        "tags": [
          "Calculations / Groups"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "groupId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete calculation group",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Group not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/calculations/groups/{groupId}": {
      "put": {
        "summary": "[Deprecated] Update calculation group",
        "description": "**Required API-key permission:** `CALCULATIONS_UPDATE` — Update cost calculations\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/calculations/groups/{groupId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Calculations / Groups"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "groupId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculationGroupUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update calculation group",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CalculationGroup"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Group not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A group with this name already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_UPDATE"
      },
      "delete": {
        "summary": "[Deprecated] Delete calculation group",
        "description": "**Required API-key permission:** `CALCULATIONS_UPDATE` — Update cost calculations\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/calculations/groups/{groupId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Calculations / Groups"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "groupId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete calculation group",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Group not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/calculations/groups/assign": {
      "post": {
        "summary": "Assign calculations to a group",
        "description": "**Required API-key permission:** `CALCULATIONS_UPDATE` — Update cost calculations\n\nAssigns the given calculations to a group, or removes their group assignment when groupId is null.",
        "tags": [
          "Calculations / Groups"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculationGroupAssignInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Assign calculations to a group",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GroupAssignmentResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Group not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/calculations/groups/assign": {
      "post": {
        "summary": "[Deprecated] Assign calculations to a group",
        "description": "**Required API-key permission:** `CALCULATIONS_UPDATE` — Update cost calculations\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/calculations/groups/assign` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Calculations / Groups"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculationGroupAssignInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Assign calculations to a group",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GroupAssignmentResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Group not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/calculations/import/json": {
      "post": {
        "summary": "Import calculations from JSON",
        "description": "**Required API-key permission:** `CALCULATIONS_READ` — Read cost calculations\n\nThree-phase import (`validate` → `prepare-mapping` → `execute`) of an export dump produced by POST /calculations/export/json. The response shape depends on the phase and is returned verbatim (not wrapped in a data envelope).",
        "tags": [
          "Calculations / Import & export"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CALCULATIONS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculationImportJsonInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import calculations from JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "description": "Phase-dependent import result (validation summary, mapping suggestions, or import results). Returned verbatim."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid phase or missing decisions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Import failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CALCULATIONS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cards": {
      "get": {
        "summary": "List cards",
        "description": "**Required API-key permission:** `CARDS_READ` — Read cocktail cards (menus)\n\nList all cocktail cards of a workspace. Returns a slim summary without nested groups; use GET /cards/{cardId} for the full card.",
        "tags": [
          "Cards / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "boolean",
              "description": "Include archived cards when true (default false)."
            },
            "required": false,
            "description": "Include archived cards when true (default false).",
            "name": "withArchived",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List cards",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CardSummary"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_READ"
      },
      "post": {
        "summary": "Create card",
        "description": "**Required API-key permission:** `CARDS_CREATE` — Create cocktail cards",
        "tags": [
          "Cards / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Card"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/cards": {
      "get": {
        "summary": "[Deprecated] List cards",
        "description": "**Required API-key permission:** `CARDS_READ` — Read cocktail cards (menus)\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cards` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cards / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "boolean",
              "description": "Include archived cards when true (default false)."
            },
            "required": false,
            "description": "Include archived cards when true (default false).",
            "name": "withArchived",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List cards",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CardSummary"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_READ"
      },
      "post": {
        "summary": "[Deprecated] Create card",
        "description": "**Required API-key permission:** `CARDS_CREATE` — Create cocktail cards\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cards` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cards / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Card"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cards/{cardId}": {
      "get": {
        "summary": "Get card",
        "description": "**Required API-key permission:** `CARDS_READ` — Read cocktail cards (menus)\n\nReturns the full card including nested groups and items.",
        "tags": [
          "Cards / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cardId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Card"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Card not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_READ"
      },
      "put": {
        "summary": "Update card",
        "description": "**Required API-key permission:** `CARDS_UPDATE` — Update cocktail cards\n\nReplaces the card metadata and its full set of groups/items.",
        "tags": [
          "Cards / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cardId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Card"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_UPDATE"
      },
      "delete": {
        "summary": "Delete card",
        "description": "**Required API-key permission:** `CARDS_DELETE` — Delete cocktail cards",
        "tags": [
          "Cards / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cardId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_DELETE"
      }
    },
    "/api/workspaces/{workspaceId}/cards/{cardId}": {
      "get": {
        "summary": "[Deprecated] Get card",
        "description": "**Required API-key permission:** `CARDS_READ` — Read cocktail cards (menus)\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cards/{cardId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cards / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cardId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Card"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Card not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_READ"
      },
      "put": {
        "summary": "[Deprecated] Update card",
        "description": "**Required API-key permission:** `CARDS_UPDATE` — Update cocktail cards\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cards/{cardId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cards / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cardId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Card"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_UPDATE"
      },
      "delete": {
        "summary": "[Deprecated] Delete card",
        "description": "**Required API-key permission:** `CARDS_DELETE` — Delete cocktail cards\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cards/{cardId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cards / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cardId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_DELETE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cards/{cardId}/archive": {
      "put": {
        "summary": "Archive card",
        "description": "**Required API-key permission:** `CARDS_UPDATE` — Update cocktail cards",
        "tags": [
          "Cards / Lifecycle"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cardId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Archive card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CardSummary"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Card not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/cards/{cardId}/archive": {
      "put": {
        "summary": "[Deprecated] Archive card",
        "description": "**Required API-key permission:** `CARDS_UPDATE` — Update cocktail cards\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cards/{cardId}/archive` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cards / Lifecycle"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cardId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Archive card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CardSummary"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Card not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cards/{cardId}/clone": {
      "post": {
        "summary": "Clone card",
        "description": "**Required API-key permission:** `CARDS_CREATE` — Create cocktail cards\n\nCreates a deep copy of a card (groups and items) under a new name.",
        "tags": [
          "Cards / Lifecycle"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cardId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardCloneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clone card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Card"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Card not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/cards/{cardId}/clone": {
      "post": {
        "summary": "[Deprecated] Clone card",
        "description": "**Required API-key permission:** `CARDS_CREATE` — Create cocktail cards\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cards/{cardId}/clone` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cards / Lifecycle"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cardId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardCloneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clone card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Card"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Card not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cards/{cardId}/unarchive": {
      "put": {
        "summary": "Unarchive card",
        "description": "**Required API-key permission:** `CARDS_UPDATE` — Update cocktail cards",
        "tags": [
          "Cards / Lifecycle"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cardId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Unarchive card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CardSummary"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Card not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/cards/{cardId}/unarchive": {
      "put": {
        "summary": "[Deprecated] Unarchive card",
        "description": "**Required API-key permission:** `CARDS_UPDATE` — Update cocktail cards\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cards/{cardId}/unarchive` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cards / Lifecycle"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "CARDS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cardId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Unarchive card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CardSummary"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Card not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "CARDS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cocktails": {
      "get": {
        "summary": "List cocktails",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\nList all cocktails of a workspace, optionally filtered by a free-text search over name, tags, garnishes and ingredients. Returns slim summaries; use GET /cocktails/{cocktailId} for the full recipe.",
        "tags": [
          "Cocktails / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive filter over name, tags, garnishes and ingredients."
            },
            "required": false,
            "description": "Case-insensitive filter over name, tags, garnishes and ingredients.",
            "name": "search",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Comma-separated extra projections to embed in each summary: `garnishes`, `ingredients`."
            },
            "required": false,
            "description": "Comma-separated extra projections to embed in each summary: `garnishes`, `ingredients`.",
            "name": "include",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List cocktails",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CocktailSummary"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      },
      "post": {
        "summary": "Create cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_CREATE` — Create cocktail recipes",
        "tags": [
          "Cocktails / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CocktailCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cocktail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/cocktails": {
      "get": {
        "summary": "[Deprecated] List cocktails",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive filter over name, tags, garnishes and ingredients."
            },
            "required": false,
            "description": "Case-insensitive filter over name, tags, garnishes and ingredients.",
            "name": "search",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Comma-separated extra projections to embed in each summary: `garnishes`, `ingredients`."
            },
            "required": false,
            "description": "Comma-separated extra projections to embed in each summary: `garnishes`, `ingredients`.",
            "name": "include",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List cocktails",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CocktailSummary"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      },
      "post": {
        "summary": "[Deprecated] Create cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_CREATE` — Create cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CocktailCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cocktail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}": {
      "get": {
        "summary": "Get cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\nReturns the full cocktail including nested steps, ingredients, garnishes and rating aggregates.",
        "tags": [
          "Cocktails / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cocktail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      },
      "put": {
        "summary": "Update cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_UPDATE` — Update cocktail recipes\n\nUpdates the cocktail metadata and differentially applies its steps, ingredients and garnishes.",
        "tags": [
          "Cocktails / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CocktailUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cocktail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_UPDATE"
      },
      "delete": {
        "summary": "Delete cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_DELETE` — Delete cocktail recipes",
        "tags": [
          "Cocktails / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_DELETE"
      }
    },
    "/api/workspaces/{workspaceId}/cocktails/{cocktailId}": {
      "get": {
        "summary": "[Deprecated] Get cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cocktail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      },
      "put": {
        "summary": "[Deprecated] Update cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_UPDATE` — Update cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CocktailUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cocktail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_UPDATE"
      },
      "delete": {
        "summary": "[Deprecated] Delete cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_DELETE` — Delete cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_DELETE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/archive": {
      "put": {
        "summary": "Archive cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_UPDATE` — Update cocktail recipes",
        "tags": [
          "Cocktails / Lifecycle"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Archive cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cocktail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/cocktails/{cocktailId}/archive": {
      "put": {
        "summary": "[Deprecated] Archive cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_UPDATE` — Update cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/archive` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Lifecycle"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Archive cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cocktail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/clone": {
      "post": {
        "summary": "Clone cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_CREATE` — Create cocktail recipes\n\nCreates a deep copy of a cocktail (image, steps, ingredients and garnishes) under a new name.",
        "tags": [
          "Cocktails / Lifecycle"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CocktailCloneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clone cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cocktail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/cocktails/{cocktailId}/clone": {
      "post": {
        "summary": "[Deprecated] Clone cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_CREATE` — Create cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/clone` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Lifecycle"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CocktailCloneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clone cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cocktail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/image": {
      "get": {
        "summary": "Get cocktail image",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\nReturns the cocktail image bytes (the `imageUrl` target). 404 when the cocktail has no image.",
        "tags": [
          "Cocktails / Media"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The cocktail image bytes.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The cocktail has no image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/cocktails/{cocktailId}/image": {
      "get": {
        "summary": "[Deprecated] Get cocktail image",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/image` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Media"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The cocktail image bytes.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The cocktail has no image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/ratings": {
      "get": {
        "summary": "List ratings",
        "description": "**Required API-key permission:** `RATINGS_READ` — Read cocktail ratings\n\nList all ratings of a cocktail.",
        "tags": [
          "Ratings / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "RATINGS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List ratings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Rating"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "RATINGS_READ"
      },
      "post": {
        "summary": "Create rating",
        "description": "**Required API-key permission:** `RATINGS_CREATE` — Create cocktail ratings",
        "tags": [
          "Ratings / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "RATINGS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RatingCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create rating",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Rating"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "RATINGS_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/cocktails/{cocktailId}/ratings": {
      "get": {
        "summary": "[Deprecated] List ratings",
        "description": "**Required API-key permission:** `RATINGS_READ` — Read cocktail ratings\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/ratings` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ratings / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "RATINGS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List ratings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Rating"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "RATINGS_READ"
      },
      "post": {
        "summary": "[Deprecated] Create rating",
        "description": "**Required API-key permission:** `RATINGS_CREATE` — Create cocktail ratings\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/ratings` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ratings / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "RATINGS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RatingCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create rating",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Rating"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "RATINGS_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/ratings/{ratingId}": {
      "delete": {
        "summary": "Delete rating",
        "description": "**Required API-key permission:** `RATINGS_DELETE` — Delete cocktail ratings",
        "tags": [
          "Ratings / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "RATINGS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ratingId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete rating",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Rating"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Rating not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "RATINGS_DELETE"
      }
    },
    "/api/workspaces/{workspaceId}/cocktails/{cocktailId}/ratings/{ratingId}": {
      "delete": {
        "summary": "[Deprecated] Delete rating",
        "description": "**Required API-key permission:** `RATINGS_DELETE` — Delete cocktail ratings\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/ratings/{ratingId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ratings / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "RATINGS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ratingId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete rating",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Rating"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Rating not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "RATINGS_DELETE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/unarchive": {
      "put": {
        "summary": "Unarchive cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_UPDATE` — Update cocktail recipes",
        "tags": [
          "Cocktails / Lifecycle"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Unarchive cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cocktail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/cocktails/{cocktailId}/unarchive": {
      "put": {
        "summary": "[Deprecated] Unarchive cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_UPDATE` — Update cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails/{cocktailId}/unarchive` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Lifecycle"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Unarchive cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cocktail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cocktails/check": {
      "get": {
        "summary": "Find similar cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\nReturns the most similar existing cocktail by name, or null.",
        "tags": [
          "Cocktails / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Name to check for a similar existing cocktail (min. 3 chars)."
            },
            "required": true,
            "description": "Name to check for a similar existing cocktail (min. 3 chars).",
            "name": "name",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Find similar cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/CocktailSummary"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/cocktails/check": {
      "get": {
        "summary": "[Deprecated] Find similar cocktail",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/cocktails/check` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Cocktails / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Name to check for a similar existing cocktail (min. 3 chars)."
            },
            "required": true,
            "description": "Name to check for a similar existing cocktail (min. 3 chars).",
            "name": "name",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Find similar cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/CocktailSummary"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cocktails/export/json": {
      "post": {
        "summary": "Export cocktails as JSON",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\nReturns a self-contained JSON dump (cocktails plus their referenced glasses, garnishes, ingredients, units, ice and step actions, including images) that can be re-imported via POST /cocktails/import/json. The exact dump shape is preserved verbatim for a lossless round-trip.",
        "tags": [
          "Cocktails / Import & export"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CocktailExportJsonInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Export cocktails as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "description": "Raw export dump (see types/CocktailExportStructure.ts). Returned verbatim, not wrapped in a data envelope."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "No cocktails selected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No cocktails found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/cocktails/export/pdf": {
      "post": {
        "summary": "Export cocktails as PDF",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\nRenders the selected cocktails to a single PDF document. Requires the Chromium PDF service to be configured.",
        "tags": [
          "Cocktails / Import & export"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CocktailExportPdfInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The generated PDF document.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "cocktailIds missing or empty.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No cocktails found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "PDF export service not configured/available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/cocktails/import/json": {
      "post": {
        "summary": "Import cocktails from JSON",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\nThree-phase import (`validate` → `prepare-mapping` → `execute`) of an export dump produced by POST /cocktails/export/json. The response shape depends on the phase and is returned verbatim (not wrapped in a data envelope).",
        "tags": [
          "Cocktails / Import & export"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CocktailImportJsonInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import cocktails from JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "description": "Phase-dependent import result (validation summary, mapping suggestions, or import counts). Returned verbatim."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid structure/phase or missing mapping decisions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Import failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/garnishes": {
      "get": {
        "summary": "List garnishes",
        "description": "**Required API-key permission:** `GARNISHES_READ` — Read garnishes\n\nList all garnishes of a workspace, optionally filtered by name.",
        "tags": [
          "Garnishes / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive name filter."
            },
            "required": false,
            "description": "Case-insensitive name filter.",
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List garnishes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Garnish"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_READ"
      },
      "post": {
        "summary": "Create garnish",
        "description": "**Required API-key permission:** `GARNISHES_CREATE` — Create garnishes",
        "tags": [
          "Garnishes / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GarnishCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create garnish",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Garnish"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/garnishes": {
      "get": {
        "summary": "[Deprecated] List garnishes",
        "description": "**Required API-key permission:** `GARNISHES_READ` — Read garnishes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/garnishes` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Garnishes / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive name filter."
            },
            "required": false,
            "description": "Case-insensitive name filter.",
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List garnishes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Garnish"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_READ"
      },
      "post": {
        "summary": "[Deprecated] Create garnish",
        "description": "**Required API-key permission:** `GARNISHES_CREATE` — Create garnishes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/garnishes` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Garnishes / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GarnishCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create garnish",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Garnish"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/garnishes/{garnishId}": {
      "get": {
        "summary": "Get garnish",
        "description": "**Required API-key permission:** `GARNISHES_READ` — Read garnishes",
        "tags": [
          "Garnishes / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "garnishId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get garnish",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Garnish"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Garnish not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_READ"
      },
      "put": {
        "summary": "Update garnish",
        "description": "**Required API-key permission:** `GARNISHES_UPDATE` — Update garnishes",
        "tags": [
          "Garnishes / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "garnishId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GarnishUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update garnish",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Garnish"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_UPDATE"
      },
      "delete": {
        "summary": "Delete garnish",
        "description": "**Required API-key permission:** `GARNISHES_DELETE` — Delete garnishes",
        "tags": [
          "Garnishes / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "garnishId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete garnish",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_DELETE"
      }
    },
    "/api/workspaces/{workspaceId}/garnishes/{garnishId}": {
      "get": {
        "summary": "[Deprecated] Get garnish",
        "description": "**Required API-key permission:** `GARNISHES_READ` — Read garnishes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/garnishes/{garnishId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Garnishes / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "garnishId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get garnish",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Garnish"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Garnish not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_READ"
      },
      "put": {
        "summary": "[Deprecated] Update garnish",
        "description": "**Required API-key permission:** `GARNISHES_UPDATE` — Update garnishes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/garnishes/{garnishId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Garnishes / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "garnishId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GarnishUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update garnish",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Garnish"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_UPDATE"
      },
      "delete": {
        "summary": "[Deprecated] Delete garnish",
        "description": "**Required API-key permission:** `GARNISHES_DELETE` — Delete garnishes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/garnishes/{garnishId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Garnishes / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "garnishId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete garnish",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_DELETE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/garnishes/{garnishId}/clone": {
      "post": {
        "summary": "Clone garnish",
        "description": "**Required API-key permission:** `GARNISHES_CREATE` — Create garnishes\n\nCreates a copy of a garnish (including its image) under a new name.",
        "tags": [
          "Garnishes / Lifecycle"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "garnishId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GarnishCloneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clone garnish",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Garnish"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Garnish not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/garnishes/{garnishId}/clone": {
      "post": {
        "summary": "[Deprecated] Clone garnish",
        "description": "**Required API-key permission:** `GARNISHES_CREATE` — Create garnishes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/garnishes/{garnishId}/clone` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Garnishes / Lifecycle"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "garnishId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GarnishCloneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clone garnish",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Garnish"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Garnish not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/garnishes/{garnishId}/image": {
      "get": {
        "summary": "Get garnish image",
        "description": "**Required API-key permission:** `GARNISHES_READ` — Read garnishes\n\nReturns the garnish image bytes (the `imageUrl` target). 404 when the garnish has no image.",
        "tags": [
          "Garnishes / Media"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "garnishId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The garnish image bytes.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The garnish has no image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_READ"
      }
    },
    "/api/workspaces/{workspaceId}/garnishes/{garnishId}/image": {
      "get": {
        "summary": "[Deprecated] Get garnish image",
        "description": "**Required API-key permission:** `GARNISHES_READ` — Read garnishes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/garnishes/{garnishId}/image` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Garnishes / Media"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "garnishId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The garnish image bytes.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The garnish has no image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/garnishes/check": {
      "get": {
        "summary": "Find similar garnish",
        "description": "**Required API-key permission:** `GARNISHES_READ` — Read garnishes\n\nReturns the most similar existing garnish by name, or null.",
        "tags": [
          "Garnishes / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Name to check for a similar existing garnish (min. 3 chars)."
            },
            "required": true,
            "description": "Name to check for a similar existing garnish (min. 3 chars).",
            "name": "name",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Find similar garnish",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Garnish"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_READ"
      }
    },
    "/api/workspaces/{workspaceId}/garnishes/check": {
      "get": {
        "summary": "[Deprecated] Find similar garnish",
        "description": "**Required API-key permission:** `GARNISHES_READ` — Read garnishes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/garnishes/check` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Garnishes / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Name to check for a similar existing garnish (min. 3 chars)."
            },
            "required": true,
            "description": "Name to check for a similar existing garnish (min. 3 chars).",
            "name": "name",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Find similar garnish",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Garnish"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/garnishes/export/json": {
      "post": {
        "summary": "Export garnishes as JSON",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\nExports the selected garnishes in the portable JSON export format. A single garnish yields one export object; multiple garnishes yield an array. This payload is the exact input accepted by the import endpoint.",
        "tags": [
          "Garnishes / Import & export"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GarnishExportInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Export garnishes as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "description": "Legacy garnish export structure (single object or array). Round-trips with the import endpoint."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/garnishes/import/json": {
      "post": {
        "summary": "Import garnishes from JSON",
        "description": "**Required API-key permission:** `GARNISHES_CREATE` — Create garnishes\n\nImports garnishes from the portable JSON export format via a three-phase flow (validate / prepare-mapping / execute). Consumes exactly what the export endpoint produces.",
        "tags": [
          "Garnishes / Import & export"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GARNISHES_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "Import request: { phase, exportData, decisions? }. exportData is the garnish export structure (single object or array)."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import garnishes from JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "description": "Phase-dependent legacy import result (validation summary, mapping proposal or execution results)."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GARNISHES_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/glasses": {
      "get": {
        "summary": "List glasses",
        "description": "**Required API-key permission:** `GLASSES_READ` — Read glasses\n\nList all glasses of a workspace, optionally filtered by name.",
        "tags": [
          "Glasses / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive name filter."
            },
            "required": false,
            "description": "Case-insensitive name filter.",
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List glasses",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Glass"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_READ"
      },
      "post": {
        "summary": "Create glass",
        "description": "**Required API-key permission:** `GLASSES_CREATE` — Create glasses",
        "tags": [
          "Glasses / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlassCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create glass",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Glass"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/glasses": {
      "get": {
        "summary": "[Deprecated] List glasses",
        "description": "**Required API-key permission:** `GLASSES_READ` — Read glasses\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/glasses` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Glasses / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive name filter."
            },
            "required": false,
            "description": "Case-insensitive name filter.",
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List glasses",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Glass"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_READ"
      },
      "post": {
        "summary": "[Deprecated] Create glass",
        "description": "**Required API-key permission:** `GLASSES_CREATE` — Create glasses\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/glasses` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Glasses / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlassCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create glass",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Glass"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/glasses/{glassId}": {
      "get": {
        "summary": "Get glass",
        "description": "**Required API-key permission:** `GLASSES_READ` — Read glasses",
        "tags": [
          "Glasses / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "glassId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get glass",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Glass"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Glass not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_READ"
      },
      "put": {
        "summary": "Update glass",
        "description": "**Required API-key permission:** `GLASSES_UPDATE` — Update glasses",
        "tags": [
          "Glasses / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "glassId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlassUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update glass",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Glass"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_UPDATE"
      },
      "delete": {
        "summary": "Delete glass",
        "description": "**Required API-key permission:** `GLASSES_DELETE` — Delete glasses",
        "tags": [
          "Glasses / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "glassId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete glass",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Glass is still referenced by cocktails and cannot be deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_DELETE"
      }
    },
    "/api/workspaces/{workspaceId}/glasses/{glassId}": {
      "get": {
        "summary": "[Deprecated] Get glass",
        "description": "**Required API-key permission:** `GLASSES_READ` — Read glasses\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/glasses/{glassId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Glasses / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "glassId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get glass",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Glass"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Glass not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_READ"
      },
      "put": {
        "summary": "[Deprecated] Update glass",
        "description": "**Required API-key permission:** `GLASSES_UPDATE` — Update glasses\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/glasses/{glassId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Glasses / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "glassId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlassUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update glass",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Glass"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_UPDATE"
      },
      "delete": {
        "summary": "[Deprecated] Delete glass",
        "description": "**Required API-key permission:** `GLASSES_DELETE` — Delete glasses\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/glasses/{glassId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Glasses / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "glassId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete glass",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Glass is still referenced by cocktails and cannot be deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_DELETE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/glasses/{glassId}/clone": {
      "post": {
        "summary": "Clone glass",
        "description": "**Required API-key permission:** `GLASSES_CREATE` — Create glasses\n\nCreates a copy of a glass (including its image) under a new name.",
        "tags": [
          "Glasses / Lifecycle"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "glassId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlassCloneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clone glass",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Glass"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Glass not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/glasses/{glassId}/clone": {
      "post": {
        "summary": "[Deprecated] Clone glass",
        "description": "**Required API-key permission:** `GLASSES_CREATE` — Create glasses\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/glasses/{glassId}/clone` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Glasses / Lifecycle"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "glassId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlassCloneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clone glass",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Glass"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Glass not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/glasses/{glassId}/image": {
      "get": {
        "summary": "Get glass image",
        "description": "**Required API-key permission:** `GLASSES_READ` — Read glasses\n\nReturns the glass image bytes (the `imageUrl` target). 404 when the glass has no image.",
        "tags": [
          "Glasses / Media"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "glassId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The glass image bytes.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The glass has no image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_READ"
      }
    },
    "/api/workspaces/{workspaceId}/glasses/{glassId}/image": {
      "get": {
        "summary": "[Deprecated] Get glass image",
        "description": "**Required API-key permission:** `GLASSES_READ` — Read glasses\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/glasses/{glassId}/image` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Glasses / Media"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "glassId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The glass image bytes.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The glass has no image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/glasses/{glassId}/references": {
      "get": {
        "summary": "List glass references",
        "description": "**Required API-key permission:** `GLASSES_READ` — Read glasses\n\nLists the cocktails that reference this glass.",
        "tags": [
          "Glasses / References"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "glassId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List glass references",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GlassReference"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_READ"
      }
    },
    "/api/workspaces/{workspaceId}/glasses/{glassId}/references": {
      "get": {
        "summary": "[Deprecated] List glass references",
        "description": "**Required API-key permission:** `GLASSES_READ` — Read glasses\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/glasses/{glassId}/references` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Glasses / References"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "glassId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List glass references",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GlassReference"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/glasses/check": {
      "get": {
        "summary": "Find similar glass",
        "description": "**Required API-key permission:** `GLASSES_READ` — Read glasses\n\nReturns the most similar existing glass by name, or null.",
        "tags": [
          "Glasses / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Name to check for a similar existing glass (min. 3 chars)."
            },
            "required": true,
            "description": "Name to check for a similar existing glass (min. 3 chars).",
            "name": "name",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Find similar glass",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Glass"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_READ"
      }
    },
    "/api/workspaces/{workspaceId}/glasses/check": {
      "get": {
        "summary": "[Deprecated] Find similar glass",
        "description": "**Required API-key permission:** `GLASSES_READ` — Read glasses\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/glasses/check` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Glasses / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Name to check for a similar existing glass (min. 3 chars)."
            },
            "required": true,
            "description": "Name to check for a similar existing glass (min. 3 chars).",
            "name": "name",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Find similar glass",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Glass"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/glasses/export/json": {
      "post": {
        "summary": "Export glasses as JSON",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\nExports the selected glasses in the portable JSON export format. A single glass yields one export object; multiple glasses yield an array. This payload is the exact input accepted by the import endpoint.",
        "tags": [
          "Glasses / Import & export"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlassExportInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Export glasses as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "description": "Legacy glass export structure (single object or array). Round-trips with the import endpoint."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/glasses/import/json": {
      "post": {
        "summary": "Import glasses from JSON",
        "description": "**Required API-key permission:** `GLASSES_CREATE` — Create glasses\n\nImports glasses from the portable JSON export format via a three-phase flow (validate / prepare-mapping / execute). Consumes exactly what the export endpoint produces.",
        "tags": [
          "Glasses / Import & export"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "GLASSES_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "Import request: { phase, exportData, decisions? }. exportData is the glass export structure (single object or array)."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import glasses from JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "description": "Phase-dependent legacy import result (validation summary, mapping proposal or execution results)."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "GLASSES_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/ice": {
      "get": {
        "summary": "List ice",
        "description": "**Required API-key permission:** `ICE_READ` — Read ice types\n\nList all ice of a workspace, optionally filtered by name.",
        "tags": [
          "Ice / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "ICE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive name filter."
            },
            "required": false,
            "description": "Case-insensitive name filter.",
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List ice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Ice"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "ICE_READ"
      },
      "post": {
        "summary": "Create ice",
        "description": "**Required API-key permission:** `ICE_CREATE` — Create ice types",
        "tags": [
          "Ice / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "ICE_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IceCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create ice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "ICE_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/ice": {
      "get": {
        "summary": "[Deprecated] List ice",
        "description": "**Required API-key permission:** `ICE_READ` — Read ice types\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ice` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ice / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "ICE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive name filter."
            },
            "required": false,
            "description": "Case-insensitive name filter.",
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List ice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Ice"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "ICE_READ"
      },
      "post": {
        "summary": "[Deprecated] Create ice",
        "description": "**Required API-key permission:** `ICE_CREATE` — Create ice types\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ice` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ice / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "ICE_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IceCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create ice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "ICE_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/ice/{iceId}": {
      "get": {
        "summary": "Get ice",
        "description": "**Required API-key permission:** `ICE_READ` — Read ice types",
        "tags": [
          "Ice / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "ICE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "iceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get ice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Ice not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "ICE_READ"
      },
      "put": {
        "summary": "Update ice",
        "description": "**Required API-key permission:** `ICE_UPDATE` — Update ice types",
        "tags": [
          "Ice / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "ICE_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "iceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IceUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update ice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "ICE_UPDATE"
      },
      "delete": {
        "summary": "Delete ice",
        "description": "**Required API-key permission:** `ICE_DELETE` — Delete ice types",
        "tags": [
          "Ice / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "ICE_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "iceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete ice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Ice not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "ICE_DELETE"
      }
    },
    "/api/workspaces/{workspaceId}/ice/{iceId}": {
      "get": {
        "summary": "[Deprecated] Get ice",
        "description": "**Required API-key permission:** `ICE_READ` — Read ice types\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ice/{iceId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ice / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "ICE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "iceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get ice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Ice not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "ICE_READ"
      },
      "put": {
        "summary": "[Deprecated] Update ice",
        "description": "**Required API-key permission:** `ICE_UPDATE` — Update ice types\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ice/{iceId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ice / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "ICE_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "iceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IceUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update ice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "ICE_UPDATE"
      },
      "delete": {
        "summary": "[Deprecated] Delete ice",
        "description": "**Required API-key permission:** `ICE_DELETE` — Delete ice types\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ice/{iceId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ice / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "ICE_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "iceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete ice",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ice"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Ice not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "ICE_DELETE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/ingredients": {
      "get": {
        "summary": "List ingredients",
        "description": "**Required API-key permission:** `INGREDIENTS_READ` — Read ingredients\n\nList all ingredients of a workspace, optionally filtered by name or short name.",
        "tags": [
          "Ingredients / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive name/short-name filter."
            },
            "required": false,
            "description": "Case-insensitive name/short-name filter.",
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List ingredients",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Ingredient"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_READ"
      },
      "post": {
        "summary": "Create ingredient",
        "description": "**Required API-key permission:** `INGREDIENTS_CREATE` — Create ingredients",
        "tags": [
          "Ingredients / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngredientCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create ingredient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ingredient"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/ingredients": {
      "get": {
        "summary": "[Deprecated] List ingredients",
        "description": "**Required API-key permission:** `INGREDIENTS_READ` — Read ingredients\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ingredients` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ingredients / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive name/short-name filter."
            },
            "required": false,
            "description": "Case-insensitive name/short-name filter.",
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List ingredients",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Ingredient"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_READ"
      },
      "post": {
        "summary": "[Deprecated] Create ingredient",
        "description": "**Required API-key permission:** `INGREDIENTS_CREATE` — Create ingredients\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ingredients` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ingredients / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngredientCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create ingredient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ingredient"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/ingredients/{ingredientId}": {
      "get": {
        "summary": "Get ingredient",
        "description": "**Required API-key permission:** `INGREDIENTS_READ` — Read ingredients",
        "tags": [
          "Ingredients / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ingredientId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get ingredient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ingredient"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Ingredient not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_READ"
      },
      "put": {
        "summary": "Update ingredient",
        "description": "**Required API-key permission:** `INGREDIENTS_UPDATE` — Update ingredients",
        "tags": [
          "Ingredients / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ingredientId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngredientUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update ingredient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ingredient"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_UPDATE"
      },
      "delete": {
        "summary": "Delete ingredient",
        "description": "**Required API-key permission:** `INGREDIENTS_DELETE` — Delete ingredients",
        "tags": [
          "Ingredients / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ingredientId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete ingredient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Ingredient is still referenced by cocktails and cannot be deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_DELETE"
      }
    },
    "/api/workspaces/{workspaceId}/ingredients/{ingredientId}": {
      "get": {
        "summary": "[Deprecated] Get ingredient",
        "description": "**Required API-key permission:** `INGREDIENTS_READ` — Read ingredients\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ingredients/{ingredientId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ingredients / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ingredientId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get ingredient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ingredient"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Ingredient not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_READ"
      },
      "put": {
        "summary": "[Deprecated] Update ingredient",
        "description": "**Required API-key permission:** `INGREDIENTS_UPDATE` — Update ingredients\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ingredients/{ingredientId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ingredients / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ingredientId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngredientUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update ingredient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ingredient"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_UPDATE"
      },
      "delete": {
        "summary": "[Deprecated] Delete ingredient",
        "description": "**Required API-key permission:** `INGREDIENTS_DELETE` — Delete ingredients\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ingredients/{ingredientId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ingredients / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ingredientId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete ingredient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Ingredient is still referenced by cocktails and cannot be deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_DELETE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/ingredients/{ingredientId}/clone": {
      "post": {
        "summary": "Clone ingredient",
        "description": "**Required API-key permission:** `INGREDIENTS_CREATE` — Create ingredients\n\nCreates a copy of an ingredient (including its image and unit volumes) under a new name.",
        "tags": [
          "Ingredients / Lifecycle"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ingredientId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngredientCloneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clone ingredient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ingredient"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Ingredient not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/ingredients/{ingredientId}/clone": {
      "post": {
        "summary": "[Deprecated] Clone ingredient",
        "description": "**Required API-key permission:** `INGREDIENTS_CREATE` — Create ingredients\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ingredients/{ingredientId}/clone` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ingredients / Lifecycle"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ingredientId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngredientCloneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clone ingredient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ingredient"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Ingredient not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/ingredients/{ingredientId}/image": {
      "get": {
        "summary": "Get ingredient image",
        "description": "**Required API-key permission:** `INGREDIENTS_READ` — Read ingredients\n\nReturns the ingredient image bytes (the `imageUrl` target). 404 when the ingredient has no image.",
        "tags": [
          "Ingredients / Media"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ingredientId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The ingredient image bytes.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The ingredient has no image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/ingredients/{ingredientId}/image": {
      "get": {
        "summary": "[Deprecated] Get ingredient image",
        "description": "**Required API-key permission:** `INGREDIENTS_READ` — Read ingredients\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ingredients/{ingredientId}/image` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ingredients / Media"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ingredientId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The ingredient image bytes.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The ingredient has no image.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/ingredients/{ingredientId}/references": {
      "get": {
        "summary": "List ingredient references",
        "description": "**Required API-key permission:** `INGREDIENTS_READ` — Read ingredients\n\nLists the cocktails that reference this ingredient.",
        "tags": [
          "Ingredients / References"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ingredientId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List ingredient references",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IngredientReference"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/ingredients/{ingredientId}/references": {
      "get": {
        "summary": "[Deprecated] List ingredient references",
        "description": "**Required API-key permission:** `INGREDIENTS_READ` — Read ingredients\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ingredients/{ingredientId}/references` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ingredients / References"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "ingredientId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List ingredient references",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IngredientReference"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/ingredients/check": {
      "get": {
        "summary": "Find similar ingredient",
        "description": "**Required API-key permission:** `INGREDIENTS_READ` — Read ingredients\n\nReturns the most similar existing ingredient by name or link, or null.",
        "tags": [
          "Ingredients / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Name to check for a similar existing ingredient (min. 3 chars)."
            },
            "required": false,
            "description": "Name to check for a similar existing ingredient (min. 3 chars).",
            "name": "name",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Link to check for a similar existing ingredient."
            },
            "required": false,
            "description": "Link to check for a similar existing ingredient.",
            "name": "link",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Find similar ingredient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Ingredient"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/ingredients/check": {
      "get": {
        "summary": "[Deprecated] Find similar ingredient",
        "description": "**Required API-key permission:** `INGREDIENTS_READ` — Read ingredients\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/ingredients/check` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Ingredients / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Name to check for a similar existing ingredient (min. 3 chars)."
            },
            "required": false,
            "description": "Name to check for a similar existing ingredient (min. 3 chars).",
            "name": "name",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Link to check for a similar existing ingredient."
            },
            "required": false,
            "description": "Link to check for a similar existing ingredient.",
            "name": "link",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Find similar ingredient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Ingredient"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/ingredients/export/json": {
      "post": {
        "summary": "Export ingredients as JSON",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\nExports the selected ingredients (with their unit volumes and units) in the portable JSON export format. A single ingredient yields one export object; multiple ingredients yield an array. This payload is the exact input accepted by the import endpoint.",
        "tags": [
          "Ingredients / Import & export"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngredientExportInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Export ingredients as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "description": "Legacy ingredient export structure (single object or array). Round-trips with the import endpoint."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/ingredients/import/json": {
      "post": {
        "summary": "Import ingredients from JSON",
        "description": "**Required API-key permission:** `INGREDIENTS_CREATE` — Create ingredients\n\nImports ingredients from the portable JSON export format via a three-phase flow (validate / prepare-mapping / execute). Consumes exactly what the export endpoint produces; missing units are recreated by name.",
        "tags": [
          "Ingredients / Import & export"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "INGREDIENTS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "Import request: { phase, exportData, decisions? }. exportData is the ingredient export structure (single object or array)."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import ingredients from JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "description": "Phase-dependent legacy import result (validation summary, mapping proposal or execution results)."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "INGREDIENTS_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/join-codes": {
      "get": {
        "summary": "List join codes",
        "description": "**Required API-key permission:** `USERS_READ` — Read workspace members",
        "tags": [
          "Workspace / Join codes"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List join codes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/JoinCode"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_READ"
      },
      "post": {
        "summary": "Create join code",
        "description": "**Required API-key permission:** `USERS_UPDATE` — Update member roles",
        "tags": [
          "Workspace / Join codes"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JoinCodeCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create join code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JoinCode"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/join-codes": {
      "get": {
        "summary": "[Deprecated] List join codes",
        "description": "**Required API-key permission:** `USERS_READ` — Read workspace members\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/join-codes` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Join codes"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List join codes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/JoinCode"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_READ"
      },
      "post": {
        "summary": "[Deprecated] Create join code",
        "description": "**Required API-key permission:** `USERS_UPDATE` — Update member roles\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/join-codes` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Join codes"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JoinCodeCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create join code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JoinCode"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/join-codes/{code}": {
      "delete": {
        "summary": "Delete join code",
        "description": "**Required API-key permission:** `USERS_UPDATE` — Update member roles",
        "tags": [
          "Workspace / Join codes"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "code",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete join code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Join code not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/join-codes/{code}": {
      "delete": {
        "summary": "[Deprecated] Delete join code",
        "description": "**Required API-key permission:** `USERS_UPDATE` — Update member roles\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/join-codes/{code}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Join codes"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "code",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete join code",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Join code not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/join-requests": {
      "get": {
        "summary": "List join requests",
        "description": "**Required API-key permission:** `USERS_READ` — Read workspace members",
        "tags": [
          "Workspace / Membership"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List join requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/JoinRequest"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_READ"
      },
      "delete": {
        "summary": "Withdraw own join request",
        "description": "**Authentication:** requires a logged-in workspace-member session. API keys (workspace or the instance master key) are NOT accepted for this operation.\n\nWithdraws the calling user's own pending join request. Session-only — API keys are not accepted.",
        "tags": [
          "Workspace / Membership"
        ],
        "security": [
          {
            "SessionCookieAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Withdraw own join request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No pending join request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspaceId}/join-requests": {
      "get": {
        "summary": "[Deprecated] List join requests",
        "description": "**Required API-key permission:** `USERS_READ` — Read workspace members\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/join-requests` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Membership"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List join requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/JoinRequest"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_READ"
      },
      "delete": {
        "summary": "[Deprecated] Withdraw own join request",
        "description": "**Authentication:** requires a logged-in workspace-member session. API keys (workspace or the instance master key) are NOT accepted for this operation.\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/join-requests` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Membership"
        ],
        "deprecated": true,
        "security": [
          {
            "SessionCookieAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Withdraw own join request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No pending join request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/join-requests/{userId}/accept": {
      "post": {
        "summary": "Accept join request",
        "description": "**Required API-key permission:** `USERS_UPDATE` — Update member roles\n\nAccepts a pending join request: adds the user as a member (role USER) and notifies them.",
        "tags": [
          "Workspace / Membership"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "userId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Accept join request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JoinRequestActionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No pending join request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/join-requests/{userId}/accept": {
      "post": {
        "summary": "[Deprecated] Accept join request",
        "description": "**Required API-key permission:** `USERS_UPDATE` — Update member roles\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/join-requests/{userId}/accept` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Membership"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "userId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Accept join request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JoinRequestActionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No pending join request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/join-requests/{userId}/reject": {
      "post": {
        "summary": "Reject join request",
        "description": "**Required API-key permission:** `USERS_UPDATE` — Update member roles\n\nRejects (deletes) a pending join request and notifies the user.",
        "tags": [
          "Workspace / Membership"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "userId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Reject join request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JoinRequestActionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No pending join request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/join-requests/{userId}/reject": {
      "post": {
        "summary": "[Deprecated] Reject join request",
        "description": "**Required API-key permission:** `USERS_UPDATE` — Update member roles\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/join-requests/{userId}/reject` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Membership"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "userId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Reject join request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JoinRequestActionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No pending join request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/leave": {
      "post": {
        "summary": "Leave workspace",
        "description": "**Authentication:** requires a logged-in workspace-member session. API keys (workspace or the instance master key) are NOT accepted for this operation.\n\nRemoves the calling user from the workspace. Session-only — API keys are not accepted.",
        "tags": [
          "Workspace / Membership"
        ],
        "security": [
          {
            "SessionCookieAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Leave workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LeaveResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspaceId}/leave": {
      "post": {
        "summary": "[Deprecated] Leave workspace",
        "description": "**Authentication:** requires a logged-in workspace-member session. API keys (workspace or the instance master key) are NOT accepted for this operation.\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/leave` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Membership"
        ],
        "deprecated": true,
        "security": [
          {
            "SessionCookieAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Leave workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LeaveResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/queue": {
      "get": {
        "summary": "List queue",
        "description": "**Required API-key permission:** `QUEUE_READ` — Read the cocktail queue\n\nList all cocktail queue items of a workspace.",
        "tags": [
          "Queue / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "QUEUE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List queue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QueueItem"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "QUEUE_READ"
      }
    },
    "/api/workspaces/{workspaceId}/queue": {
      "get": {
        "summary": "[Deprecated] List queue",
        "description": "**Required API-key permission:** `QUEUE_READ` — Read the cocktail queue\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/queue` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Queue / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "QUEUE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List queue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QueueItem"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "QUEUE_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/queue/{queueItemId}": {
      "put": {
        "summary": "Update queue item",
        "description": "**Required API-key permission:** `QUEUE_UPDATE` — Update queue items\n\nUpdate the in-progress state of a queue item.",
        "tags": [
          "Queue / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "QUEUE_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "queueItemId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update queue item",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QueueItem"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Queue item not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "QUEUE_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/queue/{queueItemId}": {
      "put": {
        "summary": "[Deprecated] Update queue item",
        "description": "**Required API-key permission:** `QUEUE_UPDATE` — Update queue items\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/queue/{queueItemId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Queue / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "QUEUE_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "queueItemId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update queue item",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QueueItem"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Queue item not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "QUEUE_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/queue/add": {
      "post": {
        "summary": "Add to queue",
        "description": "**Required API-key permission:** `QUEUE_CREATE` — Add cocktails to the queue\n\nEnqueue one or more identical cocktail queue items.",
        "tags": [
          "Queue / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "QUEUE_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueAddInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add to queue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QueueItem"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "QUEUE_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/queue/add": {
      "post": {
        "summary": "[Deprecated] Add to queue",
        "description": "**Required API-key permission:** `QUEUE_CREATE` — Add cocktails to the queue\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/queue/add` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Queue / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "QUEUE_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueAddInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add to queue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QueueItem"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "QUEUE_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/queue/remove": {
      "post": {
        "summary": "Remove from queue",
        "description": "**Required API-key permission:** `QUEUE_DELETE` — Remove cocktails from the queue\n\nRemove the oldest queue item matching the given cocktail and notes.",
        "tags": [
          "Queue / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "QUEUE_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueRemoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remove from queue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QueueItem"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No matching cocktail in queue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "QUEUE_DELETE"
      }
    },
    "/api/workspaces/{workspaceId}/queue/remove": {
      "post": {
        "summary": "[Deprecated] Remove from queue",
        "description": "**Required API-key permission:** `QUEUE_DELETE` — Remove cocktails from the queue\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/queue/remove` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Queue / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "QUEUE_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueRemoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remove from queue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QueueItem"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No matching cocktail in queue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "QUEUE_DELETE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/settings": {
      "get": {
        "summary": "Get workspace settings",
        "description": "**Required API-key permission:** `WORKSPACE_READ` — Read workspace settings and audit logs\n\nGet all workspace settings as a key→value map.",
        "tags": [
          "Workspace / Settings"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get workspace settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkspaceSettings"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_READ"
      },
      "put": {
        "summary": "Update workspace setting",
        "description": "**Required API-key permission:** `WORKSPACE_UPDATE` — Update workspace settings\n\nUpsert a single workspace setting and return the full settings map.",
        "tags": [
          "Workspace / Settings"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceSettingUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update workspace setting",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkspaceSettings"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_UPDATE"
      }
    },
    "/api/workspaces/{workspaceId}/settings": {
      "get": {
        "summary": "[Deprecated] Get workspace settings",
        "description": "**Required API-key permission:** `WORKSPACE_READ` — Read workspace settings and audit logs\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/settings` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Settings"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Get workspace settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkspaceSettings"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_READ"
      },
      "put": {
        "summary": "[Deprecated] Update workspace setting",
        "description": "**Required API-key permission:** `WORKSPACE_UPDATE` — Update workspace settings\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/settings` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace / Settings"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "WORKSPACE_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceSettingUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update workspace setting",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkspaceSettings"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "WORKSPACE_UPDATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/advanced/cocktails": {
      "get": {
        "summary": "Advanced cocktail ranking",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\nRanks cocktails by order count for the given date range, with share/delta vs. the previous equal-length period and each cocktail’s ingredient breakdown. Emits a `{ data, total }` envelope (not the standard `{ data }`). Requires startDate and endDate.",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Advanced cocktail ranking",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsCocktailRanking"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "startDate and endDate are required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/advanced/cocktails": {
      "get": {
        "summary": "[Deprecated] Advanced cocktail ranking",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/cocktails` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Advanced cocktail ranking",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsCocktailRanking"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "startDate and endDate are required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/advanced/cocktails/{cocktailId}": {
      "get": {
        "summary": "Advanced single-cocktail analytics",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\nDeep-dive analytics for one cocktail: totals, rank, deltas, revenue, time series and hour/day distributions. Emits a `{ data }` envelope. Uses the cocktail’s full order history when no date range is given.",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Advanced single-cocktail analytics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsCocktailDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/advanced/cocktails/{cocktailId}": {
      "get": {
        "summary": "[Deprecated] Advanced single-cocktail analytics",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/cocktails/{cocktailId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Advanced single-cocktail analytics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsCocktailDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/advanced/cocktails/{cocktailId}/orders": {
      "get": {
        "summary": "Paginated order log for a cocktail",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\nNewest-first, searchable, paginated list of individual orders (statistic entries) for one cocktail. Search filters over formatted date/weekday, user and card. Emits a `{ data, pagination }` envelope with the legacy pagination block.",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (day-start-time aware)."
            },
            "required": false,
            "description": "Inclusive start date (day-start-time aware).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (day-start-time aware)."
            },
            "required": false,
            "description": "Inclusive end date (day-start-time aware).",
            "name": "endDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive filter over formatted date, weekday, user (name/email) and card name."
            },
            "required": false,
            "description": "Case-insensitive filter over formatted date, weekday, user (name/email) and card name.",
            "name": "search",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "1-based page number (default 1)."
            },
            "required": false,
            "description": "1-based page number (default 1).",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Items per page (default 50)."
            },
            "required": false,
            "description": "Items per page (default 50).",
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated order log for a cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsCocktailOrders"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/advanced/cocktails/{cocktailId}/orders": {
      "get": {
        "summary": "[Deprecated] Paginated order log for a cocktail",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/cocktails/{cocktailId}/orders` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (day-start-time aware)."
            },
            "required": false,
            "description": "Inclusive start date (day-start-time aware).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (day-start-time aware)."
            },
            "required": false,
            "description": "Inclusive end date (day-start-time aware).",
            "name": "endDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive filter over formatted date, weekday, user (name/email) and card name."
            },
            "required": false,
            "description": "Case-insensitive filter over formatted date, weekday, user (name/email) and card name.",
            "name": "search",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "1-based page number (default 1)."
            },
            "required": false,
            "description": "1-based page number (default 1).",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Items per page (default 50)."
            },
            "required": false,
            "description": "Items per page (default 50).",
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated order log for a cocktail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsCocktailOrders"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/advanced/cocktails/all": {
      "get": {
        "summary": "All cocktails with order counts",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\nLists every cocktail in the workspace (name-ordered) with its order count for the given range; cocktails without orders are included with count 0. Order counts are only computed when both startDate and endDate are supplied. Emits a `{ data, total }` envelope.",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "All cocktails with order counts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsCocktailAll"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/advanced/cocktails/all": {
      "get": {
        "summary": "[Deprecated] All cocktails with order counts",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/cocktails/all` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "All cocktails with order counts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsCocktailAll"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/advanced/compare": {
      "get": {
        "summary": "Compare an ad-hoc tag/ingredient set",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\nComputes KPIs, matching cocktails and a cross-aggregate for an ad-hoc tag or ingredient set (with AND/OR logic). Emits a `{ data }` envelope. Uses all-time when no date range is given.",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "TAG_SET",
                "INGREDIENT_SET"
              ],
              "description": "What the items represent."
            },
            "required": true,
            "description": "What the items represent.",
            "name": "type",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "JSON-encoded array of tag/ingredient names (a bare string is treated as a single item)."
            },
            "required": true,
            "description": "JSON-encoded array of tag/ingredient names (a bare string is treated as a single item).",
            "name": "items",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "AND",
                "OR"
              ],
              "description": "Match logic across items (default AND)."
            },
            "required": false,
            "description": "Match logic across items (default AND).",
            "name": "logic",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (day-start-time aware); all-time when omitted."
            },
            "required": false,
            "description": "Inclusive start date (day-start-time aware); all-time when omitted.",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (day-start-time aware); all-time when omitted."
            },
            "required": false,
            "description": "Inclusive end date (day-start-time aware); all-time when omitted.",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Compare an ad-hoc tag/ingredient set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsCompare"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "type and items are required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/advanced/compare": {
      "get": {
        "summary": "[Deprecated] Compare an ad-hoc tag/ingredient set",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/compare` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "TAG_SET",
                "INGREDIENT_SET"
              ],
              "description": "What the items represent."
            },
            "required": true,
            "description": "What the items represent.",
            "name": "type",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "JSON-encoded array of tag/ingredient names (a bare string is treated as a single item)."
            },
            "required": true,
            "description": "JSON-encoded array of tag/ingredient names (a bare string is treated as a single item).",
            "name": "items",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "AND",
                "OR"
              ],
              "description": "Match logic across items (default AND)."
            },
            "required": false,
            "description": "Match logic across items (default AND).",
            "name": "logic",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (day-start-time aware); all-time when omitted."
            },
            "required": false,
            "description": "Inclusive start date (day-start-time aware); all-time when omitted.",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (day-start-time aware); all-time when omitted."
            },
            "required": false,
            "description": "Inclusive end date (day-start-time aware); all-time when omitted.",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Compare an ad-hoc tag/ingredient set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsCompare"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "type and items are required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/advanced/ingredients": {
      "get": {
        "summary": "Ingredient usage statistics",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\nLists every ingredient with its order-usage count, the number of distinct cocktails using it, and its share of period orders. Counts are only computed when both startDate and endDate are supplied. Emits a `{ data, total }` envelope.",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Ingredient usage statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsIngredients"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/advanced/ingredients": {
      "get": {
        "summary": "[Deprecated] Ingredient usage statistics",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/ingredients` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Ingredient usage statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsIngredients"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/advanced/overview": {
      "get": {
        "summary": "Advanced statistics overview",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\nDashboard-style overview with per-period KPIs (today/week/month, a custom selected range, average-per-hour and all-time) plus their chart data. Defaults the selected range to the last 7 days when startDate/endDate are omitted.",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Advanced statistics overview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsOverview"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/advanced/overview": {
      "get": {
        "summary": "[Deprecated] Advanced statistics overview",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/overview` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Advanced statistics overview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsOverview"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/advanced/sets": {
      "get": {
        "summary": "List saved statistics sets",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\nLists saved statistics sets of a workspace (newest first), optionally filtered by type/types. Emits a `{ data }` envelope.",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by a single SavedSetType."
            },
            "required": false,
            "description": "Filter by a single SavedSetType.",
            "name": "type",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Comma-separated list of SavedSetTypes to filter by (ignored when `type` is set)."
            },
            "required": false,
            "description": "Comma-separated list of SavedSetTypes to filter by (ignored when `type` is set).",
            "name": "types",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List saved statistics sets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdvancedStatisticsSavedSet"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      },
      "post": {
        "summary": "Create a saved statistics set",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvancedStatisticsSavedSetCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a saved statistics set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsSavedSet"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing required fields, or invalid type/logic.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      },
      "put": {
        "summary": "Update a saved statistics set",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvancedStatisticsSavedSetUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a saved statistics set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsSavedSet"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "id is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Set not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      },
      "delete": {
        "summary": "Delete a saved statistics set",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Id of the set to delete."
            },
            "required": true,
            "description": "Id of the set to delete.",
            "name": "id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a saved statistics set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "id is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Set not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/advanced/sets": {
      "get": {
        "summary": "[Deprecated] List saved statistics sets",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/sets` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by a single SavedSetType."
            },
            "required": false,
            "description": "Filter by a single SavedSetType.",
            "name": "type",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Comma-separated list of SavedSetTypes to filter by (ignored when `type` is set)."
            },
            "required": false,
            "description": "Comma-separated list of SavedSetTypes to filter by (ignored when `type` is set).",
            "name": "types",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List saved statistics sets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdvancedStatisticsSavedSet"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      },
      "post": {
        "summary": "[Deprecated] Create a saved statistics set",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/sets` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvancedStatisticsSavedSetCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create a saved statistics set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsSavedSet"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing required fields, or invalid type/logic.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      },
      "put": {
        "summary": "[Deprecated] Update a saved statistics set",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/sets` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvancedStatisticsSavedSetUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a saved statistics set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsSavedSet"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "id is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Set not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      },
      "delete": {
        "summary": "[Deprecated] Delete a saved statistics set",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/sets` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Id of the set to delete."
            },
            "required": true,
            "description": "Id of the set to delete.",
            "name": "id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a saved statistics set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "id is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Set not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/advanced/sets/{setId}": {
      "get": {
        "summary": "Analytics for a saved set",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\nResolves a saved set to its matching cocktails and computes KPIs, per-cocktail counts and a cross-aggregate. Emits a `{ data }` envelope. Uses all-time when no date range is given.",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "setId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Analytics for a saved set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsSetDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Set not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/advanced/sets/{setId}": {
      "get": {
        "summary": "[Deprecated] Analytics for a saved set",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/sets/{setId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "setId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Analytics for a saved set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsSetDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Set not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/advanced/tags": {
      "get": {
        "summary": "Tag usage statistics",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\nLists every tag with its order-usage count, the number of distinct cocktails carrying it, and its share of period orders. Counts are only computed when both startDate and endDate are supplied. Emits a `{ data, total }` envelope.",
        "tags": [
          "Statistics / Advanced"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Tag usage statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsTags"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/advanced/tags": {
      "get": {
        "summary": "[Deprecated] Tag usage statistics",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/advanced/tags` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Advanced"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Tag usage statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedStatisticsTags"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/cocktails": {
      "get": {
        "summary": "List cocktail statistics",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\nList cocktail-statistic entries of a workspace, optionally filtered by a date range (day-start-time aware).",
        "tags": [
          "Statistics / Logging"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List cocktail statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CocktailStatisticItem"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/cocktails": {
      "get": {
        "summary": "[Deprecated] List cocktail statistics",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/cocktails` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Logging"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List cocktail statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CocktailStatisticItem"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/cocktails/{cocktailStatisticId}": {
      "delete": {
        "summary": "Delete a cocktail statistic",
        "description": "**Required API-key permission:** `STATISTICS_DELETE` — Delete statistics entries",
        "tags": [
          "Statistics / Logging"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailStatisticId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a cocktail statistic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail statistic not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_DELETE"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/cocktails/{cocktailStatisticId}": {
      "delete": {
        "summary": "[Deprecated] Delete a cocktail statistic",
        "description": "**Required API-key permission:** `STATISTICS_DELETE` — Delete statistics entries\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/cocktails/{cocktailStatisticId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Logging"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailStatisticId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a cocktail statistic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail statistic not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_DELETE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/cocktails/add": {
      "post": {
        "summary": "Log a cocktail statistic",
        "description": "**Required API-key permission:** `STATISTICS_CREATE` — Record sales statistics\n\nRecords that a cocktail was made and reconciles the cocktail queue. Returns 400 when the queue contains ambiguous entries that require the caller to choose which one to remove.",
        "tags": [
          "Statistics / Logging"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CocktailStatisticCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Log a cocktail statistic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CocktailStatisticItem"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Ambiguous cocktail-queue entries; specify a note to remove one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_CREATE"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/cocktails/add": {
      "post": {
        "summary": "[Deprecated] Log a cocktail statistic",
        "description": "**Required API-key permission:** `STATISTICS_CREATE` — Record sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/cocktails/add` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Logging"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_CREATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CocktailStatisticCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Log a cocktail statistic",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CocktailStatisticItem"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Ambiguous cocktail-queue entries; specify a note to remove one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_CREATE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/logs": {
      "get": {
        "summary": "List statistic logs",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\nList cocktail-statistic entries of a workspace, newest first, filtered by date range and/or name search. Paginated: the response is a `{ data, pagination }` envelope (not a bare array); `data` holds the `CocktailStatisticItem[]` page.",
        "tags": [
          "Statistics / Logging"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive filter over cocktail, card and user name."
            },
            "required": false,
            "description": "Case-insensitive filter over cocktail, card and user name.",
            "name": "search",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "description": "1-based page number."
            },
            "required": false,
            "description": "1-based page number.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50,
              "description": "Items per page."
            },
            "required": false,
            "description": "Items per page.",
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List statistic logs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CocktailStatisticItem"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/logs": {
      "get": {
        "summary": "[Deprecated] List statistic logs",
        "description": "**Required API-key permission:** `STATISTICS_READ` — Read sales statistics\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/logs` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Logging"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive start date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive start date (interpreted with the workspace day-start-time setting).",
            "name": "startDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Inclusive end date (interpreted with the workspace day-start-time setting)."
            },
            "required": false,
            "description": "Inclusive end date (interpreted with the workspace day-start-time setting).",
            "name": "endDate",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive filter over cocktail, card and user name."
            },
            "required": false,
            "description": "Case-insensitive filter over cocktail, card and user name.",
            "name": "search",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "description": "1-based page number."
            },
            "required": false,
            "description": "1-based page number.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50,
              "description": "Items per page."
            },
            "required": false,
            "description": "Items per page.",
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List statistic logs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CocktailStatisticItem"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/statistics/logs/{cocktailStatisticId}": {
      "delete": {
        "summary": "Delete a statistic log",
        "description": "**Required API-key permission:** `STATISTICS_DELETE` — Delete statistics entries",
        "tags": [
          "Statistics / Logging"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailStatisticId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a statistic log",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail statistic not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_DELETE"
      }
    },
    "/api/workspaces/{workspaceId}/statistics/logs/{cocktailStatisticId}": {
      "delete": {
        "summary": "[Deprecated] Delete a statistic log",
        "description": "**Required API-key permission:** `STATISTICS_DELETE` — Delete statistics entries\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/statistics/logs/{cocktailStatisticId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Statistics / Logging"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "STATISTICS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "cocktailStatisticId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a statistic log",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Cocktail statistic not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "STATISTICS_DELETE"
      }
    },
    "/api/v1/workspaces/{workspaceId}/tags": {
      "get": {
        "summary": "List tags",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\nList all distinct tags used across cocktails and ingredients of a workspace.",
        "tags": [
          "Tags / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List tags",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Tags"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/tags": {
      "get": {
        "summary": "[Deprecated] List tags",
        "description": "**Required API-key permission:** `COCKTAILS_READ` — Read cocktail recipes\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/tags` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Tags / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "COCKTAILS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List tags",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Tags"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "COCKTAILS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/units": {
      "get": {
        "summary": "List units",
        "description": "**Required API-key permission:** `UNITS_READ` — Read units and unit conversions\n\nList all units of a workspace, optionally filtered by name.",
        "tags": [
          "Units / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "UNITS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive name filter."
            },
            "required": false,
            "description": "Case-insensitive name filter.",
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List units",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Unit"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "UNITS_READ"
      },
      "post": {
        "summary": "Create unit",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).",
        "tags": [
          "Units / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnitCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create unit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Unit"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspaceId}/units": {
      "get": {
        "summary": "[Deprecated] List units",
        "description": "**Required API-key permission:** `UNITS_READ` — Read units and unit conversions\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/units` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Units / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "UNITS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Case-insensitive name filter."
            },
            "required": false,
            "description": "Case-insensitive name filter.",
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "List units",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Unit"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "UNITS_READ"
      },
      "post": {
        "summary": "[Deprecated] Create unit",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/units` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Units / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnitCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create unit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Unit"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/units/{unitId}": {
      "delete": {
        "summary": "Delete unit",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).",
        "tags": [
          "Units / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "unitId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete unit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Unit"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspaceId}/units/{unitId}": {
      "delete": {
        "summary": "[Deprecated] Delete unit",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/units/{unitId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Units / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "unitId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete unit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Unit"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/units/conversions": {
      "get": {
        "summary": "List unit conversions",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\nList all unit conversions of a workspace.",
        "tags": [
          "Units / Conversions"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List unit conversions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UnitConversion"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create unit conversion",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\nCreate a unit conversion (plus its inverse) and regenerate all derived conversions.",
        "tags": [
          "Units / Conversions"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnitConversionCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create unit conversion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UnitConversion"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspaceId}/units/conversions": {
      "get": {
        "summary": "[Deprecated] List unit conversions",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/units/conversions` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Units / Conversions"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List unit conversions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UnitConversion"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "[Deprecated] Create unit conversion",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/units/conversions` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Units / Conversions"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnitConversionCreateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Create unit conversion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UnitConversion"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/units/conversions/{unitConversionId}": {
      "put": {
        "summary": "Update unit conversion",
        "description": "**Required API-key permission:** `UNITS_UPDATE` — Create, update, and delete units and unit conversions\n\nUpdate a conversion factor and regenerate all derived conversions.",
        "tags": [
          "Units / Conversions"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "UNITS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "unitConversionId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnitConversionUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update unit conversion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/UnitConversion"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "UNITS_UPDATE"
      },
      "delete": {
        "summary": "Delete unit conversion",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\nDelete a conversion and regenerate all derived conversions.",
        "tags": [
          "Units / Conversions"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "unitConversionId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete unit conversion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/UnitConversion"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces/{workspaceId}/units/conversions/{unitConversionId}": {
      "put": {
        "summary": "[Deprecated] Update unit conversion",
        "description": "**Required API-key permission:** `UNITS_UPDATE` — Create, update, and delete units and unit conversions\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/units/conversions/{unitConversionId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Units / Conversions"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "UNITS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "unitConversionId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnitConversionUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update unit conversion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/UnitConversion"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "UNITS_UPDATE"
      },
      "delete": {
        "summary": "[Deprecated] Delete unit conversion",
        "description": "**Authentication:** requires a valid session or API key (no specific permission).\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/units/conversions/{unitConversionId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Units / Conversions"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": []
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "unitConversionId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete unit conversion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/UnitConversion"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/users": {
      "get": {
        "summary": "List workspace users",
        "description": "**Required API-key permission:** `USERS_READ` — Read workspace members\n\nList all users (memberships) of a workspace.",
        "tags": [
          "Workspace Users / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List workspace users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WorkspaceUser"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_READ"
      }
    },
    "/api/workspaces/{workspaceId}/users": {
      "get": {
        "summary": "[Deprecated] List workspace users",
        "description": "**Required API-key permission:** `USERS_READ` — Read workspace members\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/users` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace Users / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_READ"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "List workspace users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WorkspaceUser"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_READ"
      }
    },
    "/api/v1/workspaces/{workspaceId}/users/{userId}": {
      "put": {
        "summary": "Update workspace user role",
        "description": "**Required API-key permission:** `USERS_UPDATE` — Update member roles",
        "tags": [
          "Workspace Users / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "userId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceUserUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update workspace user role",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkspaceUser"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A user cannot change their own role.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workspace user not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_UPDATE"
      },
      "delete": {
        "summary": "Remove workspace user",
        "description": "**Required API-key permission:** `USERS_DELETE` — Remove members from the workspace",
        "tags": [
          "Workspace Users / Core"
        ],
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "userId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Remove workspace user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A user cannot remove themselves.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workspace user not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_DELETE"
      }
    },
    "/api/workspaces/{workspaceId}/users/{userId}": {
      "put": {
        "summary": "[Deprecated] Update workspace user role",
        "description": "**Required API-key permission:** `USERS_UPDATE` — Update member roles\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/users/{userId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace Users / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_UPDATE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "userId",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceUserUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update workspace user role",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkspaceUser"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A user cannot change their own role.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workspace user not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_UPDATE"
      },
      "delete": {
        "summary": "[Deprecated] Remove workspace user",
        "description": "**Required API-key permission:** `USERS_DELETE` — Remove members from the workspace\n\n**Deprecated.** Use `/api/v1/workspaces/{workspaceId}/users/{userId}` instead. This unversioned endpoint keeps its historic behavior but may be removed in a future release.",
        "tags": [
          "Workspace Users / Core"
        ],
        "deprecated": true,
        "security": [
          {
            "WorkspaceApiKeyAuth": [
              "USERS_DELETE"
            ]
          },
          {
            "InstanceApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Workspace ID",
              "example": "ckw0a1b2c3d4e5f6g7h8"
            },
            "required": true,
            "description": "Workspace ID",
            "name": "workspaceId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "userId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Remove workspace user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeletionResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "A user cannot remove themselves.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Workspace user not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "USERS_DELETE"
      }
    }
  },
  "webhooks": {},
  "tags": [
    {
      "name": "Workspace / Core",
      "description": "Workspace identity and lifecycle.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Workspace / Settings",
      "description": "Workspace settings and translations.",
      "x-displayName": "Settings",
      "x-position": 2
    },
    {
      "name": "Workspace / API keys",
      "description": "Create, list and revoke workspace API keys.",
      "x-displayName": "API keys",
      "x-position": 3
    },
    {
      "name": "Workspace / Join codes",
      "description": "Invite codes for joining a workspace.",
      "x-displayName": "Join codes",
      "x-position": 4
    },
    {
      "name": "Workspace / Membership",
      "description": "Join requests and leaving a workspace.",
      "x-displayName": "Membership",
      "x-position": 5
    },
    {
      "name": "Workspace Users / Core",
      "description": "Workspace member list and roles.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Audit Logs / Core",
      "description": "Audit log entries.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Cocktails / Core",
      "description": "List, create, read, update and delete cocktail recipes.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Cocktails / Step actions",
      "description": "Cocktail-recipe step actions (SHAKE, STIR, …).",
      "x-displayName": "Step actions",
      "x-position": 2
    },
    {
      "name": "Cocktails / Lifecycle",
      "description": "Clone, archive and unarchive cocktails.",
      "x-displayName": "Lifecycle",
      "x-position": 3
    },
    {
      "name": "Cocktails / Import & export",
      "description": "JSON/PDF export and JSON import for cocktails.",
      "x-displayName": "Import & export",
      "x-position": 4
    },
    {
      "name": "Cocktails / Media",
      "description": "Cocktail image bytes.",
      "x-displayName": "Media",
      "x-position": 5
    },
    {
      "name": "Ingredients / Core",
      "description": "List, create, read, update and delete ingredients.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Ingredients / Lifecycle",
      "description": "Clone ingredients.",
      "x-displayName": "Lifecycle",
      "x-position": 2
    },
    {
      "name": "Ingredients / Import & export",
      "description": "JSON export and import for ingredients.",
      "x-displayName": "Import & export",
      "x-position": 3
    },
    {
      "name": "Ingredients / Media",
      "description": "Ingredient image bytes.",
      "x-displayName": "Media",
      "x-position": 4
    },
    {
      "name": "Ingredients / References",
      "description": "Cocktails that reference an ingredient.",
      "x-displayName": "References",
      "x-position": 5
    },
    {
      "name": "Garnishes / Core",
      "description": "List, create, read, update and delete garnishes.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Garnishes / Lifecycle",
      "description": "Clone garnishes.",
      "x-displayName": "Lifecycle",
      "x-position": 2
    },
    {
      "name": "Garnishes / Import & export",
      "description": "JSON export and import for garnishes.",
      "x-displayName": "Import & export",
      "x-position": 3
    },
    {
      "name": "Garnishes / Media",
      "description": "Garnish image bytes.",
      "x-displayName": "Media",
      "x-position": 4
    },
    {
      "name": "Glasses / Core",
      "description": "List, create, read, update and delete glasses.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Glasses / Lifecycle",
      "description": "Clone glasses.",
      "x-displayName": "Lifecycle",
      "x-position": 2
    },
    {
      "name": "Glasses / Import & export",
      "description": "JSON export and import for glasses.",
      "x-displayName": "Import & export",
      "x-position": 3
    },
    {
      "name": "Glasses / Media",
      "description": "Glass image bytes.",
      "x-displayName": "Media",
      "x-position": 4
    },
    {
      "name": "Glasses / References",
      "description": "Cocktails that reference a glass.",
      "x-displayName": "References",
      "x-position": 5
    },
    {
      "name": "Ice / Core",
      "description": "List, create, read, update and delete ice types.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Tags / Core",
      "description": "List cocktail tags.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Units / Core",
      "description": "List, create and delete measurement units.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Units / Conversions",
      "description": "Unit conversion factors.",
      "x-displayName": "Conversions",
      "x-position": 2
    },
    {
      "name": "Cards / Core",
      "description": "List, create, read, update and delete cocktail cards.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Cards / Lifecycle",
      "description": "Clone, archive and unarchive cards.",
      "x-displayName": "Lifecycle",
      "x-position": 2
    },
    {
      "name": "Calculations / Core",
      "description": "Price calculations CRUD.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Calculations / Groups",
      "description": "Calculation groups and assignments.",
      "x-displayName": "Groups",
      "x-position": 2
    },
    {
      "name": "Calculations / Import & export",
      "description": "JSON export and import for calculations.",
      "x-displayName": "Import & export",
      "x-position": 3
    },
    {
      "name": "Monitor / Configuration",
      "description": "Signage / monitor configuration.",
      "x-displayName": "Configuration",
      "x-position": 1
    },
    {
      "name": "Monitor / Slides",
      "description": "Signage slide upload, schedule and images.",
      "x-displayName": "Slides",
      "x-position": 2
    },
    {
      "name": "Queue / Core",
      "description": "Bar order queue.",
      "x-displayName": "Core",
      "x-position": 1
    },
    {
      "name": "Statistics / Logging",
      "description": "Cocktail statistics and logs.",
      "x-displayName": "Logging",
      "x-position": 1
    },
    {
      "name": "Statistics / Advanced",
      "description": "Advanced analytics, sets and comparisons.",
      "x-displayName": "Advanced",
      "x-position": 2
    },
    {
      "name": "Ratings / Core",
      "description": "Cocktail ratings.",
      "x-displayName": "Core",
      "x-position": 1
    }
  ],
  "x-tagGroups": [
    {
      "name": "Workspace",
      "tags": [
        "Workspace / Core",
        "Workspace / Settings",
        "Workspace / API keys",
        "Workspace / Join codes",
        "Workspace / Membership"
      ]
    },
    {
      "name": "Workspace Users",
      "tags": [
        "Workspace Users / Core"
      ]
    },
    {
      "name": "Audit Logs",
      "tags": [
        "Audit Logs / Core"
      ]
    },
    {
      "name": "Cocktails",
      "tags": [
        "Cocktails / Core",
        "Cocktails / Step actions",
        "Cocktails / Lifecycle",
        "Cocktails / Import & export",
        "Cocktails / Media"
      ]
    },
    {
      "name": "Ingredients",
      "tags": [
        "Ingredients / Core",
        "Ingredients / Lifecycle",
        "Ingredients / Import & export",
        "Ingredients / Media",
        "Ingredients / References"
      ]
    },
    {
      "name": "Garnishes",
      "tags": [
        "Garnishes / Core",
        "Garnishes / Lifecycle",
        "Garnishes / Import & export",
        "Garnishes / Media"
      ]
    },
    {
      "name": "Glasses",
      "tags": [
        "Glasses / Core",
        "Glasses / Lifecycle",
        "Glasses / Import & export",
        "Glasses / Media",
        "Glasses / References"
      ]
    },
    {
      "name": "Ice",
      "tags": [
        "Ice / Core"
      ]
    },
    {
      "name": "Tags",
      "tags": [
        "Tags / Core"
      ]
    },
    {
      "name": "Units",
      "tags": [
        "Units / Core",
        "Units / Conversions"
      ]
    },
    {
      "name": "Cards",
      "tags": [
        "Cards / Core",
        "Cards / Lifecycle"
      ]
    },
    {
      "name": "Calculations",
      "tags": [
        "Calculations / Core",
        "Calculations / Groups",
        "Calculations / Import & export"
      ]
    },
    {
      "name": "Monitor",
      "tags": [
        "Monitor / Configuration",
        "Monitor / Slides"
      ]
    },
    {
      "name": "Queue",
      "tags": [
        "Queue / Core"
      ]
    },
    {
      "name": "Statistics",
      "tags": [
        "Statistics / Logging",
        "Statistics / Advanced"
      ]
    },
    {
      "name": "Ratings",
      "tags": [
        "Ratings / Core"
      ]
    }
  ]
}
