{
  "openapi": "3.1.0",
  "info": {
    "title": "Kelna application API",
    "version": "2026-10-21",
    "description": "Current explicit Kelna application routes, not a public partner API. Requests are validated against the source Fastify schemas. Response schemas are partial: consult the room and authentication guides. The Better Auth /api/auth/* proxy is documented separately. No public CORS, partner API keys, video ingestion or camera-driven service is available."
  },
  "servers": [
    {
      "url": "https://app.kelna.fr",
      "description": "Internal test application; route availability depends on the deployed version."
    },
    {
      "url": "http://127.0.0.1:4317",
      "description": "Local frontend with API proxy."
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Check that the API process responds.",
        "tags": [
          "Public"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/ready": {
      "get": {
        "operationId": "ready",
        "summary": "Check the connection to the initialized database. Returns 503 when unavailable.",
        "tags": [
          "Public"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "503": {
            "description": "The initialized database is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "const": "unavailable"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/account": {
      "get": {
        "operationId": "account",
        "summary": "Read the signed-in account and its MFA requirement. The response contains account personal data.",
        "tags": [
          "Account and organization"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/account/verified": {
      "get": {
        "operationId": "verified",
        "summary": "Check that the human session has completed two-factor authentication.",
        "tags": [
          "Account and organization"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/account/activate": {
      "post": {
        "operationId": "activate",
        "summary": "Activate or recover an account using a one-hour invitation token. Password length is 12 to 128 characters.",
        "tags": [
          "Public"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Must exactly match the configured application origin."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "token",
                  "password"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 43,
                    "maxLength": 43
                  },
                  "password": {
                    "type": "string",
                    "minLength": 12,
                    "maxLength": 128
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/access/organizations": {
      "get": {
        "operationId": "organizations",
        "summary": "List accessible organizations after MFA.",
        "tags": [
          "Account and organization"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/organizations/{organizationId}/venues": {
      "get": {
        "operationId": "venues",
        "summary": "List authorized venues and device-management and reporting capabilities.",
        "tags": [
          "Account and organization"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/organizations/{organizationId}/roles": {
      "get": {
        "operationId": "roles",
        "summary": "List roles and their permissions within the organization.",
        "tags": [
          "Account and organization"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/organizations/{organizationId}/role-assignments": {
      "post": {
        "operationId": "assign",
        "summary": "Assign a role to a member. venueId is null for organization-wide scope. SQL checks authorization and prevents escalation; a fresh session is required.",
        "tags": [
          "Account and organization"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Must exactly match the configured application origin."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "memberId",
                  "roleId",
                  "venueId"
                ],
                "properties": {
                  "memberId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "roleId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "venueId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/organizations/{organizationId}/role-assignments/{assignmentId}": {
      "delete": {
        "operationId": "unassign",
        "summary": "Revoke an assignment with authorization checks, a fresh session, and protection for the last Owner.",
        "tags": [
          "Account and organization"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "assignmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Must exactly match the configured application origin."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/organizations/{organizationId}/venues/{venueId}/devices": {
      "get": {
        "operationId": "devices",
        "summary": "List devices, their last activity, expiration and revocation.",
        "tags": [
          "Account and organization"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "venueId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-kelna-permission": "devices.manage"
      }
    },
    "/api/organizations/{organizationId}/venues/{venueId}/pairing": {
      "post": {
        "operationId": "pairing",
        "summary": "Create a single-use code valid for five minutes, for a tablet or pass display.",
        "tags": [
          "Account and organization"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "venueId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Must exactly match the configured application origin."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "kind"
                ],
                "properties": {
                  "kind": {
                    "enum": [
                      "tablet",
                      "pass"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-kelna-permission": "devices.manage"
      }
    },
    "/api/organizations/{organizationId}/venues/{venueId}/devices/{deviceId}/revoke": {
      "post": {
        "operationId": "revoke",
        "summary": "Revoke a venue device.",
        "tags": [
          "Account and organization"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "venueId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Must exactly match the configured application origin."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-kelna-permission": "devices.manage"
      }
    },
    "/api/device/pair": {
      "post": {
        "operationId": "pair",
        "summary": "Exchange an eight-character code for the HttpOnly kelna.device cookie. Origin is checked and attempts are limited.",
        "tags": [
          "Public"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Must exactly match the configured application origin."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "code",
                  "kind"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^[A-HJ-NP-Z2-9]{8}$"
                  },
                  "kind": {
                    "enum": [
                      "tablet",
                      "pass"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/device": {
      "get": {
        "operationId": "device",
        "summary": "Read the venue and view authorized for the current device.",
        "tags": [
          "Room devices"
        ],
        "security": [
          {
            "PairedDevice": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/organizations/{organizationId}/venues/{venueId}/room": {
      "get": {
        "operationId": "memberRoom",
        "summary": "Read the room snapshot using a verified human session and the explicit venue context.",
        "tags": [
          "Account and organization"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "venueId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-kelna-permission": "venue.view"
      }
    },
    "/api/room": {
      "get": {
        "operationId": "room",
        "summary": "Read the plan, service, table and group snapshot for the paired device.",
        "tags": [
          "Room devices"
        ],
        "security": [
          {
            "PairedDevice": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-kelna-permission": "venue.view"
      }
    },
    "/api/room/services": {
      "post": {
        "operationId": "start",
        "summary": "Open a service with a caller-supplied UUID id. The plan and thresholds are fixed when it opens.",
        "tags": [
          "Room devices"
        ],
        "security": [
          {
            "PairedDevice": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Must exactly match the configured application origin."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "duplicate"
                  ],
                  "properties": {
                    "duplicate": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-kelna-permission": "services.manage"
      }
    },
    "/api/room/services/{serviceId}/close": {
      "post": {
        "operationId": "close",
        "summary": "Close a service with a command UUID id. Final states are preserved.",
        "tags": [
          "Room devices"
        ],
        "security": [
          {
            "PairedDevice": []
          }
        ],
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Must exactly match the configured application origin."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "duplicate"
                  ],
                  "properties": {
                    "duplicate": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-kelna-permission": "services.manage"
      }
    },
    "/api/room/services/{serviceId}/tables/{tableId}/commands": {
      "post": {
        "operationId": "command",
        "summary": "Apply a table action or undo using id and expectedVersion. A joined table also requires groupId and every member’s version.",
        "tags": [
          "Room devices"
        ],
        "security": [
          {
            "PairedDevice": []
          }
        ],
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tableId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Must exactly match the configured application origin."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "expectedVersion"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "seat",
                      "greet",
                      "order",
                      "serve",
                      "request_bill",
                      "deliver_bill",
                      "pay",
                      "depart",
                      "clear",
                      "undo"
                    ]
                  },
                  "expectedVersion": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483646
                  },
                  "groupId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "members": {
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 30,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "tableId",
                        "version"
                      ],
                      "properties": {
                        "tableId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "version": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 2147483646
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "duplicate"
                  ],
                  "properties": {
                    "duplicate": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-kelna-permission": "tables.update"
      }
    },
    "/api/room/services/{serviceId}/groups": {
      "post": {
        "operationId": "group",
        "summary": "Join, split or undo a group operation. Supply the current group and table versions.",
        "tags": [
          "Room devices"
        ],
        "security": [
          {
            "PairedDevice": []
          }
        ],
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Must exactly match the configured application origin."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "groupId",
                  "expectedVersion",
                  "primaryTableId",
                  "members"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "type": {
                    "enum": [
                      "join",
                      "split",
                      "undo_join",
                      "undo_split"
                    ]
                  },
                  "groupId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "expectedVersion": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483646
                  },
                  "primaryTableId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "members": {
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 30,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "tableId",
                        "version"
                      ],
                      "properties": {
                        "tableId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "version": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 2147483646
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "duplicate"
                  ],
                  "properties": {
                    "duplicate": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-kelna-permission": "tables.join"
      }
    },
    "/api/organizations/{organizationId}/venues/{venueId}/vision": {
      "get": {
        "operationId": "visionRead",
        "summary": "Read preparatory settings for the camera test bench. Camera observations do not drive the service.",
        "tags": [
          "Experimental configuration"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "venueId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-kelna-permission": "venue.view",
        "x-kelna-experimental": true
      },
      "post": {
        "operationId": "visionWrite",
        "summary": "Save experimental settings using planId, revision and config. No video stream or image is accepted.",
        "tags": [
          "Experimental configuration"
        ],
        "security": [
          {
            "HumanSession": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "venueId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Must exactly match the configured application origin."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "planId",
                  "revision",
                  "config"
                ],
                "properties": {
                  "planId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "revision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483646
                  },
                  "config": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation. Consult the guides for the response contract."
          },
          "default": {
            "description": "Kelna error. Authentication proxy responses use Better Auth formats.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-kelna-permission": "floorplan.edit",
        "x-kelna-experimental": true
      }
    }
  },
  "components": {
    "securitySchemes": {
      "HumanSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Secure-better-auth.session_token",
        "description": "Production HTTPS session cookie, accompanied by the other Better Auth cookies when required. Development omits the __Secure- prefix. MFA is required for tenant routes."
      },
      "PairedDevice": {
        "type": "apiKey",
        "in": "cookie",
        "name": "kelna.device",
        "description": "HttpOnly cookie obtained through venue device pairing. The pass is read-only; mutations require a tablet."
      }
    },
    "schemas": {
      "ApiError": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    }
  }
}
