{
  "openapi": "3.1.0",
  "info": {
    "title": "Databek App API",
    "version": "0.1.0",
    "description": "The API of app.databek.com, the data workspace: sign-in, workspaces and\nmembers, sources and loads, the repository and change requests, dashboards, chat and deliveries.\n\n**Base path** `/api/v1`. JSON in and out, timestamps in UTC (ISO 8601).\n\n**Auth.** `POST /api/v1/auth/login` (email + password, then `POST /api/v1/auth/login/verify` with the emailed code\non a device it does not recognise) returns an access token (15 minutes) and a refresh token (30 days). Send the\naccess token as `Authorization: Bearer <token>`; renew it with `POST /api/v1/auth/refresh`. Google sign-in is for\nthe web app only: it ends in session cookies, not in tokens for an API client. Inside a workspace the path's\n`workspace_id` is only a name: access comes from the caller's membership, and a workspace the caller is not a\nmember of answers 404. Roles are nested (viewer ⊂ builder ⊂ admin ⊂ owner). Each operation names the capabilities\nand plan features its route checks. Some refuse more depending on the request itself (a dashboard's own access\nlist, the workspace named in a signed `state`, the kind of a work request): 403 with their own code.\n\n**Errors** have the body `{\"code\", \"message\", \"field\"?}`: `code` is a stable machine key, `message` a\nhuman-readable text (Uzbek today), `field` the first invalid input.\n\n**Lists** answer `{items, next_cursor, total}` and take `?cursor=&limit=` (1–200), most also `q`, `sort` and\n`order`.\n\n**Request id.** `X-Request-ID` is accepted (`[A-Za-z0-9._:-]{1,128}`) or generated, and returned on every\nresponse."
  },
  "paths": {
    "/api/v1/auth/captcha": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Captcha",
        "description": "What a form's human check needs: the mode, a single-use proof-of-work challenge (10 minutes) in `pow`, the site key in `turnstile`.",
        "operationId": "captcha_api_v1_auth_captcha_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaptchaOut"
                }
              }
            }
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/auth/register": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Register",
        "operationId": "register_api_v1_auth_register_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserOut"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Login",
        "operationId": "login_api_v1_auth_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginOut"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/auth/login/verify": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Verify",
        "operationId": "verify_api_v1_auth_login_verify_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenPairOut"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/auth/telegram": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Telegram Login",
        "description": "Mini App sign-in with Telegram's signed `initData`, only for a linked person; a live session of that person in the cookie continues instead of a new one.",
        "operationId": "telegram_login_api_v1_auth_telegram_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TelegramLoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenPairOut"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/auth/telegram/google": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Telegram Google Start",
        "description": "Mini App: opens a link request that the person confirms in the phone browser after signing in with Google (10 minutes, one-time nonce).",
        "operationId": "telegram_google_start_api_v1_auth_telegram_google_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TelegramLoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramGoogleStartOut"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/auth/telegram/google/view": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Telegram Google View",
        "description": "For the person signed in in the browser: which Telegram would be linked to which account.",
        "operationId": "telegram_google_view_api_v1_auth_telegram_google_view_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TelegramGoogleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramGoogleViewOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/auth/telegram/google/confirm": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Telegram Google Confirm",
        "description": "\"Ulash\": links the Telegram to this account (409 when it is linked to someone else).",
        "operationId": "telegram_google_confirm_api_v1_auth_telegram_google_confirm_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TelegramGoogleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/auth/telegram/google/claim": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Telegram Google Claim",
        "description": "The Mini App asks with the same Telegram's `initData`: `pending` until confirmed, then a session.",
        "operationId": "telegram_google_claim_api_v1_auth_telegram_google_claim_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TelegramGoogleClaimRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramGoogleClaimOut"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Refresh",
        "operationId": "refresh_api_v1_auth_refresh_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenPairOut"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/auth/me": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Me",
        "operationId": "me_api_v1_auth_me_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      },
      "patch": {
        "tags": [
          "auth"
        ],
        "summary": "Update Me",
        "description": "Saves the caller's language: the next sign-in, the Mini App, bot replies, emails and reports use it.",
        "operationId": "update_me_api_v1_auth_me_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/auth/sessions": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Sessions",
        "description": "The caller's live sessions: `?q=` IP or browser, `sort`, `order`, paged with a cursor.",
        "operationId": "sessions_api_v1_auth_sessions_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "last_seen_at",
                "created_at"
              ],
              "type": "string",
              "default": "last_seen_at",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      },
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Revoke Other Sessions",
        "operationId": "revoke_other_sessions_api_v1_auth_sessions_delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokedOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          }
        },
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Logout",
        "operationId": "logout_api_v1_auth_logout_post",
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/auth/sessions/{session_id}": {
      "delete": {
        "tags": [
          "auth"
        ],
        "summary": "Revoke Session",
        "operationId": "revoke_session_api_v1_auth_sessions__session_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Session Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/auth/password/forgot": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Forgot Password",
        "operationId": "forgot_password_api_v1_auth_password_forgot_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/auth/password/reset": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Reset Password",
        "operationId": "reset_password_api_v1_auth_password_reset_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/auth/google/login": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Google Login Start",
        "operationId": "google_login_start_api_v1_auth_google_login_get",
        "parameters": [
          {
            "name": "next",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Next"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "To Google's sign-in page; a short-lived cookie keeps the sign-in state.",
            "headers": {
              "Location": {
                "description": "Where the browser goes next.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "303": {
            "description": "To `/login?error=<code>` when Google sign-in is not configured.",
            "headers": {
              "Location": {
                "description": "Where the browser goes next.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/auth/google/callback": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Google Callback",
        "operationId": "google_callback_api_v1_auth_google_callback_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Code"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "State"
            }
          },
          {
            "name": "error",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Error"
            }
          }
        ],
        "responses": {
          "303": {
            "description": "To the app with the session cookies set, or to `/login?error=<code>` when the sign-in failed.",
            "headers": {
              "Location": {
                "description": "Where the browser goes next.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/workspaces": {
      "get": {
        "tags": [
          "workspace"
        ],
        "summary": "List Workspaces",
        "operationId": "list_workspaces_api_v1_workspaces_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      },
      "post": {
        "tags": [
          "workspace"
        ],
        "summary": "Create Workspace",
        "description": "A new workspace: its identifier (`name`) is `ws:<n>` (its own counter, not the id; a sent `name` is ignored). The name a person reads is the optional `title`; `display_name` in the answer is always a readable name.",
        "operationId": "create_workspace_api_v1_workspaces_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceWithRoleOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/workspaces/default": {
      "post": {
        "tags": [
          "workspace"
        ],
        "summary": "Open Default Workspace",
        "description": "First entry: a person without a workspace gets one (`ws:<n>`, with the trial); a person who already has a membership (an accepted invite too) gets no new one, the first is returned. A repeated request still opens only one.",
        "operationId": "open_default_workspace_api_v1_workspaces_default_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceWithRoleOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}": {
      "get": {
        "tags": [
          "workspace"
        ],
        "summary": "Get Workspace",
        "description": "The card stays open after the trial ends: the web draws the stopped screen from `trial` in this response.",
        "operationId": "get_workspace_api_v1_workspaces__workspace_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceWithRoleOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token of a member of the workspace (any role)."
        }
      },
      "patch": {
        "tags": [
          "workspace"
        ],
        "summary": "Update Workspace",
        "description": "Admin and Owner: only the sent fields change, `title` (the name; `null` or blank removes it and the industry's name or the neutral default shows) and `industry`. `name` (`ws:<n>`) never changes.",
        "operationId": "update_workspace_api_v1_workspaces__workspace_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceWithRoleOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `branding.manage`: admin, owner.",
          "capabilities": [
            "branding.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/stop": {
      "post": {
        "tags": [
          "workspace"
        ],
        "summary": "Stop Workspace",
        "operationId": "stop_workspace_api_v1_workspaces__workspace_id__stop_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceWithRoleOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `workspace.stop`: owner.",
          "capabilities": [
            "workspace.stop"
          ],
          "roles": [
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/start": {
      "post": {
        "tags": [
          "workspace"
        ],
        "summary": "Start Workspace",
        "operationId": "start_workspace_api_v1_workspaces__workspace_id__start_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceWithRoleOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `workspace.stop`: owner.",
          "capabilities": [
            "workspace.stop"
          ],
          "roles": [
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/members": {
      "get": {
        "tags": [
          "workspace"
        ],
        "summary": "List Members",
        "description": "Members: `?q=` email or name, `sort` and `order`, paged with a cursor.",
        "operationId": "list_members_api_v1_workspaces__workspace_id__members_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "asc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "created_at",
                "email",
                "full_name"
              ],
              "type": "string",
              "default": "created_at",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `member.manage`: admin, owner.",
          "capabilities": [
            "member.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/invites": {
      "get": {
        "tags": [
          "workspace"
        ],
        "summary": "List Invites",
        "description": "Pending invites (neither accepted nor revoked), newest first, up to 100; `state` tells whether one has expired.",
        "operationId": "list_invites_api_v1_workspaces__workspace_id__invites_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `member.manage`: admin, owner.",
          "capabilities": [
            "member.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      },
      "post": {
        "tags": [
          "workspace"
        ],
        "summary": "Create Invite",
        "description": "With an email: an existing account joins at once, anyone else gets a 7-day invite email; the answer is `sent` in both cases. Without an email: a one-time link (`link`), for a builder or a viewer only (422 `invite_needs_email`). 429: 20 an hour and 60 a day per workspace; 30 an hour and 100 a day per inviter; 100 a day per IP; 5 a day per email address.",
        "operationId": "create_invite_api_v1_workspaces__workspace_id__invites_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteSentOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `member.manage`: admin, owner.",
          "capabilities": [
            "member.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/invites/{invite_id}/resend": {
      "post": {
        "tags": [
          "workspace"
        ],
        "summary": "Resend Invite",
        "description": "Sends the email again with a new link valid for 7 days; the old link stops working. 409 for an invite without an email.",
        "operationId": "resend_invite_api_v1_workspaces__workspace_id__invites__invite_id__resend_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "invite_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Invite Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `member.manage`: admin, owner.",
          "capabilities": [
            "member.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/invites/{invite_id}/link": {
      "post": {
        "tags": [
          "workspace"
        ],
        "summary": "Share Invite",
        "description": "A new one-time link to share (Telegram, copy); the previous one, including the emailed one, stops working.",
        "operationId": "share_invite_api_v1_workspaces__workspace_id__invites__invite_id__link_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "invite_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Invite Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteLinkOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `member.manage`: admin, owner.",
          "capabilities": [
            "member.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/invites/{invite_id}": {
      "delete": {
        "tags": [
          "workspace"
        ],
        "summary": "Revoke Invite",
        "operationId": "revoke_invite_api_v1_workspaces__workspace_id__invites__invite_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "invite_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Invite Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `member.manage`: admin, owner.",
          "capabilities": [
            "member.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/members/{user_id}": {
      "patch": {
        "tags": [
          "workspace"
        ],
        "summary": "Change Member Role",
        "operationId": "change_member_role_api_v1_workspaces__workspace_id__members__user_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "User Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleChangeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `role.change`: admin, owner.",
          "capabilities": [
            "role.change"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      },
      "delete": {
        "tags": [
          "workspace"
        ],
        "summary": "Remove Member",
        "operationId": "remove_member_api_v1_workspaces__workspace_id__members__user_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "User Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `member.manage`: admin, owner.",
          "capabilities": [
            "member.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/me/preferences": {
      "put": {
        "tags": [
          "workspace"
        ],
        "summary": "Update Preferences",
        "description": "The caller's own mode (`ui_mode`): every member sets their own; developer mode needs `dev_mode`.",
        "operationId": "update_preferences_api_v1_workspaces__workspace_id__me_preferences_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreferencesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreferencesOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token of a member of the workspace (any role)."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/settings": {
      "get": {
        "tags": [
          "workspace"
        ],
        "summary": "Get Settings",
        "operationId": "get_settings_api_v1_workspaces__workspace_id__settings_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token of a member of the workspace (any role)."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/settings/branding": {
      "patch": {
        "tags": [
          "workspace"
        ],
        "summary": "Update Branding",
        "operationId": "update_branding_api_v1_workspaces__workspace_id__settings_branding_patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandingUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `branding.manage`: admin, owner.",
          "capabilities": [
            "branding.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/settings/ai": {
      "patch": {
        "tags": [
          "workspace"
        ],
        "summary": "Update Ai Settings",
        "operationId": "update_ai_settings_api_v1_workspaces__workspace_id__settings_ai_patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiSettingsUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `ai.model.manage`: owner.",
          "capabilities": [
            "ai.model.manage"
          ],
          "roles": [
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/settings/ai-data-access": {
      "put": {
        "tags": [
          "workspace"
        ],
        "summary": "Update Ai Data Access",
        "description": "What the AI sees: Owner only; written to `workspace.yml` on `main`.",
        "operationId": "update_ai_data_access_api_v1_workspaces__workspace_id__settings_ai_data_access_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiDataAccessRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.approve_owner`: owner.",
          "capabilities": [
            "change.approve_owner"
          ],
          "roles": [
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/settings/instructions": {
      "get": {
        "tags": [
          "workspace"
        ],
        "summary": "Get Company Instructions",
        "description": "For old clients: company instructions are not stored, the answer is always empty.",
        "operationId": "get_company_instructions_api_v1_workspaces__workspace_id__settings_instructions_get",
        "deprecated": true,
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyInstructionsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `ai.instructions.manage`: admin, owner.",
          "capabilities": [
            "ai.instructions.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      },
      "put": {
        "tags": [
          "workspace"
        ],
        "summary": "Update Company Instructions",
        "description": "For old clients: the text sent is neither read nor stored (200, an empty answer).",
        "operationId": "update_company_instructions_api_v1_workspaces__workspace_id__settings_instructions_put",
        "deprecated": true,
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyInstructionsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `ai.instructions.manage`: admin, owner.",
          "capabilities": [
            "ai.instructions.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/invites/preview": {
      "post": {
        "tags": [
          "workspace"
        ],
        "summary": "Preview Invite",
        "description": "The invite behind a link: workspace name, role, who invited and its state (`open`, `expired`, `revoked`, `used`); no sign-in needed. An unknown token is 404; after 30 from one IP in an hour, 429.",
        "operationId": "preview_invite_api_v1_invites_preview_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitePreviewOut"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/invites/accept": {
      "post": {
        "tags": [
          "workspace"
        ],
        "summary": "Accept Invite",
        "description": "The signed-in person joins with the invite's role, once; an invite that no longer works is 410 (`invite_expired`, `invite_revoked`, `invite_used`). An admin or owner invite is taken only by the account with the invited email (403 `invite_email_mismatch`).",
        "operationId": "accept_invite_api_v1_invites_accept_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteAcceptedOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/plan": {
      "get": {
        "tags": [
          "plans"
        ],
        "summary": "Get Plan",
        "description": "Plan, features, SKU and capacity, limits, seats, AI credits and the trial (`trial`); also after the trial has ended.",
        "operationId": "get_plan_api_v1_workspaces__workspace_id__plan_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `capacity.view`: admin, owner.",
          "capabilities": [
            "capacity.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/capacity": {
      "get": {
        "tags": [
          "capacity"
        ],
        "summary": "Read Capacity",
        "description": "Capacity: SKU, likely tier, DCU-hours today and this month, storage, ingest, AI credits and a recommendation.",
        "operationId": "read_capacity_api_v1_workspaces__workspace_id__capacity_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CapacityOverviewOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `capacity.view`: admin, owner.",
          "capabilities": [
            "capacity.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/capacity/usage": {
      "get": {
        "tags": [
          "capacity"
        ],
        "summary": "Read Capacity Usage",
        "description": "`period=24h` hourly, `7d|30d|90d` daily: DCU-s, storage, AI cost, ingest and peaks.",
        "operationId": "read_capacity_usage_api_v1_workspaces__workspace_id__capacity_usage_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/CapacityUsagePeriod",
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CapacityUsageOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `capacity.view`: admin, owner.",
          "capabilities": [
            "capacity.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/groups": {
      "get": {
        "tags": [
          "access"
        ],
        "summary": "List Groups",
        "description": "Groups with their members: `?q=` slug or name, `sort` (slug, created_at), paged with a cursor.",
        "operationId": "list_groups_api_v1_workspaces__workspace_id__groups_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "asc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "slug",
                "created_at"
              ],
              "type": "string",
              "default": "slug",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `groups` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "groups"
          ]
        }
      },
      "post": {
        "tags": [
          "access"
        ],
        "summary": "Create Group",
        "operationId": "create_group_api_v1_workspaces__workspace_id__groups_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `groups` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "groups"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/groups/{slug}": {
      "patch": {
        "tags": [
          "access"
        ],
        "summary": "Update Group",
        "operationId": "update_group_api_v1_workspaces__workspace_id__groups__slug__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `groups` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "groups"
          ]
        }
      },
      "delete": {
        "tags": [
          "access"
        ],
        "summary": "Delete Group",
        "operationId": "delete_group_api_v1_workspaces__workspace_id__groups__slug__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `groups` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "groups"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/groups/{slug}/members": {
      "put": {
        "tags": [
          "access"
        ],
        "summary": "Set Group Members",
        "description": "Replaces the group's members entirely: `{\"user_ids\": [...]}`, each a member of this workspace.",
        "operationId": "set_group_members_api_v1_workspaces__workspace_id__groups__slug__members_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupMembersRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `groups` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "groups"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/members/{user_id}/attributes": {
      "get": {
        "tags": [
          "access"
        ],
        "summary": "Get Attributes",
        "operationId": "get_attributes_api_v1_workspaces__workspace_id__members__user_id__attributes_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "User Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttributesOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `row_filters` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "row_filters"
          ]
        }
      },
      "put": {
        "tags": [
          "access"
        ],
        "summary": "Set Attributes",
        "description": "Replaces the member's attributes entirely: `{\"attributes\": {\"store_ids\": [\"12\", \"15\"]}}`.",
        "operationId": "set_attributes_api_v1_workspaces__workspace_id__members__user_id__attributes_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "User Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttributesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttributesOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `row_filters` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "row_filters"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/audit": {
      "get": {
        "tags": [
          "audit"
        ],
        "summary": "List Audit Log",
        "description": "The workspace's audit trail, newest first. On workspace rows `target_name` is the name a person reads (`display_name`); the stored trail keeps the `ws:<n>` identifier.",
        "operationId": "list_audit_log_api_v1_workspaces__workspace_id__audit_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "created_at",
              "type": "string",
              "default": "created_at",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `audit.view`: admin, owner.",
          "capabilities": [
            "audit.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/logs": {
      "get": {
        "tags": [
          "logs"
        ],
        "summary": "List Logs",
        "description": "The workspace Activity log: events, audit entries and run logs in one list, with filters and a cursor.",
        "operationId": "list_logs_api_v1_workspaces__workspace_id__logs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "created_at",
              "type": "string",
              "default": "created_at",
              "title": "Sort"
            }
          },
          {
            "name": "level",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/LogLevel"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Level"
            }
          },
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 64
                },
                {
                  "type": "null"
                }
              ],
              "title": "Code"
            }
          },
          {
            "name": "resource_kind",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 32
                },
                {
                  "type": "null"
                }
              ],
              "title": "Resource Kind"
            }
          },
          {
            "name": "resource_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "title": "Resource Id"
            }
          },
          {
            "name": "request_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 64
                },
                {
                  "type": "null"
                }
              ],
              "title": "Request Id"
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "event",
                    "audit",
                    "run"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Origin"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Until"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogsLogListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `monitoring.view`: admin, owner.",
          "capabilities": [
            "monitoring.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/logs/{ref}": {
      "get": {
        "tags": [
          "logs"
        ],
        "summary": "Read Log",
        "description": "One event in full (the right panel): fields, text and request id.",
        "operationId": "read_log_api_v1_workspaces__workspace_id__logs__ref__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ref"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `monitoring.view`: admin, owner.",
          "capabilities": [
            "monitoring.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/ai-usage": {
      "get": {
        "tags": [
          "ai"
        ],
        "summary": "Read Ai Usage",
        "description": "This month's AI credits and the spend of the last `days` days, by day, model and purpose.",
        "operationId": "read_ai_usage_api_v1_workspaces__workspace_id__ai_usage_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 365,
              "minimum": 1,
              "default": 30,
              "title": "Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiUsageOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `ai_usage.view`: admin, owner.",
          "capabilities": [
            "ai_usage.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/ai-events": {
      "get": {
        "tags": [
          "ai"
        ],
        "summary": "List Ai Events",
        "description": "One priced row per AI call, newest first.",
        "operationId": "list_ai_events_api_v1_workspaces__workspace_id__ai_events_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "created_at",
              "type": "string",
              "default": "created_at",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiEventListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `ai_usage.view`: admin, owner.",
          "capabilities": [
            "ai_usage.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/monitoring/runs": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "summary": "List Runs",
        "description": "Chat turns: model, rounds, tokens, duration and error.",
        "operationId": "list_runs_api_v1_workspaces__workspace_id__monitoring_runs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "created_at",
                "duration_ms"
              ],
              "type": "string",
              "default": "created_at",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatRunListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `monitoring.view`: admin, owner.",
          "capabilities": [
            "monitoring.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/monitoring/queries": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "summary": "List Queries",
        "description": "Trail of executed SQL queries: who, which connection, how long, how many rows.",
        "operationId": "list_queries_api_v1_workspaces__workspace_id__monitoring_queries_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "created_at",
                "duration_ms",
                "row_count"
              ],
              "type": "string",
              "default": "created_at",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryLogListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `monitoring.view`: admin, owner.",
          "capabilities": [
            "monitoring.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/monitoring/jobs": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "summary": "List Jobs",
        "description": "Worker state: the scheduler tick and stuck runs; `items` stays empty.",
        "operationId": "list_jobs_api_v1_workspaces__workspace_id__monitoring_jobs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `monitoring.view`: admin, owner.",
          "capabilities": [
            "monitoring.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/monitoring/usage": {
      "get": {
        "tags": [
          "monitoring"
        ],
        "summary": "Read Usage",
        "description": "Token and request spend: raw numbers by day and action type.",
        "operationId": "read_usage_api_v1_workspaces__workspace_id__monitoring_usage_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 365,
              "minimum": 1,
              "default": 30,
              "title": "Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReportOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `monitoring.view`: admin, owner.",
          "capabilities": [
            "monitoring.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Read Billing",
        "description": "Balance, this month's usage and budget, the subscription, the plan choices, the next charge date and how to pay (Admin and Owner).",
        "operationId": "read_billing_api_v1_workspaces__workspace_id__billing_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `billing.view`: admin, owner.",
          "capabilities": [
            "billing.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/entries": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "List Entries",
        "description": "The balance ledger: payments, subscriptions, daily usage, adjustments and refunds, newest first.",
        "operationId": "list_entries_api_v1_workspaces__workspace_id__billing_entries_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntryListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `billing.view`: admin, owner.",
          "capabilities": [
            "billing.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/limits": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Read Limits",
        "description": "The plan's limits and their use: monthly load, storage, today's voice, connections and the fastest refresh.",
        "operationId": "read_limits_api_v1_workspaces__workspace_id__billing_limits_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LimitsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `billing.view`: admin, owner.",
          "capabilities": [
            "billing.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/budget": {
      "put": {
        "tags": [
          "billing"
        ],
        "summary": "Set Budget",
        "description": "The month's total budget in UZS (subscription, move-ups, usage above the allowance), not below the tier price; Owner only.",
        "operationId": "set_budget_api_v1_workspaces__workspace_id__billing_budget_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `billing.manage`: owner.",
          "capabilities": [
            "billing.manage"
          ],
          "roles": [
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/pin": {
      "put": {
        "tags": [
          "billing"
        ],
        "summary": "Pin Tier",
        "description": "Pin the tier: it does not move down at the month start (moving up still works); Owner only.",
        "operationId": "pin_tier_api_v1_workspaces__workspace_id__billing_pin_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PinRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `billing.manage`: owner.",
          "capabilities": [
            "billing.manage"
          ],
          "roles": [
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/plan": {
      "put": {
        "tags": [
          "billing"
        ],
        "summary": "Choose Plan",
        "description": "Choose a plan, from today: up charges the difference for the days left, down puts it back on the balance; Owner only.",
        "operationId": "choose_plan_api_v1_workspaces__workspace_id__billing_plan_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanChoiceIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `billing.manage`: owner.",
          "capabilities": [
            "billing.manage"
          ],
          "roles": [
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/requests": {
      "post": {
        "tags": [
          "billing"
        ],
        "summary": "Request Contact",
        "description": "A payment or plan request: Databek's team is notified by Telegram and e-mail, once per 10 minutes per workspace.",
        "operationId": "request_contact_api_v1_workspaces__workspace_id__billing_requests_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactRequestIn"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `billing.view`: admin, owner.",
          "capabilities": [
            "billing.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/notifications": {
      "get": {
        "tags": [
          "notifications"
        ],
        "summary": "List Notifications",
        "description": "The current user's notifications in this workspace, newest first; `?unread=true` for unread ones only.",
        "operationId": "list_notifications_api_v1_workspaces__workspace_id__notifications_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "created_at",
              "type": "string",
              "default": "created_at",
              "title": "Sort"
            }
          },
          {
            "name": "unread",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Unread"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token of a member of the workspace (any role)."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/notifications/{notification_id}/read": {
      "post": {
        "tags": [
          "notifications"
        ],
        "summary": "Mark Notification Read",
        "operationId": "mark_notification_read_api_v1_workspaces__workspace_id__notifications__notification_id__read_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "notification_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Notification Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token of a member of the workspace (any role)."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/findings": {
      "get": {
        "tags": [
          "findings"
        ],
        "summary": "List Findings",
        "description": "Today's top findings (≤3) for owners and admins of a workspace where the daily-findings pilot is on; anyone else gets an empty list.",
        "operationId": "list_findings_api_v1_workspaces__workspace_id__findings_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindingListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token of a member of the workspace (any role)."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/findings/{finding_id}/done": {
      "post": {
        "tags": [
          "findings"
        ],
        "summary": "Mark Finding Done",
        "description": "Done: the finding leaves the caller's list.",
        "operationId": "mark_finding_done_api_v1_workspaces__workspace_id__findings__finding_id__done_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "finding_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Finding Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindingStateOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token of a member of the workspace (any role)."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/findings/{finding_id}/mute": {
      "post": {
        "tags": [
          "findings"
        ],
        "summary": "Mute Finding",
        "description": "Not needed: this measure and detector are hidden from the caller for 30 days (in Telegram too).",
        "operationId": "mute_finding_api_v1_workspaces__workspace_id__findings__finding_id__mute_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "finding_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Finding Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindingStateOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token of a member of the workspace (any role)."
        }
      }
    },
    "/api/v1/industries": {
      "get": {
        "tags": [
          "industries"
        ],
        "summary": "List Industries",
        "operationId": "list_industries_api_v1_industries_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndustryListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/repo/tree": {
      "get": {
        "tags": [
          "repo"
        ],
        "summary": "Read Tree",
        "description": "Files at a ref or commit (developer mode, `/dev`).",
        "operationId": "read_tree_api_v1_workspaces__workspace_id__repo_tree_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "ref",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "default": "main",
              "title": "Ref"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepoTreeOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/repo/file": {
      "get": {
        "tags": [
          "repo"
        ],
        "summary": "Read File",
        "description": "File text; `ETag` is the blob oid, sent back in `If-Match` when saving.",
        "operationId": "read_file_api_v1_workspaces__workspace_id__repo_file_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "ref",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "default": "main",
              "title": "Ref"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300,
              "title": "Path"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepoFileOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "put": {
        "tags": [
          "repo"
        ],
        "summary": "Write File",
        "description": "Commits the file to the `dev/<id>/<name>` draft or to an open `cr/<number>`; `main` answers 409.",
        "operationId": "write_file_api_v1_workspaces__workspace_id__repo_file_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "if-match",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 1000
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-Match"
            }
          },
          {
            "name": "if-none-match",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 1000
                },
                {
                  "type": "null"
                }
              ],
              "title": "If-None-Match"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RepoFileIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepoFileSavedOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.create`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "change.create"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/changes": {
      "get": {
        "tags": [
          "changes"
        ],
        "summary": "List Changes",
        "description": "Change requests, newest first (developer mode `/dev/changes`).",
        "operationId": "list_changes_api_v1_workspaces__workspace_id__changes_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "number",
              "type": "string",
              "default": "number",
              "title": "Sort"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ChangeStatus"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "post": {
        "tags": [
          "changes"
        ],
        "summary": "Create Change",
        "description": "Opens a change request (CR) from the caller's own draft; classification and CI checks are queued at once (state `checking`).",
        "operationId": "create_change_api_v1_workspaces__workspace_id__changes_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeCreateIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.create`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "change.create"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/changes/{number}": {
      "get": {
        "tags": [
          "changes"
        ],
        "summary": "Get Change",
        "description": "The CR, the policy reasons (why a person has to approve), the checks at the current head and the approvals.",
        "operationId": "get_change_api_v1_workspaces__workspace_id__changes__number__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 999999999,
              "minimum": 1,
              "title": "Number"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/changes/{number}/diff": {
      "get": {
        "tags": [
          "changes"
        ],
        "summary": "Change Diff",
        "description": "File changes between the CR's base and head, each with a unified diff.",
        "operationId": "change_diff_api_v1_workspaces__workspace_id__changes__number__diff_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 999999999,
              "minimum": 1,
              "title": "Number"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeDiffOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/changes/{number}/checks/rerun": {
      "post": {
        "tags": [
          "changes"
        ],
        "summary": "Rerun Checks",
        "description": "A new attempt at the current head: earlier results stay in the history, the decision comes from the new attempt.",
        "operationId": "rerun_checks_api_v1_workspaces__workspace_id__changes__number__checks_rerun_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 999999999,
              "minimum": 1,
              "title": "Number"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.create`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "change.create"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/changes/{number}/approve": {
      "post": {
        "tags": [
          "changes"
        ],
        "summary": "Approve Change",
        "description": "A person's approval of the head they saw (`head_oid`); when enough approvals are in, the CR goes to the deploy queue.",
        "operationId": "approve_change_api_v1_workspaces__workspace_id__changes__number__approve_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 999999999,
              "minimum": 1,
              "title": "Number"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.approve`: builder, admin, owner.",
          "capabilities": [
            "change.approve"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/changes/{number}/confirm": {
      "post": {
        "tags": [
          "changes"
        ],
        "summary": "Confirm Change",
        "description": "\"Run\" on the simple-mode card: only when the checks are clean and the CR waits for a person's decision.",
        "operationId": "confirm_change_api_v1_workspaces__workspace_id__changes__number__confirm_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 999999999,
              "minimum": 1,
              "title": "Number"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.approve`: builder, admin, owner.",
          "capabilities": [
            "change.approve"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/changes/{number}/reject": {
      "post": {
        "tags": [
          "changes"
        ],
        "summary": "Reject Change",
        "operationId": "reject_change_api_v1_workspaces__workspace_id__changes__number__reject_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 999999999,
              "minimum": 1,
              "title": "Number"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RejectIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.approve`: builder, admin, owner.",
          "capabilities": [
            "change.approve"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/deployments": {
      "get": {
        "tags": [
          "deployments"
        ],
        "summary": "List Deployments",
        "description": "Versions, newest first: deploys, content saves and rollbacks.",
        "operationId": "list_deployments_api_v1_workspaces__workspace_id__deployments_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "version",
              "type": "string",
              "default": "version",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeploymentListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/deployments/{version}": {
      "get": {
        "tags": [
          "deployments"
        ],
        "summary": "Get Deployment",
        "operationId": "get_deployment_api_v1_workspaces__workspace_id__deployments__version__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 999999999,
              "minimum": 1,
              "title": "Version"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeploymentDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/deployments/{version}/rollback": {
      "post": {
        "tags": [
          "deployments"
        ],
        "summary": "Rollback",
        "description": "\"Restore version N\": a revert CR (the click is the approval) and a deploy in the queue; raw data is not restored.",
        "operationId": "rollback_api_v1_workspaces__workspace_id__deployments__version__rollback_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 999999999,
              "minimum": 1,
              "title": "Version"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RollbackIn"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RollbackOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `deploy.rollback`: builder, admin, owner.",
          "capabilities": [
            "deploy.rollback"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/runs": {
      "get": {
        "tags": [
          "runs"
        ],
        "summary": "List Runs",
        "description": "Pipeline runs, newest first: load, build, CI, deploy (`/dev/runs`).",
        "operationId": "list_runs_api_v1_workspaces__workspace_id__runs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "id",
              "type": "string",
              "default": "id",
              "title": "Sort"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/RunKind"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Kind"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/RunStatus-Input"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "source_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 9223372036854775807,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "title": "Source Id"
            }
          },
          {
            "name": "change_request_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 9223372036854775807,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "title": "Change Request Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunsRunListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/runs/{run_id}": {
      "get": {
        "tags": [
          "runs"
        ],
        "summary": "Get Run",
        "operationId": "get_run_api_v1_workspaces__workspace_id__runs__run_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Run Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/runs/{run_id}/logs": {
      "get": {
        "tags": [
          "runs"
        ],
        "summary": "Run Logs",
        "description": "Redacted log lines, oldest first; the response also carries the run state.",
        "operationId": "run_logs_api_v1_workspaces__workspace_id__runs__run_id__logs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Run Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunsLogListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/runs/{run_id}/logs/stream": {
      "get": {
        "tags": [
          "runs"
        ],
        "summary": "Stream Logs",
        "description": "SSE: new log lines and `end` when the run finishes; `Last-Event-ID` resumes where the stream broke off.",
        "operationId": "stream_logs_api_v1_workspaces__workspace_id__runs__run_id__logs_stream_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Run Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 9223372036854775807,
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "title": "After"
            }
          },
          {
            "name": "last-event-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 20
                },
                {
                  "type": "null"
                }
              ],
              "title": "Last-Event-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Server-sent events: one per new log line (`id` = the line's id), `end` at the end.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/runs/{run_id}/cancel": {
      "post": {
        "tags": [
          "runs"
        ],
        "summary": "Cancel Run",
        "operationId": "cancel_run_api_v1_workspaces__workspace_id__runs__run_id__cancel_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Run Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunsRunOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `source.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "source.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/secrets": {
      "get": {
        "tags": [
          "secrets"
        ],
        "summary": "List Secrets",
        "description": "Names and metadata only (`{name, kind, is_set, updated_at}`): a value is never returned.",
        "operationId": "list_secrets_api_v1_workspaces__workspace_id__secrets_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "asc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "name",
                "updated_at"
              ],
              "type": "string",
              "default": "name",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `secret.manage`: builder, admin, owner.",
          "capabilities": [
            "secret.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/secrets/{name}": {
      "put": {
        "tags": [
          "secrets"
        ],
        "summary": "Put Secret",
        "description": "The value is sealed with the workspace public key; 409 `secret_keys_pending` while that key does not exist yet.",
        "operationId": "put_secret_api_v1_workspaces__workspace_id__secrets__name__put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{1,63}$",
              "title": "Name"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecretPutRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `secret.manage`: builder, admin, owner.",
          "capabilities": [
            "secret.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "delete": {
        "tags": [
          "secrets"
        ],
        "summary": "Delete Secret",
        "operationId": "delete_secret_api_v1_workspaces__workspace_id__secrets__name__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{1,63}$",
              "title": "Name"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `secret.manage`: builder, admin, owner.",
          "capabilities": [
            "secret.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/secret-requests": {
      "get": {
        "tags": [
          "secrets"
        ],
        "summary": "List Secret Requests",
        "description": "Secrets an agent or a package asked for (filter with `?status=`); `is_set` tells whether that name is set now.",
        "operationId": "list_secret_requests_api_v1_workspaces__workspace_id__secret_requests_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "created_at",
              "type": "string",
              "default": "created_at",
              "title": "Sort"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SecretRequestStatus"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretRequestListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `secret.manage`: builder, admin, owner.",
          "capabilities": [
            "secret.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/secret-requests/{request_id}/dismiss": {
      "post": {
        "tags": [
          "secrets"
        ],
        "summary": "Dismiss Secret Request",
        "operationId": "dismiss_secret_request_api_v1_workspaces__workspace_id__secret_requests__request_id__dismiss_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Request Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretRequestOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `secret.manage`: builder, admin, owner.",
          "capabilities": [
            "secret.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/data-plane": {
      "get": {
        "tags": [
          "dataplane"
        ],
        "summary": "Get Data Plane",
        "description": "The workspace database: state, DDL version, size and quota, this month's loads (Builder and above).",
        "operationId": "get_data_plane_api_v1_workspaces__workspace_id__data_plane_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataPlaneOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/data-plane/tables": {
      "get": {
        "tags": [
          "dataplane"
        ],
        "summary": "List Tables",
        "description": "Our warehouse: schemas, tables, columns and estimated rows (from the catalog, never the data itself).",
        "operationId": "list_tables_api_v1_workspaces__workspace_id__data_plane_tables_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataPlaneTablesOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/quota": {
      "get": {
        "tags": [
          "dataplane"
        ],
        "summary": "Get Quota",
        "description": "Load limits: this month's rows and GB, warehouse size, the 80% / 100% level and the waiting loads.",
        "operationId": "get_quota_api_v1_workspaces__workspace_id__quota_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotaOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `capacity.view`: admin, owner.",
          "capabilities": [
            "capacity.view"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/sources": {
      "get": {
        "tags": [
          "sources"
        ],
        "summary": "List Sources",
        "description": "Sources (developer mode `/dev/sources`): state, last load, the `raw_<slug>` schema.",
        "operationId": "list_sources_api_v1_workspaces__workspace_id__sources_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "asc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "slug",
                "updated_at"
              ],
              "type": "string",
              "default": "slug",
              "title": "Sort"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SourceStatus"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SourceOrigin"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Origin"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "post": {
        "tags": [
          "sources"
        ],
        "summary": "Create Source",
        "description": "`source.yml` is written into a new change request; a host typed into the form is approved by this same submit.",
        "operationId": "create_source_api_v1_workspaces__workspace_id__sources_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceCreatedOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `source.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "source.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/sources/uploads/files": {
      "post": {
        "tags": [
          "sources"
        ],
        "summary": "Upload File",
        "description": "Excel or CSV upload: type, signature, size and quota are checked on the server; the file goes to storage and is parsed inside the ingest run.",
        "operationId": "upload_file_api_v1_workspaces__workspace_id__sources_uploads_files_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BodyUploadFileApiV1Workspacessources_uploads_files_post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceFileOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `source.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "source.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/sources/{slug}": {
      "get": {
        "tags": [
          "sources"
        ],
        "summary": "Get Source",
        "description": "A source: settings (secrets by name only), resources, egress rules and the last inspect snapshot.",
        "operationId": "get_source_api_v1_workspaces__workspace_id__sources__slug__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/sources/{slug}/runs": {
      "post": {
        "tags": [
          "sources"
        ],
        "summary": "Start Run",
        "description": "A manual load or backfill; a worker does the work (202), its state is at `GET /sources/{slug}/runs`.",
        "operationId": "start_run_api_v1_workspaces__workspace_id__sources__slug__runs_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunCreateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourcesRunOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `source.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "source.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "get": {
        "tags": [
          "sources"
        ],
        "summary": "List Runs",
        "operationId": "list_runs_api_v1_workspaces__workspace_id__sources__slug__runs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "created_at",
              "type": "string",
              "default": "created_at",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourcesRunListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/sources/{slug}/files": {
      "get": {
        "tags": [
          "sources"
        ],
        "summary": "List Files",
        "description": "The source's files: loaded, queued, or why they are not loaded; the per-file limit (MB) and the waiting files.",
        "operationId": "list_files_api_v1_workspaces__workspace_id__sources__slug__files_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "created_at",
              "type": "string",
              "default": "created_at",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceFileListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/sources/{slug}/files/{file_id}": {
      "delete": {
        "tags": [
          "sources"
        ],
        "summary": "Remove File",
        "description": "Removes the file from the source (audited); rows loaded from it stay in the warehouse, see `kept` in the response.",
        "operationId": "remove_file_api_v1_workspaces__workspace_id__sources__slug__files__file_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$",
              "title": "Slug"
            }
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "File Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceFileRemovedOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `source.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "source.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/sources/{slug}/inspect": {
      "post": {
        "tags": [
          "sources"
        ],
        "summary": "Inspect Source",
        "description": "Inspects the source (an `inspect` run): its structure and an aggregate profile are saved as the source's latest snapshot.",
        "operationId": "inspect_source_api_v1_workspaces__workspace_id__sources__slug__inspect_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourcesRunOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `source.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "source.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/sources/{slug}/egress": {
      "get": {
        "tags": [
          "sources"
        ],
        "summary": "List Egress",
        "operationId": "list_egress_api_v1_workspaces__workspace_id__sources__slug__egress_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EgressListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/sources/{slug}/egress/{rule_id}/approve": {
      "post": {
        "tags": [
          "sources"
        ],
        "summary": "Approve Egress",
        "description": "Approves a pending host; Admin and Owner only (`change.approve_access`).",
        "operationId": "approve_egress_api_v1_workspaces__workspace_id__sources__slug__egress__rule_id__approve_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$",
              "title": "Slug"
            }
          },
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Rule Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EgressRuleOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.approve_access`: admin, owner.",
          "capabilities": [
            "change.approve_access"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/packages": {
      "get": {
        "tags": [
          "packages"
        ],
        "summary": "List Packages",
        "description": "Published packages in the registry: the settings schema for the Connect form, secret names and the install state.",
        "operationId": "list_packages_api_v1_workspaces__workspace_id__packages_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "asc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "key",
              "type": "string",
              "default": "key",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackageListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `package.manage`: builder, admin, owner.",
          "capabilities": [
            "package.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/package-installs": {
      "get": {
        "tags": [
          "packages"
        ],
        "summary": "List Installs",
        "operationId": "list_installs_api_v1_workspaces__workspace_id__package_installs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "created_at",
              "type": "string",
              "default": "created_at",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `package.manage`: builder, admin, owner.",
          "capabilities": [
            "package.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "post": {
        "tags": [
          "packages"
        ],
        "summary": "Install Package",
        "description": "Installing opens a `package_install` change request; the approval of the person who clicked is recorded on it.",
        "operationId": "install_package_api_v1_workspaces__workspace_id__package_installs_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallResultOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.create`, `package.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "change.create",
            "package.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/package-installs/{install_id}": {
      "get": {
        "tags": [
          "packages"
        ],
        "summary": "Get Install",
        "operationId": "get_install_api_v1_workspaces__workspace_id__package_installs__install_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "install_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Install Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `package.manage`: builder, admin, owner.",
          "capabilities": [
            "package.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/package-installs/{install_id}/upgrade": {
      "post": {
        "tags": [
          "packages"
        ],
        "summary": "Upgrade Package",
        "description": "An upgrade is a `package_upgrade` change request: managed files are replaced, customisations stay, a person approves.",
        "operationId": "upgrade_package_api_v1_workspaces__workspace_id__package_installs__install_id__upgrade_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "install_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Install Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallResultOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.create`, `package.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "change.create",
            "package.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/package-installs/{install_id}/eject": {
      "post": {
        "tags": [
          "packages"
        ],
        "summary": "Eject File",
        "description": "The managed file becomes a workspace file (audited); later upgrades no longer touch it.",
        "operationId": "eject_file_api_v1_workspaces__workspace_id__package_installs__install_id__eject_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "install_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Install Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EjectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EjectResultOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.create`, `package.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "change.create",
            "package.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/package-installs/{install_id}/uninstall-preview": {
      "get": {
        "tags": [
          "packages"
        ],
        "summary": "Uninstall Preview",
        "description": "Before a removal (Admin and Owner): how many dashboards and deliveries go with the connection and what stands in the way.",
        "operationId": "uninstall_preview_api_v1_workspaces__workspace_id__package_installs__install_id__uninstall_preview_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "install_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Install Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UninstallPreviewOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`, `change.create`: admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "access.manage",
            "change.create"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/package-installs/{install_id}/uninstall": {
      "post": {
        "tags": [
          "packages"
        ],
        "summary": "Uninstall Package",
        "description": "Admin and Owner: remove a connection through a change request — the package's content and source; its keys are deleted when the change deploys, loaded data stays. Dependent dashboards need `force`. The Owner approves.",
        "operationId": "uninstall_package_api_v1_workspaces__workspace_id__package_installs__install_id__uninstall_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "install_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Install Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UninstallRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UninstallResultOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`, `change.create`: admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "access.manage",
            "change.create"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/marketplace": {
      "get": {
        "tags": [
          "marketplace"
        ],
        "summary": "List Cards",
        "description": "Packages visible to the workspace plan: search, category, what each gives, publisher, approval, installed or not.",
        "operationId": "list_cards_api_v1_workspaces__workspace_id__marketplace_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "asc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "featured",
                "title"
              ],
              "type": "string",
              "default": "featured",
              "title": "Sort"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/PackageCategory"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Category"
            }
          },
          {
            "name": "provides",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Provides"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Provides"
            }
          },
          {
            "name": "publisher",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/PublisherKind"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Publisher"
            }
          },
          {
            "name": "verified",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Verified"
            }
          },
          {
            "name": "installed",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Installed"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackageCardListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `package.manage`: builder, admin, owner.",
          "capabilities": [
            "package.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/marketplace/connections": {
      "get": {
        "tags": [
          "marketplace"
        ],
        "summary": "Connections",
        "description": "The Connections table: installed packages with their state (working, failed, pending), last sync, a short count and the problem in plain words; every member can read it.",
        "operationId": "connections_api_v1_workspaces__workspace_id__marketplace_connections_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}": {
      "get": {
        "tags": [
          "marketplace"
        ],
        "summary": "Package Detail",
        "operationId": "package_detail_api_v1_workspaces__workspace_id__marketplace_packages__scope___name__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,31}$",
              "title": "Scope"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,62}$",
              "title": "Name"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackageDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `package.manage`: builder, admin, owner.",
          "capabilities": [
            "package.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/install": {
      "post": {
        "tags": [
          "marketplace"
        ],
        "summary": "Install",
        "description": "A `package_install` change request with the approval of the person who clicked, never straight to `main`.",
        "operationId": "install_api_v1_workspaces__workspace_id__marketplace_packages__scope___name__install_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,31}$",
              "title": "Scope"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,62}$",
              "title": "Name"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketplaceInstallRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallResultOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.create`, `package.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "change.create",
            "package.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/connection": {
      "get": {
        "tags": [
          "marketplace"
        ],
        "summary": "Connection",
        "description": "Connection state: install, last test, last load with progress, settings, the last five loads and the file templates.",
        "operationId": "connection_api_v1_workspaces__workspace_id__marketplace_packages__scope___name__connection_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,31}$",
              "title": "Scope"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,62}$",
              "title": "Name"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `package.manage`: builder, admin, owner.",
          "capabilities": [
            "package.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/connection/test": {
      "post": {
        "tags": [
          "marketplace"
        ],
        "summary": "Test Connection",
        "description": "\"Test the connection\": the connector's probe through the existing `inspect` run; the result shows in `GET .../connection`.",
        "operationId": "test_connection_api_v1_workspaces__workspace_id__marketplace_packages__scope___name__connection_test_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,31}$",
              "title": "Scope"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,62}$",
              "title": "Name"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `package.manage`, `source.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "package.manage",
            "source.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/connection/pause": {
      "post": {
        "tags": [
          "marketplace"
        ],
        "summary": "Pause Connection",
        "description": "Pause loading: the schedule does not fire, queued loads are cancelled and a running one stops within 5 seconds.",
        "operationId": "pause_connection_api_v1_workspaces__workspace_id__marketplace_packages__scope___name__connection_pause_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,31}$",
              "title": "Scope"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,62}$",
              "title": "Name"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `package.manage`, `source.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "package.manage",
            "source.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/connection/resume": {
      "post": {
        "tags": [
          "marketplace"
        ],
        "summary": "Resume Connection",
        "description": "Leave the pause: a load starts at once and also fetches the days in between.",
        "operationId": "resume_connection_api_v1_workspaces__workspace_id__marketplace_packages__scope___name__connection_resume_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,31}$",
              "title": "Scope"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,62}$",
              "title": "Name"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `package.manage`, `source.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "package.manage",
            "source.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/connection/refresh": {
      "put": {
        "tags": [
          "marketplace"
        ],
        "summary": "Set Refresh",
        "description": "The refresh: an interval or days and times, not faster than the plan allows; both `null` is the default schedule.",
        "operationId": "set_refresh_api_v1_workspaces__workspace_id__marketplace_packages__scope___name__connection_refresh_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,31}$",
              "title": "Scope"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,62}$",
              "title": "Name"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceRefreshIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `package.manage`, `source.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "package.manage",
            "source.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/files": {
      "post": {
        "tags": [
          "marketplace"
        ],
        "summary": "Upload File",
        "description": "Excel/CSV upload against the package template: the file joins the package source and a load starts.",
        "operationId": "upload_file_api_v1_workspaces__workspace_id__marketplace_packages__scope___name__files_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,31}$",
              "title": "Scope"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,62}$",
              "title": "Name"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BodyUploadFileApiV1Workspacesfiles_post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `package.manage`, `source.manage`: builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "package.manage",
            "source.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/templates/{table}": {
      "get": {
        "tags": [
          "marketplace"
        ],
        "summary": "Download Template",
        "description": "Download the Excel template, headers in the chosen language.",
        "operationId": "download_template_api_v1_workspaces__workspace_id__marketplace_packages__scope___name__templates__table__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Table"
            }
          },
          {
            "name": "scope",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,31}$",
              "title": "Scope"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,62}$",
              "title": "Name"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Locale"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The package's Excel template, headers in the chosen language, as an attachment (`<table>-<locale>.xlsx`).",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `package.manage`: builder, admin, owner.",
          "capabilities": [
            "package.manage"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/explore/queries": {
      "post": {
        "tags": [
          "explore"
        ],
        "summary": "Run Explore Query",
        "description": "Exploration SQL (developer mode): one read-only query, checked before it runs and run with the workspace's read-only access.",
        "operationId": "run_explore_query_api_v1_workspaces__workspace_id__explore_queries_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExploreQueryIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExploreQueryOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `explore.sql`: builder, admin, owner. Plan feature `semantic_layers` must be on.",
          "capabilities": [
            "explore.sql"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "semantic_layers"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards": {
      "get": {
        "tags": [
          "dashboards"
        ],
        "summary": "List Dashboards",
        "description": "Dashboards this person can see (by `access:`), starters included; paged with a cursor.",
        "operationId": "list_dashboards_api_v1_workspaces__workspace_id__dashboards_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      },
      "post": {
        "tags": [
          "dashboards"
        ],
        "summary": "Create Dashboard",
        "description": "An empty dashboard: `content/dashboards/<slug>.yml` in one content commit (the slug comes from the title).",
        "operationId": "create_dashboard_api_v1_workspaces__workspace_id__dashboards_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardCreateIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardsDashboardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards/{slug}": {
      "get": {
        "tags": [
          "dashboards"
        ],
        "summary": "Get Dashboard",
        "description": "Tiles, filters and refresh state; the numbers come from each tile's own `…/data` request.",
        "operationId": "get_dashboard_api_v1_workspaces__workspace_id__dashboards__slug__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardsDashboardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      },
      "patch": {
        "tags": [
          "dashboards"
        ],
        "summary": "Update Dashboard",
        "description": "Title, filters, layout and access, with `expected_version` (409 means reload); an access change goes through a CR.",
        "operationId": "update_dashboard_api_v1_workspaces__workspace_id__dashboards__slug__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardPatchIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardsDashboardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      },
      "delete": {
        "tags": [
          "dashboards"
        ],
        "summary": "Delete Dashboard",
        "operationId": "delete_dashboard_api_v1_workspaces__workspace_id__dashboards__slug__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards/{slug}/charts": {
      "post": {
        "tags": [
          "dashboards"
        ],
        "summary": "Add Chart",
        "description": "Saves a chart from chat `{message_id, block_index}` or adds an existing chart `{chart}`; already there: 200 with `added: false`.",
        "operationId": "add_chart_api_v1_workspaces__workspace_id__dashboards__slug__charts_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChartAddIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChartSavedOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards/{slug}/charts/{chart}": {
      "patch": {
        "tags": [
          "dashboards"
        ],
        "summary": "Update Chart",
        "operationId": "update_chart_api_v1_workspaces__workspace_id__dashboards__slug__charts__chart__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "chart",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Chart"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChartPatchIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardsDashboardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      },
      "delete": {
        "tags": [
          "dashboards"
        ],
        "summary": "Remove Chart",
        "description": "Removes the tile; the chart's file is deleted too when no other dashboard uses it.",
        "operationId": "remove_chart_api_v1_workspaces__workspace_id__dashboards__slug__charts__chart__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "chart",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Chart"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "expected_version",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 2147483647,
              "minimum": 1,
              "title": "Expected Version"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardsDashboardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards/{slug}/charts/{chart}/data": {
      "post": {
        "tags": [
          "dashboards"
        ],
        "summary": "Tile Data",
        "description": "A tile's numbers on behalf of this person, with the filters; a chart without `sql` answers `recreate`, a failure `error`.",
        "operationId": "tile_data_api_v1_workspaces__workspace_id__dashboards__slug__charts__chart__data_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "chart",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Chart"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TileDataIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TileDataOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards/{slug}/filters/{filter_id}/values": {
      "get": {
        "tags": [
          "dashboards"
        ],
        "summary": "Filter Values",
        "description": "Filter choices: the column's values on behalf of this person (the row scope narrows the choices too).",
        "operationId": "filter_values_api_v1_workspaces__workspace_id__dashboards__slug__filters__filter_id__values_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "filter_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Filter Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Locale",
              "default": "uz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterValuesOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards/{slug}/refresh-settings": {
      "put": {
        "tags": [
          "dashboards"
        ],
        "summary": "Refresh Settings",
        "description": "Refresh on new data, on a schedule or by hand; live mode uses the shortest interval of the tariff.",
        "operationId": "refresh_settings_api_v1_workspaces__workspace_id__dashboards__slug__refresh_settings_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshSettingsIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards/{slug}/refresh": {
      "post": {
        "tags": [
          "dashboards"
        ],
        "summary": "Refresh Now",
        "description": "Refresh now: the tiles are recomputed when next opened (at most once a minute).",
        "operationId": "refresh_now_api_v1_workspaces__workspace_id__dashboards__slug__refresh_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats": {
      "get": {
        "tags": [
          "chats"
        ],
        "summary": "List Chats",
        "description": "This person's chats, most recently changed first, each with its active run (if any).",
        "operationId": "list_chats_api_v1_workspaces__workspace_id__chats_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "updated_at",
              "type": "string",
              "default": "updated_at",
              "title": "Sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "post": {
        "tags": [
          "chats"
        ],
        "summary": "Create Chat",
        "description": "A new chat; a `model_id` must be one of the open models (else 422 `model_unavailable`).",
        "operationId": "create_chat_api_v1_workspaces__workspace_id__chats_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/models": {
      "get": {
        "tags": [
          "chats"
        ],
        "summary": "List Models",
        "description": "For the composer: selectable AI models (open or closed, with the reason `no_key`, `plan` or `legacy`) and the file attachment rule.",
        "operationId": "list_models_api_v1_workspaces__workspace_id__chats_models_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatModelsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/skills": {
      "get": {
        "tags": [
          "chats"
        ],
        "summary": "List Skills",
        "description": "Ready analyses (`/why`, `/top`, …) open to the caller, whether each can run and on which sources; empty when the feature is off.",
        "operationId": "list_skills_api_v1_workspaces__workspace_id__chats_skills_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/preferences": {
      "get": {
        "tags": [
          "chats"
        ],
        "summary": "Chat Preferences",
        "description": "The caller's chat settings: `answer_details` shows per-answer details (off by default).",
        "operationId": "chat_preferences_api_v1_workspaces__workspace_id__chats_preferences_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatPreferencesOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "put": {
        "tags": [
          "chats"
        ],
        "summary": "Save Chat Preferences",
        "operationId": "save_chat_preferences_api_v1_workspaces__workspace_id__chats_preferences_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatPreferencesIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatPreferencesOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/{chat_id}": {
      "get": {
        "tags": [
          "chats"
        ],
        "summary": "Get Chat",
        "description": "The chat and its last `limit` messages (20–200); `has_more` when older ones exist, read them with `before` from `GET …/messages`.",
        "operationId": "get_chat_api_v1_workspaces__workspace_id__chats__chat_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Chat Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 20,
              "default": 200,
              "title": "Limit"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Locale"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Locale"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "patch": {
        "tags": [
          "chats"
        ],
        "summary": "Update Chat",
        "description": "The chat's name (`title`) and/or model (`model_id`: an open model or `null` for the standard tier); owner only.",
        "operationId": "update_chat_api_v1_workspaces__workspace_id__chats__chat_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Chat Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "delete": {
        "tags": [
          "chats"
        ],
        "summary": "Delete Chat",
        "operationId": "delete_chat_api_v1_workspaces__workspace_id__chats__chat_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Chat Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/{chat_id}/messages": {
      "get": {
        "tags": [
          "chats"
        ],
        "summary": "List Messages",
        "description": "Older messages: the `limit` (at most 100) before `before`, oldest first, with their steps and reasons.",
        "operationId": "list_messages_api_v1_workspaces__workspace_id__chats__chat_id__messages_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Chat Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 9223372036854775807,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "title": "Before"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Locale"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Locale"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagePageOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "post": {
        "tags": [
          "chats"
        ],
        "summary": "Post Message",
        "description": "A message, a button choice or a form answer: a run is queued (a new one, or the continuation of a waiting run), 202 with `run_id`.",
        "operationId": "post_message_api_v1_workspaces__workspace_id__chats__chat_id__messages_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Chat Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageIn"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptedOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/{chat_id}/messages/{message_id}/details": {
      "get": {
        "tags": [
          "chats"
        ],
        "summary": "Answer Details",
        "description": "One answer's details: steps (model and tool, with their time), model, rounds, tokens and price; 403 while the setting is off.",
        "operationId": "answer_details_api_v1_workspaces__workspace_id__chats__chat_id__messages__message_id__details_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Chat Id"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Message Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswerDetailsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/{chat_id}/share": {
      "post": {
        "tags": [
          "chats"
        ],
        "summary": "Share Chat",
        "description": "Share the chat: a member of this workspace who opens the link reads it only (`read_only`); owner only.",
        "operationId": "share_chat_api_v1_workspaces__workspace_id__chats__chat_id__share_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Chat Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "delete": {
        "tags": [
          "chats"
        ],
        "summary": "Unshare Chat",
        "description": "Stop sharing: the chat is a 404 again for other members; owner only.",
        "operationId": "unshare_chat_api_v1_workspaces__workspace_id__chats__chat_id__share_delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Chat Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/{chat_id}/runs/{run_id}/events": {
      "get": {
        "tags": [
          "chats"
        ],
        "summary": "Run Events",
        "description": "SSE: `start`, `progress`, `text`, `tool_call`, `tool_result`, `element`, `status`, `final`, `error`, `speech`.",
        "operationId": "run_events_api_v1_workspaces__workspace_id__chats__chat_id__runs__run_id__events_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Chat Id"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Run Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 9223372036854775807,
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "title": "After"
            }
          },
          {
            "name": "last-event-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 20
                },
                {
                  "type": "null"
                }
              ],
              "title": "Last-Event-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Server-sent events of the run, from `start` to `final` or `error`.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/{chat_id}/runs/{run_id}/cancel": {
      "post": {
        "tags": [
          "chats"
        ],
        "summary": "Cancel Run",
        "operationId": "cancel_run_api_v1_workspaces__workspace_id__chats__chat_id__runs__run_id__cancel_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Chat Id"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Run Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/notes": {
      "post": {
        "tags": [
          "chats"
        ],
        "summary": "Save Note",
        "description": "Free feedback to Databek (1–1000 characters): 10 a day, more is 429 `note_limit`.",
        "operationId": "save_note_api_v1_workspaces__workspace_id__chats_notes_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/{chat_id}/messages/{message_id}/feedback": {
      "put": {
        "tags": [
          "chats"
        ],
        "summary": "Save Feedback",
        "description": "Rate an answer (`up`/`down`, a reason with `down`, a note up to 500 characters): sending again replaces the rating; not an answer is 404.",
        "operationId": "save_feedback_api_v1_workspaces__workspace_id__chats__chat_id__messages__message_id__feedback_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Chat Id"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Message Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "delete": {
        "tags": [
          "chats"
        ],
        "summary": "Clear Feedback",
        "description": "Remove the rating; 204 also when the answer has none.",
        "operationId": "clear_feedback_api_v1_workspaces__workspace_id__chats__chat_id__messages__message_id__feedback_delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Chat Id"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Message Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/voice": {
      "post": {
        "tags": [
          "voice"
        ],
        "summary": "Transcribe New",
        "description": "A spoken first question for a new chat (WAV 16 kHz mono, up to 60 s and 2 MB) turned into text; the recording is not stored.",
        "operationId": "transcribe_new_api_v1_workspaces__workspace_id__chats_voice_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BodyTranscribeNewApiV1Workspaceschats_voice_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/{chat_id}/voice": {
      "post": {
        "tags": [
          "voice"
        ],
        "summary": "Transcribe",
        "description": "A spoken question turned into text (language hint from the chat); when no speech is heard `text` is empty, which is not an error.",
        "operationId": "transcribe_api_v1_workspaces__workspace_id__chats__chat_id__voice_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(?:[0-9]{1,19}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
              "title": "Chat Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BodyTranscribeApiV1Workspacesvoice_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/{chat_id}/messages/{message_id}/speech": {
      "post": {
        "tags": [
          "voice"
        ],
        "summary": "Speak",
        "description": "Read an answer aloud: 200 when the audio is ready, otherwise it is queued and the answer is 202 `pending`.",
        "operationId": "speak_api_v1_workspaces__workspace_id__chats__chat_id__messages__message_id__speech_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Message Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(?:[0-9]{1,19}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
              "title": "Chat Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeechOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/{chat_id}/messages/{message_id}/speech/audio": {
      "get": {
        "tags": [
          "voice"
        ],
        "summary": "Speech Audio",
        "description": "The finished spoken answer (WAV 16 kHz), or 202 `pending` while it is still being prepared (the web waits on it).",
        "operationId": "speech_audio_api_v1_workspaces__workspace_id__chats__chat_id__messages__message_id__speech_audio_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Message Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "chat_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(?:[0-9]{1,19}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
              "title": "Chat Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The spoken answer as a 16 kHz WAV file (`private, no-store`).",
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "The speech is not ready yet; ask again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpeechOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/settings/voice": {
      "get": {
        "tags": [
          "voice"
        ],
        "summary": "Voice Settings",
        "description": "The workspace voice settings: the microphone button reads `enabled` from here (every member), with the lists of choices.",
        "operationId": "voice_settings_api_v1_workspaces__workspace_id__settings_voice_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceSettingsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "patch": {
        "tags": [
          "voice"
        ],
        "summary": "Update Voice Settings",
        "description": "Admin: switch voice on or off, pick the speech-to-text and text-to-speech providers, the voice and the daily minutes (`clear_daily_minutes` removes the limit).",
        "operationId": "update_voice_settings_api_v1_workspaces__workspace_id__settings_voice_patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceSettingsIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceSettingsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `ai.instructions.manage`: admin, owner.",
          "capabilities": [
            "ai.instructions.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/settings/voice/samples": {
      "post": {
        "tags": [
          "voice"
        ],
        "summary": "Voice Sample",
        "description": "A voice sample (WAV): one sentence, charged to the workspace once and served from the cache afterwards.",
        "operationId": "voice_sample_api_v1_workspaces__workspace_id__settings_voice_samples_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceSampleIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One sample sentence in the chosen voice, as a WAV file.",
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `ai.instructions.manage`: admin, owner.",
          "capabilities": [
            "ai.instructions.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/uploads": {
      "post": {
        "tags": [
          "documents"
        ],
        "summary": "Add Document",
        "description": "Attach a document to the person's own chat: PDF (up to 10 pages), JPG/PNG/WEBP images, CSV/TXT lists and Excel (xlsx) workbooks.",
        "operationId": "add_document_api_v1_workspaces__workspace_id__chats_uploads_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BodyAddDocumentApiV1Workspaceschats_uploads_post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUploadOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/documents/{document_id}": {
      "get": {
        "tags": [
          "documents"
        ],
        "summary": "Get Document",
        "description": "A read document: rows, confidence, checks and the total, for the row-fixing drawer.",
        "operationId": "get_document_api_v1_workspaces__workspace_id__chats_documents__document_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "document_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Document Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/documents/{document_id}/image": {
      "get": {
        "tags": [
          "documents"
        ],
        "summary": "Document Image",
        "description": "A sent picture (PNG, JPEG, WebP) of a chat the caller may read, `inline` and `private, no-store`; not a picture, expired or someone else's — 404 `document_not_found`.",
        "operationId": "document_image_api_v1_workspaces__workspace_id__chats_documents__document_id__image_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "document_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Document Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The picture",
            "content": {
              "image/*": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/chats/documents/{document_id}/rows/{line}": {
      "patch": {
        "tags": [
          "documents"
        ],
        "summary": "Fix Row",
        "description": "Fix a misread row: only the sent fields change, the checks run again and the row becomes verified.",
        "operationId": "fix_row_api_v1_workspaces__workspace_id__chats_documents__document_id__rows__line__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "document_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Document Id"
            }
          },
          {
            "name": "line",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 2000,
              "minimum": 1,
              "title": "Line"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentRowPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDetailOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/me/telegram/link-codes": {
      "post": {
        "tags": [
          "delivery"
        ],
        "summary": "Create Link Code",
        "description": "A one-time `t.me/<bot>?start=<code>` link (15 minutes); earlier unused codes stop working.",
        "operationId": "create_link_code_api_v1_me_telegram_link_codes_post",
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramLinkCodeOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/me/telegram": {
      "get": {
        "tags": [
          "delivery"
        ],
        "summary": "Telegram Status",
        "operationId": "telegram_status_api_v1_me_telegram_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TelegramStatusOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/me/telegram/{link_id}": {
      "delete": {
        "tags": [
          "delivery"
        ],
        "summary": "Unlink Telegram",
        "operationId": "unlink_telegram_api_v1_me_telegram__link_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "link_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Link Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards/{slug}/deliveries": {
      "get": {
        "tags": [
          "delivery"
        ],
        "summary": "List Deliveries",
        "description": "The dashboard's deliveries and the caller's own subscription; a dashboard the caller cannot see answers 404.",
        "operationId": "list_deliveries_api_v1_workspaces__workspace_id__dashboards__slug__deliveries_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. One of the plan features `email_delivery`, `telegram_delivery` must be on.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ],
          "features_any": [
            "email_delivery",
            "telegram_delivery"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards/{slug}/deliveries/{key}": {
      "put": {
        "tags": [
          "delivery"
        ],
        "summary": "Put Delivery",
        "operationId": "put_delivery_api_v1_workspaces__workspace_id__dashboards__slug__deliveries__key__put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Key"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveryIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliverySavedOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. One of the plan features `email_delivery`, `telegram_delivery` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features_any": [
            "email_delivery",
            "telegram_delivery"
          ]
        }
      },
      "delete": {
        "tags": [
          "delivery"
        ],
        "summary": "Delete Delivery",
        "operationId": "delete_delivery_api_v1_workspaces__workspace_id__dashboards__slug__deliveries__key__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Key"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliverySavedOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. One of the plan features `email_delivery`, `telegram_delivery` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features_any": [
            "email_delivery",
            "telegram_delivery"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards/{slug}/deliveries/{key}/test": {
      "post": {
        "tags": [
          "delivery"
        ],
        "summary": "Test Delivery",
        "description": "The test goes to the caller only; when it cannot arrive, 409 with the reason in `code` (nothing is queued).",
        "operationId": "test_delivery_api_v1_workspaces__workspace_id__dashboards__slug__deliveries__key__test_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Key"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryTestOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. One of the plan features `email_delivery`, `telegram_delivery` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features_any": [
            "email_delivery",
            "telegram_delivery"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards/{slug}/deliveries/{key}/subscription": {
      "put": {
        "tags": [
          "delivery"
        ],
        "summary": "Put Subscription",
        "description": "The caller's own subscription: joins or leaves the file's recipient list (no commit).",
        "operationId": "put_subscription_api_v1_workspaces__workspace_id__dashboards__slug__deliveries__key__subscription_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Key"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubscriptionIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `delivery.subscribe_self`: viewer, builder, admin, owner. One of the plan features `email_delivery`, `telegram_delivery` must be on.",
          "capabilities": [
            "delivery.subscribe_self"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ],
          "features_any": [
            "email_delivery",
            "telegram_delivery"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/daily-cards": {
      "post": {
        "tags": [
          "delivery"
        ],
        "summary": "Daily Card",
        "description": "An answer card every day at this hour to the Telegram of whoever pressed: the card's dashboard and a `daily` delivery.",
        "operationId": "daily_card_api_v1_workspaces__workspace_id__daily_cards_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DailyCardIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DailyCardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. One of the plan features `email_delivery`, `telegram_delivery` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features_any": [
            "email_delivery",
            "telegram_delivery"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/delivery-runs": {
      "get": {
        "tags": [
          "delivery"
        ],
        "summary": "List Delivery Runs",
        "operationId": "list_delivery_runs_api_v1_workspaces__workspace_id__delivery_runs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "const": "created_at",
              "type": "string",
              "default": "created_at",
              "title": "Sort"
            }
          },
          {
            "name": "dashboard",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,62}$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Dashboard"
            }
          },
          {
            "name": "delivery",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,62}$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Delivery"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/DeliveryRunStatus"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryRunListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `content.edit`: builder, admin, owner. Stays open while the workspace is stopped. One of the plan features `email_delivery`, `telegram_delivery` must be on.",
          "capabilities": [
            "content.edit"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features_any": [
            "email_delivery",
            "telegram_delivery"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/dashboards/{slug}/pdf": {
      "post": {
        "tags": [
          "delivery"
        ],
        "summary": "Request Pdf",
        "description": "Queues a PDF with the page's filters and language, on behalf of the requester; its state is at `GET …/pdf-exports/{id}`.",
        "operationId": "request_pdf_api_v1_workspaces__workspace_id__dashboards__slug__pdf_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 63,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Slug"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfExportIn"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfExportOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/pdf-exports/{export_id}": {
      "get": {
        "tags": [
          "delivery"
        ],
        "summary": "Pdf Status",
        "operationId": "pdf_status_api_v1_workspaces__workspace_id__pdf_exports__export_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "export_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "title": "Export Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfExportOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/pdf-exports/{export_id}/file": {
      "get": {
        "tags": [
          "delivery"
        ],
        "summary": "Pdf File",
        "operationId": "pdf_file_api_v1_workspaces__workspace_id__pdf_exports__export_id__file_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "export_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "title": "Export Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The dashboard PDF, as an attachment (`<dashboard>-<date>.pdf`).",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "dashboards"
          ]
        }
      }
    },
    "/api/v1/email/unsubscribe/{token}": {
      "get": {
        "tags": [
          "delivery"
        ],
        "summary": "Describe Unsubscribe",
        "description": "What the link unsubscribes from (dashboard and workspace name); nothing changes, since mail scanners open links too.",
        "operationId": "describe_unsubscribe_api_v1_email_unsubscribe__token__get",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{8,96}\\.[A-Za-z0-9_-]{22}$",
              "title": "Token"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Locale",
              "default": "uz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnsubscribeOut"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      },
      "post": {
        "tags": [
          "delivery"
        ],
        "summary": "Unsubscribe",
        "description": "RFC 8058 one-click (`List-Unsubscribe=One-Click`) and the button on the web page: `opt_out` from this delivery.",
        "operationId": "unsubscribe_api_v1_email_unsubscribe__token__post",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{8,96}\\.[A-Za-z0-9_-]{22}$",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnsubscribeOut"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/git-sync": {
      "get": {
        "tags": [
          "git-sync"
        ],
        "summary": "Git Sync Status",
        "description": "The linked repository, export and import state, last sync, error and webhook address (developer mode).",
        "operationId": "git_sync_status_api_v1_workspaces__workspace_id__git_sync_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitSyncOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dev_mode`: builder, admin, owner. Plan feature `git_sync` must be on.",
          "capabilities": [
            "dev_mode"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "git_sync"
          ]
        }
      },
      "put": {
        "tags": [
          "git-sync"
        ],
        "summary": "Connect Git Sync",
        "description": "Links a repository: the token goes to the secret store, the first sync is queued; the webhook secret is in this response only.",
        "operationId": "connect_git_sync_api_v1_workspaces__workspace_id__git_sync_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GitSyncConnectIn"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitSyncConnectedOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `git_sync` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "git_sync"
          ]
        }
      },
      "delete": {
        "tags": [
          "git-sync"
        ],
        "summary": "Disconnect Git Sync",
        "operationId": "disconnect_git_sync_api_v1_workspaces__workspace_id__git_sync_delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `git_sync` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "git_sync"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/git-sync/sync": {
      "post": {
        "tags": [
          "git-sync"
        ],
        "summary": "Sync Now",
        "operationId": "sync_now_api_v1_workspaces__workspace_id__git_sync_sync_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitSyncOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `change.create`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `git_sync` must be on.",
          "capabilities": [
            "change.create"
          ],
          "roles": [
            "builder",
            "admin",
            "owner"
          ],
          "features": [
            "git_sync"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/git-sync/resolve": {
      "post": {
        "tags": [
          "git-sync"
        ],
        "summary": "Resolve Divergence",
        "description": "Force-writes `main` over an external branch that diverged (audited).",
        "operationId": "resolve_divergence_api_v1_workspaces__workspace_id__git_sync_resolve_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveIn"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitSyncOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `git_sync` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "git_sync"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/git-sync/webhook-secret": {
      "post": {
        "tags": [
          "git-sync"
        ],
        "summary": "Rotate Webhook Secret",
        "operationId": "rotate_webhook_secret_api_v1_workspaces__workspace_id__git_sync_webhook_secret_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `git_sync` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "git_sync"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/git-sync/webhook": {
      "post": {
        "tags": [
          "git-sync"
        ],
        "summary": "Receive Webhook",
        "description": "Open: signed with GitHub `X-Hub-Signature-256` or GitLab `X-Gitlab-Token`; unsigned answers 401, not linked 404.",
        "operationId": "receive_webhook_api_v1_workspaces__workspace_id__git_sync_webhook_post",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9223372036854775807,
              "minimum": 1,
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookOut"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "public",
          "summary": "Public: no token."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/git-sync/github/install": {
      "post": {
        "tags": [
          "git-sync"
        ],
        "summary": "Github Install",
        "description": "\"Connect with GitHub\": the App install link; `state` is bound to this workspace and this person (30 minutes).",
        "operationId": "github_install_api_v1_workspaces__workspace_id__git_sync_github_install_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitHubInstallOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `git_sync` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "git_sync"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/git-sync/github/repositories": {
      "post": {
        "tags": [
          "git-sync"
        ],
        "summary": "Github Repositories",
        "description": "Repositories of the verified installation (with the installation token); 404 when the grant belongs to another workspace.",
        "operationId": "github_repositories_api_v1_workspaces__workspace_id__git_sync_github_repositories_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GitHubRepositoriesIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitHubRepositoriesOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `git_sync` must be on.",
          "capabilities": [
            "access.manage"
          ],
          "roles": [
            "admin",
            "owner"
          ],
          "features": [
            "git_sync"
          ]
        }
      }
    },
    "/api/v1/git-sync/github/setup": {
      "post": {
        "tags": [
          "git-sync"
        ],
        "summary": "Github Setup",
        "description": "Back from GitHub: `state` is checked (membership, Admin), then comes an OAuth link that proves who owns the installation.",
        "operationId": "github_setup_api_v1_git_sync_github_setup_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GitHubSetupIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitHubSetupOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user. The workspace named in the signed `state` must be one the caller is a member of with `access.manage` (admin, owner), its trial not ended and the `git_sync` plan feature on."
        }
      }
    },
    "/api/v1/git-sync/github/callback": {
      "post": {
        "tags": [
          "git-sync"
        ],
        "summary": "Github Callback",
        "description": "The OAuth code: when the installation is visible to this GitHub user, a grant to choose repositories (30 minutes).",
        "operationId": "github_callback_api_v1_git_sync_github_callback_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GitHubCallbackIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitHubGrantOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDeniedFeatureDisabled"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "x-auth": {
          "kind": "user",
          "summary": "Bearer access token of any signed-in user. The workspace named in the signed `state` must be one the caller is a member of with `access.manage` (admin, owner), its trial not ended and the `git_sync` plan feature on."
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/onboarding": {
      "get": {
        "tags": [
          "onboarding"
        ],
        "summary": "Onboarding",
        "description": "The \"Get started\" checklist: connection, first question, Telegram and the daily report, for every member, from the real state.",
        "operationId": "onboarding_api_v1_workspaces__workspace_id__onboarding_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/profiles": {
      "get": {
        "tags": [
          "cards"
        ],
        "summary": "List Profiles",
        "description": "Marketplace profiles that serve the workspace's industry, with their styles; empty means the part is off.",
        "operationId": "list_profiles_api_v1_workspaces__workspace_id__cards_profiles_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/settings": {
      "get": {
        "tags": [
          "cards"
        ],
        "summary": "Read Settings",
        "description": "The cards settings: the default quality of a new card and the ceiling of each of the three qualities (so'm, per colour).",
        "operationId": "read_settings_api_v1_workspaces__workspace_id__cards_settings_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardSettingsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "put": {
        "tags": [
          "cards"
        ],
        "summary": "Save Settings",
        "description": "Change the default quality: the owner only (`can_edit` in the settings answer says whether the caller may); existing cards keep theirs.",
        "operationId": "save_settings_api_v1_workspaces__workspace_id__cards_settings_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardSettingsIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardSettingsOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `ai.params.manage`, `chat.use`: owner. Refused while the workspace is stopped.",
          "capabilities": [
            "ai.params.manage",
            "chat.use"
          ],
          "roles": [
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards": {
      "get": {
        "tags": [
          "cards"
        ],
        "summary": "List Cards",
        "description": "The workspace's cards: the most recently changed first, search by name (`q`).",
        "operationId": "list_cards_api_v1_workspaces__workspace_id__cards_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "post": {
        "tags": [
          "cards"
        ],
        "summary": "Create Card",
        "description": "A new card: with a name its research is queued (the limits apply here); without one a silent draft that waits for `run`.",
        "operationId": "create_card_api_v1_workspaces__workspace_id__cards_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}": {
      "get": {
        "tags": [
          "cards"
        ],
        "summary": "Read Card",
        "description": "One card: state, progress, texts, classifier code, images and spend (the web polls it while work runs).",
        "operationId": "read_card_api_v1_workspaces__workspace_id__cards__card_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "patch": {
        "tags": [
          "cards"
        ],
        "summary": "Update Card",
        "description": "Only the fields sent; when the feature rows or the callouts change, the text images are redrawn for free (no AI).",
        "operationId": "update_card_api_v1_workspaces__workspace_id__cards__card_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "delete": {
        "tags": [
          "cards"
        ],
        "summary": "Delete Card",
        "description": "Delete a card: its author, an admin or the owner; its images go too.",
        "operationId": "delete_card_api_v1_workspaces__workspace_id__cards__card_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/variants": {
      "post": {
        "tags": [
          "cards"
        ],
        "summary": "Add Variant",
        "description": "A new colour (up to the profile limit, 8 on Uzum): its name is unique in the card; the ceiling and the title count are updated.",
        "operationId": "add_variant_api_v1_workspaces__workspace_id__cards__card_id__variants_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VariantIn"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VariantOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/variants/{variant_id}": {
      "patch": {
        "tags": [
          "cards"
        ],
        "summary": "Update Variant",
        "description": "The colour's name, its names per language, barcode, SKU, package, price, discount or place in the order.",
        "operationId": "update_variant_api_v1_workspaces__workspace_id__cards__card_id__variants__variant_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Variant Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VariantPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "delete": {
        "tags": [
          "cards"
        ],
        "summary": "Delete Variant",
        "description": "Delete a colour with its photos; refused for the last colour and while a job of the card runs.",
        "operationId": "delete_variant_api_v1_workspaces__workspace_id__cards__card_id__variants__variant_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Variant Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/photos": {
      "post": {
        "tags": [
          "cards"
        ],
        "summary": "Upload Photo",
        "description": "An own photo (JPG, PNG, WebP; ≤ 7 MB, sides ≥ 400 px) for this colour (none given: colour 1): the server re-encodes it and drops EXIF and location.",
        "operationId": "upload_photo_api_v1_workspaces__workspace_id__cards__card_id__photos_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "variant",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Variant"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BodyUploadPhotoApiV1Workspacesphotos_post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/photos/{image_id}": {
      "patch": {
        "tags": [
          "cards"
        ],
        "summary": "Update Photo",
        "description": "Make an own photo the main one, or tick a sample found on the web (up to 2).",
        "operationId": "update_photo_api_v1_workspaces__workspace_id__cards__card_id__photos__image_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Image Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhotoPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "delete": {
        "tags": [
          "cards"
        ],
        "summary": "Delete Photo",
        "description": "Remove an own photo or a found sample.",
        "operationId": "delete_photo_api_v1_workspaces__workspace_id__cards__card_id__photos__image_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Image Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/codes": {
      "get": {
        "tags": [
          "cards"
        ],
        "summary": "Search Codes",
        "description": "Classifier code search (digits or words, Latin or Cyrillic), up to 20.",
        "operationId": "search_codes_api_v1_workspaces__workspace_id__cards__card_id__codes_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "title": "Q"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodeListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/design": {
      "post": {
        "tags": [
          "cards"
        ],
        "summary": "Design Card",
        "description": "Make the images (with a style) or redo one slot with a note; a job is queued.",
        "operationId": "design_card_api_v1_workspaces__workspace_id__cards__card_id__design_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DesignIn"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/run": {
      "post": {
        "tags": [
          "cards"
        ],
        "summary": "Run Card",
        "description": "\"Create card\": identifying the product from the photos, the texts, the classifier code and the images in one chain; at least one photo.",
        "operationId": "run_card_api_v1_workspaces__workspace_id__cards__card_id__run_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunIn"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/search": {
      "post": {
        "tags": [
          "cards"
        ],
        "summary": "Search Card",
        "description": "\"Internetdan topish\" (search the web): rewrite the texts with a web search (one call, only when it fits the cap).",
        "operationId": "search_card_api_v1_workspaces__workspace_id__cards__card_id__search_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/compose": {
      "post": {
        "tags": [
          "cards"
        ],
        "summary": "Compose Card",
        "description": "Redraw the images for free after a callout or text edit (no AI).",
        "operationId": "compose_card_api_v1_workspaces__workspace_id__cards__card_id__compose_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/stop": {
      "post": {
        "tags": [
          "cards"
        ],
        "summary": "Stop Card",
        "description": "Stop the work after the current step; what is ready is kept.",
        "operationId": "stop_card_api_v1_workspaces__workspace_id__cards__card_id__stop_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/retry": {
      "post": {
        "tags": [
          "cards"
        ],
        "summary": "Retry Card",
        "description": "Start failed or stalled work again.",
        "operationId": "retry_card_api_v1_workspaces__workspace_id__cards__card_id__retry_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/images/{slot}/source": {
      "put": {
        "tags": [
          "cards"
        ],
        "summary": "Swap Image",
        "description": "\"Almashtirish\" (swap): replace the slot with an own photo (framed, no AI) or with this slot's previous version.",
        "operationId": "swap_image_api_v1_workspaces__workspace_id__cards__card_id__images__slot__source_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "slot",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9,
              "minimum": 1,
              "title": "Slot"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceIn"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/images/{slot}": {
      "delete": {
        "tags": [
          "cards"
        ],
        "summary": "Remove Image",
        "description": "\"Olib tashlash\" (remove): take a final image off the card (the last one stays).",
        "operationId": "remove_image_api_v1_workspaces__workspace_id__cards__card_id__images__slot__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "slot",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 9,
              "minimum": 1,
              "title": "Slot"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/images/{image_id}": {
      "get": {
        "tags": [
          "cards"
        ],
        "summary": "Read Image",
        "description": "A picture of the card (own photo, sample or final) as JPEG: `inline`, `private, no-store`.",
        "operationId": "read_image_api_v1_workspaces__workspace_id__cards__card_id__images__image_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Image Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Size",
              "default": "full"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image",
            "content": {
              "image/jpeg": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/images/{image_id}/download": {
      "get": {
        "tags": [
          "cards"
        ],
        "summary": "Download Image",
        "description": "One final image as a file (JPEG in the marketplace size): `attachment`, named after the product and its number.",
        "operationId": "download_image_api_v1_workspaces__workspace_id__cards__card_id__images__image_id__download_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Image Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image",
            "content": {
              "image/jpeg": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/cards/{card_id}/export.zip": {
      "get": {
        "tags": [
          "cards"
        ],
        "summary": "Export Card",
        "description": "ZIP: the final images in gallery order and one text file per language (the code only once confirmed); 409 while a rule is broken.",
        "operationId": "export_card_api_v1_workspaces__workspace_id__cards__card_id__export_zip_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "card_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Card Id"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ZIP",
            "content": {
              "application/zip": {}
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/home/today": {
      "get": {
        "tags": [
          "home"
        ],
        "summary": "Today",
        "description": "The home card: the lines the connected packages declare (`home.yml`) in the caller's row scope and one tip; cached 5 minutes per workspace and scope.",
        "operationId": "today_api_v1_workspaces__workspace_id__home_today_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Locale",
              "default": "uz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TodayOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "409": {
            "$ref": "#/components/responses/WorkspaceStopped"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped.",
          "capabilities": [
            "chat.use"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/menu-pins": {
      "get": {
        "tags": [
          "menu"
        ],
        "summary": "List Pins",
        "description": "The caller's menu pins in this workspace, in order; a pin the caller can no longer open is left out.",
        "operationId": "list_pins_api_v1_workspaces__workspace_id__menu_pins_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuPinListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/menu-pins/order": {
      "put": {
        "tags": [
          "menu"
        ],
        "summary": "Reorder Pins",
        "description": "The new order: the pins sent come first in that order, the rest follow; an unknown pin is ignored.",
        "operationId": "reorder_pins_api_v1_workspaces__workspace_id__menu_pins_order_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MenuOrderIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuPinListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    },
    "/api/v1/workspaces/{workspace_id}/menu-pins/{kind}/{target}": {
      "put": {
        "tags": [
          "menu"
        ],
        "summary": "Pin",
        "description": "Pin to the menu (pinning twice is safe); a target the caller cannot open is 404, a menu with 12 pins is 409.",
        "operationId": "pin_api_v1_workspaces__workspace_id__menu_pins__kind___target__put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PinKind"
            }
          },
          {
            "name": "target",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Target"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuPinListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      },
      "delete": {
        "tags": [
          "menu"
        ],
        "summary": "Unpin",
        "description": "Unpin (200 when it was not pinned too); the answer is the remaining list.",
        "operationId": "unpin_api_v1_workspaces__workspace_id__menu_pins__kind___target__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PinKind"
            }
          },
          {
            "name": "target",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[a-z][a-z0-9_]{0,62}$",
              "title": "Target"
            }
          },
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuPinListOut"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "402": {
            "$ref": "#/components/responses/TrialEnded"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenCapabilityDenied"
          },
          "404": {
            "$ref": "#/components/responses/WorkspaceNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        },
        "x-auth": {
          "kind": "workspace",
          "summary": "Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner.",
          "capabilities": [
            "dashboard.view"
          ],
          "roles": [
            "viewer",
            "builder",
            "admin",
            "owner"
          ]
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AcceptedOut": {
        "properties": {
          "run_id": {
            "type": "integer",
            "title": "Run Id"
          },
          "chat_id": {
            "type": "string",
            "format": "uuid",
            "title": "Chat Id"
          },
          "message_id": {
            "type": "integer",
            "title": "Message Id"
          },
          "state": {
            "$ref": "#/components/schemas/ChatRunStatus"
          },
          "last_event_id": {
            "type": "integer",
            "title": "Last Event Id"
          }
        },
        "type": "object",
        "required": [
          "run_id",
          "chat_id",
          "message_id",
          "state",
          "last_event_id"
        ],
        "title": "AcceptedOut"
      },
      "AccountStanding": {
        "type": "string",
        "enum": [
          "active",
          "overdue",
          "blocked"
        ],
        "title": "AccountStanding"
      },
      "ActiveRunOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "state": {
            "$ref": "#/components/schemas/ChatRunStatus"
          },
          "awaiting": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InputKind"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_event_id": {
            "type": "integer",
            "title": "Last Event Id",
            "default": 0
          },
          "cancel_requested": {
            "type": "boolean",
            "title": "Cancel Requested",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "state"
        ],
        "title": "ActiveRunOut"
      },
      "ActorKind": {
        "type": "string",
        "enum": [
          "user",
          "ai",
          "system",
          "package"
        ],
        "title": "ActorKind"
      },
      "AiDataAccess": {
        "type": "string",
        "enum": [
          "metadata",
          "categories",
          "samples"
        ],
        "title": "AiDataAccess"
      },
      "AiDataAccessRequest": {
        "properties": {
          "ai_data_access": {
            "$ref": "#/components/schemas/AiDataAccess"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ai_data_access"
        ],
        "title": "AiDataAccessRequest",
        "description": "How far the AI may see values it did not get from the person: `metadata`, `categories`, `samples`."
      },
      "AiEventListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AiEventOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "AiEventListOut"
      },
      "AiEventOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "purpose": {
            "type": "string",
            "title": "Purpose"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "tool_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Name"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "input_tokens": {
            "type": "integer",
            "title": "Input Tokens"
          },
          "output_tokens": {
            "type": "integer",
            "title": "Output Tokens"
          },
          "cache_read_tokens": {
            "type": "integer",
            "title": "Cache Read Tokens"
          },
          "cache_write_tokens": {
            "type": "integer",
            "title": "Cache Write Tokens"
          },
          "cache_write_1h_tokens": {
            "type": "integer",
            "title": "Cache Write 1H Tokens",
            "default": 0
          },
          "reasoning_tokens": {
            "type": "integer",
            "title": "Reasoning Tokens"
          },
          "cost_usd": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Cost Usd"
          },
          "price_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Version"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "duration_ms": {
            "type": "integer",
            "title": "Duration Ms"
          },
          "actor_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Id"
          },
          "actor_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Email"
          },
          "chat_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chat Id"
          },
          "chat_run_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chat Run Id"
          },
          "change_request_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Request Id"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "details": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "kind",
          "purpose",
          "status",
          "tool_name",
          "provider",
          "model",
          "input_tokens",
          "output_tokens",
          "cache_read_tokens",
          "cache_write_tokens",
          "reasoning_tokens",
          "cost_usd",
          "price_version",
          "error_code",
          "duration_ms",
          "actor_id",
          "actor_email",
          "chat_id",
          "chat_run_id",
          "change_request_id",
          "run_id",
          "request_id",
          "summary",
          "details"
        ],
        "title": "AiEventOut"
      },
      "AiSettingsUpdateRequest": {
        "properties": {
          "chat_token_budget": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 300000.0,
                "minimum": 10000.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Chat Token Budget"
          },
          "chat_max_rounds": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 12.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Chat Max Rounds"
          }
        },
        "type": "object",
        "title": "AiSettingsUpdateRequest"
      },
      "AiUsageOut": {
        "properties": {
          "days": {
            "type": "integer",
            "title": "Days"
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "title": "Since"
          },
          "totals": {
            "$ref": "#/components/schemas/UsageSumsOut"
          },
          "by_day": {
            "items": {
              "$ref": "#/components/schemas/UsageDayOut"
            },
            "type": "array",
            "title": "By Day"
          },
          "by_model": {
            "items": {
              "$ref": "#/components/schemas/UsageModelOut"
            },
            "type": "array",
            "title": "By Model"
          },
          "by_purpose": {
            "items": {
              "$ref": "#/components/schemas/UsagePurposeOut"
            },
            "type": "array",
            "title": "By Purpose"
          }
        },
        "type": "object",
        "required": [
          "days",
          "since",
          "totals",
          "by_day",
          "by_model",
          "by_purpose"
        ],
        "title": "AiUsageOut"
      },
      "AnswerDetailsOut": {
        "properties": {
          "message_id": {
            "type": "integer",
            "title": "Message Id"
          },
          "run_id": {
            "type": "integer",
            "title": "Run Id"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "model_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Label"
          },
          "rounds": {
            "type": "integer",
            "title": "Rounds"
          },
          "duration_ms": {
            "type": "integer",
            "title": "Duration Ms"
          },
          "queue_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Queue Ms"
          },
          "tokens": {
            "$ref": "#/components/schemas/DetailTokensOut"
          },
          "cost_uzs": {
            "type": "integer",
            "title": "Cost Uzs"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/DetailStepOut"
            },
            "type": "array",
            "title": "Steps"
          },
          "escalation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DetailEscalationOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "message_id",
          "run_id",
          "model",
          "model_label",
          "rounds",
          "duration_ms",
          "queue_ms",
          "tokens",
          "cost_uzs",
          "steps"
        ],
        "title": "AnswerDetailsOut",
        "description": "One answer's details: model, rounds, tokens, price (so'm) and the time of each step."
      },
      "AppAuth": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "github_app",
            "title": "Kind"
          },
          "grant": {
            "type": "string",
            "maxLength": 1024,
            "minLength": 16,
            "title": "Grant"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "grant"
        ],
        "title": "AppAuth",
        "description": "The installation id is never typed in: it only comes inside the signed `grant`, verified through OAuth."
      },
      "ApprovalCapability": {
        "type": "string",
        "enum": [
          "change.approve",
          "change.approve_access",
          "change.approve_owner"
        ],
        "title": "ApprovalCapability"
      },
      "ApprovalDecision": {
        "type": "string",
        "enum": [
          "approved",
          "rejected"
        ],
        "title": "ApprovalDecision"
      },
      "ApprovalIn": {
        "properties": {
          "head_oid": {
            "type": "string",
            "pattern": "^[0-9a-f]{40}$",
            "title": "Head Oid"
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "head_oid"
        ],
        "title": "ApprovalIn"
      },
      "ApprovalOut": {
        "properties": {
          "decision": {
            "$ref": "#/components/schemas/ApprovalDecision"
          },
          "head_oid": {
            "type": "string",
            "title": "Head Oid"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "decision",
          "head_oid",
          "user_id",
          "role",
          "note",
          "created_at"
        ],
        "title": "ApprovalOut"
      },
      "AttachmentIn": {
        "properties": {
          "upload_id": {
            "type": "integer",
            "maximum": 9.223372036854776e+18,
            "minimum": 1.0,
            "title": "Upload Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "upload_id"
        ],
        "title": "AttachmentIn"
      },
      "AttachmentOut": {
        "properties": {
          "upload_id": {
            "type": "integer",
            "title": "Upload Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "size": {
            "type": "integer",
            "title": "Size"
          },
          "content_type": {
            "type": "string",
            "title": "Content Type"
          }
        },
        "type": "object",
        "required": [
          "upload_id",
          "name",
          "size",
          "content_type"
        ],
        "title": "AttachmentOut"
      },
      "AttachmentRulesOut": {
        "properties": {
          "allowed": {
            "type": "boolean",
            "title": "Allowed"
          },
          "extensions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Extensions"
          },
          "max_file_mb": {
            "type": "integer",
            "title": "Max File Mb"
          },
          "max_files": {
            "type": "integer",
            "title": "Max Files"
          }
        },
        "type": "object",
        "required": [
          "allowed",
          "extensions",
          "max_file_mb",
          "max_files"
        ],
        "title": "AttachmentRulesOut"
      },
      "AttributesOut": {
        "properties": {
          "user_id": {
            "type": "integer",
            "title": "User Id"
          },
          "attributes": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Attributes"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "attributes"
        ],
        "title": "AttributesOut"
      },
      "AttributesRequest": {
        "properties": {
          "attributes": {
            "patternProperties": {
              "^[a-z][a-z0-9_]{0,62}$": {
                "items": {
                  "type": "string",
                  "maxLength": 128,
                  "minLength": 1
                },
                "type": "array",
                "maxItems": 100
              }
            },
            "type": "object",
            "maxProperties": 20,
            "title": "Attributes"
          }
        },
        "type": "object",
        "required": [
          "attributes"
        ],
        "title": "AttributesRequest"
      },
      "AuditListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AuditLogOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "AuditListOut"
      },
      "AuditLogOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "actor_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Id"
          },
          "actor_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Email"
          },
          "action": {
            "type": "string",
            "title": "Action"
          },
          "target_type": {
            "type": "string",
            "title": "Target Type"
          },
          "target_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Id"
          },
          "target_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Name"
          },
          "details": {
            "anyOf": [
              {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "actor_id",
          "actor_email",
          "action",
          "target_type",
          "target_id",
          "target_name",
          "details",
          "created_at"
        ],
        "title": "AuditLogOut"
      },
      "AuthKind": {
        "type": "string",
        "enum": [
          "token",
          "github_app"
        ],
        "title": "AuthKind"
      },
      "AuthorOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "title": "AuthorOut"
      },
      "BillingKind": {
        "type": "string",
        "enum": [
          "paid",
          "trial",
          "exempt"
        ],
        "title": "BillingKind"
      },
      "BillingOut": {
        "properties": {
          "budget": {
            "$ref": "#/components/schemas/BudgetOut"
          },
          "balance_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Balance Uzs"
          },
          "monthly_uzs": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Monthly Uzs"
          },
          "next_charge_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Charge On"
          },
          "budget_default_uzs": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Default Uzs"
          },
          "budget_custom": {
            "type": "boolean",
            "title": "Budget Custom"
          },
          "tier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TierStateOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "ai_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Ai Uzs",
            "default": "0"
          },
          "overdue_since": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Overdue Since"
          },
          "grace_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grace Until"
          },
          "blocked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked At"
          },
          "blocked_by_hand": {
            "type": "boolean",
            "title": "Blocked By Hand"
          },
          "reopen_uzs": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reopen Uzs"
          },
          "trial_ends_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trial Ends At"
          },
          "usd_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Usd Uzs"
          },
          "payment_text": {
            "type": "string",
            "title": "Payment Text"
          },
          "can_manage": {
            "type": "boolean",
            "title": "Can Manage"
          },
          "plans": {
            "items": {
              "$ref": "#/components/schemas/PlanOptionOut"
            },
            "type": "array",
            "title": "Plans",
            "default": []
          },
          "next_plan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlanKey"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_plan_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Plan On"
          },
          "contact_sent_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact Sent At"
          }
        },
        "type": "object",
        "required": [
          "budget",
          "balance_uzs",
          "monthly_uzs",
          "next_charge_on",
          "budget_default_uzs",
          "budget_custom",
          "overdue_since",
          "grace_until",
          "blocked_at",
          "blocked_by_hand",
          "reopen_uzs",
          "trial_ends_at",
          "usd_uzs",
          "payment_text",
          "can_manage"
        ],
        "title": "BillingOut",
        "description": "The workspace \"Billing\" page: balance, usage and budget, subscription, next charge date and how to pay."
      },
      "BlockerOut": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "dashboard",
              "chart"
            ],
            "title": "Kind"
          },
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Title"
          },
          "inside": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inside"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "title"
        ],
        "title": "BlockerOut"
      },
      "BodyAddDocumentApiV1Workspaceschats_uploads_post": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          },
          "chat_id": {
            "type": "string",
            "pattern": "^(?:[0-9]{1,19}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
            "title": "Chat Id"
          }
        },
        "type": "object",
        "required": [
          "file",
          "chat_id"
        ],
        "title": "Body_add_document_api_v1_workspaces__workspace_id__chats_uploads_post"
      },
      "BodyTranscribeApiV1Workspacesvoice_post": {
        "properties": {
          "audio": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "Audio"
          },
          "language": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Locale"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "audio"
        ],
        "title": "Body_transcribe_api_v1_workspaces__workspace_id__chats__chat_id__voice_post"
      },
      "BodyTranscribeNewApiV1Workspaceschats_voice_post": {
        "properties": {
          "audio": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "Audio"
          },
          "language": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Locale"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "audio"
        ],
        "title": "Body_transcribe_new_api_v1_workspaces__workspace_id__chats_voice_post"
      },
      "BodyUploadFileApiV1Workspacesfiles_post": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_file_api_v1_workspaces__workspace_id__marketplace_packages__scope___name__files_post"
      },
      "BodyUploadFileApiV1Workspacessources_uploads_files_post": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          },
          "source": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,31}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_file_api_v1_workspaces__workspace_id__sources_uploads_files_post"
      },
      "BodyUploadPhotoApiV1Workspacesphotos_post": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_photo_api_v1_workspaces__workspace_id__cards__card_id__photos_post"
      },
      "BoxIn": {
        "properties": {
          "width_mm": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 5000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Width Mm"
          },
          "length_mm": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 5000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Length Mm"
          },
          "height_mm": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 5000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Height Mm"
          },
          "weight_g": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Weight G"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "BoxIn",
        "description": "The package size (mm) and the weight with the package (g) as the seller corrected them; `null` clears that number."
      },
      "BoxOut": {
        "properties": {
          "width_mm": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 5000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Width Mm"
          },
          "length_mm": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 5000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Length Mm"
          },
          "height_mm": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 5000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Height Mm"
          },
          "weight_g": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Weight G"
          },
          "estimated": {
            "type": "boolean",
            "title": "Estimated",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "BoxOut",
        "description": "The colour's package; `estimated` means it is our estimate (the seller has not corrected it yet)."
      },
      "BrandingUpdateRequest": {
        "properties": {
          "theme": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Theme"
              },
              {
                "type": "null"
              }
            ]
          },
          "accent_color": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^#[0-9a-fA-F]{6}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accent Color"
          },
          "logo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url",
            "deprecated": true
          }
        },
        "type": "object",
        "title": "BrandingUpdateRequest",
        "description": "Theme and accent colour; a `logo_url` sent by an old client is ignored (no logo is stored)."
      },
      "BrowserFlow": {
        "properties": {
          "start_url": {
            "type": "string",
            "maxLength": 500,
            "minLength": 9,
            "title": "Start Url"
          },
          "steps": {
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/GotoStep"
                },
                {
                  "$ref": "#/components/schemas/FillStep"
                },
                {
                  "$ref": "#/components/schemas/ClickStep"
                },
                {
                  "$ref": "#/components/schemas/WaitStep"
                },
                {
                  "$ref": "#/components/schemas/DownloadStep"
                },
                {
                  "$ref": "#/components/schemas/ScrapeTableStep"
                }
              ]
            },
            "type": "array",
            "maxItems": 40,
            "minItems": 1,
            "title": "Steps"
          },
          "timeout_seconds": {
            "type": "integer",
            "maximum": 900.0,
            "minimum": 30.0,
            "title": "Timeout Seconds",
            "default": 300
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "start_url",
          "steps"
        ],
        "title": "BrowserFlow"
      },
      "BudgetLevel": {
        "type": "string",
        "enum": [
          "ok",
          "warning",
          "exhausted"
        ],
        "title": "BudgetLevel"
      },
      "BudgetOut": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/BillingKind"
          },
          "plan": {
            "$ref": "#/components/schemas/PlanKey"
          },
          "standing": {
            "$ref": "#/components/schemas/AccountStanding"
          },
          "level": {
            "$ref": "#/components/schemas/BudgetLevel"
          },
          "stop": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop"
          },
          "budget_uzs": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budget Uzs"
          },
          "used_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Used Uzs"
          },
          "share": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Share"
          },
          "period_start": {
            "type": "string",
            "format": "date-time",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "format": "date-time",
            "title": "Period End"
          },
          "trial_budget_usd": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trial Budget Usd"
          },
          "trial_used_usd": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trial Used Usd"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "plan",
          "standing",
          "level",
          "stop",
          "budget_uzs",
          "used_uzs",
          "share",
          "period_start",
          "period_end"
        ],
        "title": "BudgetOut",
        "description": "This month's usage and budget (for a trial, the whole trial), with its level and stop code."
      },
      "BudgetRequest": {
        "properties": {
          "budget_uzs": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 10000000000.0,
                "minimum": 0.0
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d{0,0}0*$"
              }
            ],
            "title": "Budget Uzs"
          }
        },
        "type": "object",
        "required": [
          "budget_uzs"
        ],
        "title": "BudgetRequest"
      },
      "CanOut": {
        "properties": {
          "edit": {
            "type": "boolean",
            "title": "Edit"
          },
          "spend": {
            "type": "boolean",
            "title": "Spend"
          },
          "delete": {
            "type": "boolean",
            "title": "Delete"
          },
          "spend_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SpendStop"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "edit",
          "spend",
          "delete"
        ],
        "title": "CanOut",
        "description": "Rights; when `spend` is false, `spend_reason` says why (`cap` — raise the quality, `budget` — payment)."
      },
      "CancelOut": {
        "properties": {
          "run_id": {
            "type": "integer",
            "title": "Run Id"
          },
          "state": {
            "$ref": "#/components/schemas/ChatRunStatus"
          }
        },
        "type": "object",
        "required": [
          "run_id",
          "state"
        ],
        "title": "CancelOut"
      },
      "Capability": {
        "type": "string",
        "enum": [
          "chat.use",
          "dashboard.view",
          "delivery.subscribe_self",
          "explore.sql",
          "content.edit",
          "source.manage",
          "secret.manage",
          "package.manage",
          "change.create",
          "change.approve",
          "deploy.rollback",
          "dev_mode",
          "change.approve_access",
          "access.manage",
          "capacity.view",
          "ai_usage.view",
          "audit.view",
          "member.manage",
          "role.change",
          "branding.manage",
          "ai.instructions.manage",
          "change.approve_owner",
          "workspace.stop",
          "workspace.delete",
          "ai.model.manage",
          "billing.view",
          "billing.manage",
          "monitoring.view",
          "ai.params.manage"
        ],
        "title": "Capability"
      },
      "CapacityOut": {
        "properties": {
          "status": {
            "$ref": "#/components/schemas/CapacityStatus"
          },
          "grace_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grace Until"
          }
        },
        "type": "object",
        "required": [
          "status",
          "grace_until"
        ],
        "title": "CapacityOut"
      },
      "CapacityOverviewOut": {
        "properties": {
          "timezone": {
            "type": "string",
            "title": "Timezone"
          },
          "sku": {
            "$ref": "#/components/schemas/SkuOut"
          },
          "capacity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CapacityOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "formula": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FormulaOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CapacityStateOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "today": {
            "$ref": "#/components/schemas/CapacityUsageTotalsOut"
          },
          "month": {
            "$ref": "#/components/schemas/CapacityUsageTotalsOut"
          },
          "storage": {
            "$ref": "#/components/schemas/CapacityStorageOut"
          },
          "ingest": {
            "$ref": "#/components/schemas/CapacityIngestMonthOut"
          },
          "recommendation": {
            "$ref": "#/components/schemas/RecommendationOut"
          }
        },
        "type": "object",
        "required": [
          "timezone",
          "sku",
          "capacity",
          "formula",
          "state",
          "today",
          "month",
          "storage",
          "ingest",
          "recommendation"
        ],
        "title": "CapacityOverviewOut"
      },
      "CapacityStage": {
        "type": "string",
        "enum": [
          "ok",
          "overage",
          "delay",
          "defer"
        ],
        "title": "CapacityStage"
      },
      "CapacityStateOut": {
        "properties": {
          "stage": {
            "$ref": "#/components/schemas/CapacityStage"
          },
          "p10": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "P10"
          },
          "p60": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "P60"
          },
          "p1440": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "P1440"
          },
          "carryforward_dcu_s": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Carryforward Dcu S"
          },
          "burndown_minutes": {
            "type": "integer",
            "title": "Burndown Minutes"
          },
          "delay_ms": {
            "type": "integer",
            "title": "Delay Ms"
          },
          "defer_background": {
            "type": "boolean",
            "title": "Defer Background"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "stage",
          "p10",
          "p60",
          "p1440",
          "carryforward_dcu_s",
          "burndown_minutes",
          "delay_ms",
          "defer_background",
          "reason",
          "updated_at"
        ],
        "title": "CapacityStateOut"
      },
      "CapacityStatus": {
        "type": "string",
        "enum": [
          "active",
          "paused",
          "retired"
        ],
        "title": "CapacityStatus"
      },
      "CapacityUsageOut": {
        "properties": {
          "period": {
            "$ref": "#/components/schemas/CapacityUsagePeriod"
          },
          "bucket": {
            "$ref": "#/components/schemas/UsageBucket"
          },
          "timezone": {
            "type": "string",
            "title": "Timezone"
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "title": "Since"
          },
          "until": {
            "type": "string",
            "format": "date-time",
            "title": "Until"
          },
          "capacity_dcu": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Capacity Dcu"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/UsagePointOut"
            },
            "type": "array",
            "title": "Items"
          },
          "totals": {
            "$ref": "#/components/schemas/CapacityUsageTotalsOut"
          }
        },
        "type": "object",
        "required": [
          "period",
          "bucket",
          "timezone",
          "since",
          "until",
          "capacity_dcu",
          "items",
          "totals"
        ],
        "title": "CapacityUsageOut"
      },
      "CaptchaOut": {
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "off",
              "pow",
              "turnstile"
            ],
            "title": "Mode"
          },
          "challenge": {
            "type": "string",
            "title": "Challenge"
          },
          "difficulty": {
            "type": "integer",
            "title": "Difficulty"
          },
          "site_key": {
            "type": "string",
            "title": "Site Key"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "mode",
          "challenge",
          "difficulty",
          "site_key",
          "expires_at"
        ],
        "title": "CaptchaOut",
        "description": "`pow`: find a decimal `nonce` so that the hex of sha256(challenge + nonce) starts with `difficulty` zeros."
      },
      "CardBadge": {
        "properties": {
          "value": {
            "type": "string",
            "maxLength": 8,
            "minLength": 1,
            "title": "Value"
          },
          "unit": {
            "type": "string",
            "maxLength": 6,
            "title": "Unit",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "value"
        ],
        "title": "CardBadge"
      },
      "CardCallout": {
        "properties": {
          "icon": {
            "type": "string",
            "title": "Icon"
          },
          "text": {
            "type": "string",
            "maxLength": 28,
            "minLength": 1,
            "title": "Text"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "icon",
          "text"
        ],
        "title": "CardCallout"
      },
      "CardCallouts": {
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 40,
            "title": "Title",
            "default": ""
          },
          "badge": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CardBadge"
              },
              {
                "type": "null"
              }
            ]
          },
          "benefits": {
            "items": {
              "$ref": "#/components/schemas/CardCallout"
            },
            "type": "array",
            "maxItems": 4,
            "title": "Benefits"
          },
          "slogan": {
            "type": "string",
            "maxLength": 40,
            "title": "Slogan",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CardCallouts",
        "description": "The image callouts in one language: title, badge (value and unit), 3-4 benefits with an icon, slogan."
      },
      "CardFeature": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 60,
            "minLength": 1,
            "title": "Name"
          },
          "value": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Value"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "value"
        ],
        "title": "CardFeature"
      },
      "CardFields": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "short": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 600,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Short"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "category": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "features": {
            "items": {
              "$ref": "#/components/schemas/CardFeature"
            },
            "type": "array",
            "maxItems": 15,
            "title": "Features"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CardFields",
        "description": "The card texts in one language: title, short and full description, category, characteristics."
      },
      "CardIn": {
        "properties": {
          "product": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 2
              },
              {
                "type": "null"
              }
            ],
            "title": "Product"
          },
          "barcode": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9]{8,14}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Barcode"
          },
          "link": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 600,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Link"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "style": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,62}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Style"
          },
          "instruction": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Instruction"
          },
          "language": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z]{2}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "profile": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,62}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CardIn",
        "description": "A new card: with a name its research is queued at once; without one a silent draft (photos are uploaded, it waits for `run`)."
      },
      "CardListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CardRowOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "CardListOut",
        "description": "A page of cards: the most recently changed first."
      },
      "CardOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "profile": {
            "type": "string",
            "title": "Profile"
          },
          "product": {
            "type": "string",
            "title": "Product"
          },
          "barcode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Barcode"
          },
          "link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Link"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "style": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Style"
          },
          "instruction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instruction"
          },
          "language": {
            "type": "string",
            "title": "Language"
          },
          "level": {
            "$ref": "#/components/schemas/Level"
          },
          "status": {
            "$ref": "#/components/schemas/CardStatus"
          },
          "research": {
            "$ref": "#/components/schemas/ResearchState"
          },
          "ask": {
            "anyOf": [
              {
                "type": "string",
                "const": "product"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ask"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "progress": {
            "$ref": "#/components/schemas/ProgressOut"
          },
          "texts": {
            "patternProperties": {
              "^[a-z]{2}$": {
                "$ref": "#/components/schemas/CardFields"
              }
            },
            "type": "object",
            "title": "Texts"
          },
          "check": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Check"
          },
          "checks": {
            "items": {
              "$ref": "#/components/schemas/ListingCheckOut"
            },
            "type": "array",
            "title": "Checks"
          },
          "searched": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SearchOutcome"
              },
              {
                "type": "null"
              }
            ]
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/ListingSourceOut"
            },
            "type": "array",
            "title": "Sources"
          },
          "tips": {
            "items": {
              "type": "string",
              "const": "size"
            },
            "type": "array",
            "title": "Tips"
          },
          "code": {
            "$ref": "#/components/schemas/CodeChoiceOut"
          },
          "callouts": {
            "patternProperties": {
              "^[a-z]{2}$": {
                "$ref": "#/components/schemas/CardCallouts"
              }
            },
            "type": "object",
            "title": "Callouts"
          },
          "per_photo": {
            "type": "boolean",
            "title": "Per Photo",
            "default": false
          },
          "variants": {
            "items": {
              "$ref": "#/components/schemas/VariantOut"
            },
            "type": "array",
            "title": "Variants"
          },
          "references": {
            "items": {
              "$ref": "#/components/schemas/ReferenceOut"
            },
            "type": "array",
            "title": "References"
          },
          "spend": {
            "$ref": "#/components/schemas/SpendOut"
          },
          "can": {
            "$ref": "#/components/schemas/CanOut"
          },
          "author": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AuthorOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "profile",
          "product",
          "language",
          "level",
          "status",
          "research",
          "progress",
          "code",
          "spend",
          "can",
          "created_at",
          "updated_at"
        ],
        "title": "CardOut",
        "description": "One card (read by polling): state, progress, texts, classifier code, callouts, colours (each with its own photos and image slots, colour 1 first), spend and rights."
      },
      "CardPatch": {
        "properties": {
          "product": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 2
              },
              {
                "type": "null"
              }
            ],
            "title": "Product"
          },
          "barcode": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9]{8,14}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Barcode"
          },
          "link": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 600,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Link"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "style": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,62}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Style"
          },
          "instruction": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Instruction"
          },
          "level": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Level"
              },
              {
                "type": "null"
              }
            ]
          },
          "texts": {
            "anyOf": [
              {
                "patternProperties": {
                  "^[a-z]{2}$": {
                    "$ref": "#/components/schemas/CardFields"
                  }
                },
                "type": "object",
                "maxProperties": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Texts"
          },
          "callouts": {
            "anyOf": [
              {
                "patternProperties": {
                  "^[a-z]{2}$": {
                    "$ref": "#/components/schemas/CardCallouts"
                  }
                },
                "type": "object",
                "maxProperties": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Callouts"
          },
          "code": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9A-Za-z]{4,32}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "code_state": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "confirmed",
                  "skipped"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Code State"
          },
          "order": {
            "anyOf": [
              {
                "items": {
                  "type": "integer",
                  "maximum": 9.0,
                  "minimum": 1.0
                },
                "type": "array",
                "maxItems": 9,
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Order"
          },
          "status": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ready",
                  "review"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CardPatch",
        "description": "Change a card: only the fields sent; `null` clears (barcode, link, notes, instruction)."
      },
      "CardRowOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "profile": {
            "type": "string",
            "title": "Profile"
          },
          "product": {
            "type": "string",
            "title": "Product"
          },
          "status": {
            "$ref": "#/components/schemas/CardStatus"
          },
          "check": {
            "type": "boolean",
            "title": "Check",
            "default": false
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "thumb": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Thumb"
          },
          "images_done": {
            "type": "integer",
            "title": "Images Done",
            "default": 0
          },
          "images_total": {
            "type": "integer",
            "title": "Images Total",
            "default": 0
          },
          "spent_uzs": {
            "type": "integer",
            "title": "Spent Uzs",
            "default": 0
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "profile",
          "product",
          "status",
          "updated_at"
        ],
        "title": "CardRowOut",
        "description": "A list row: name, state (a stalled one is `failed` + `error`), thumbnail, image count, spend, change time."
      },
      "CardSettingsIn": {
        "properties": {
          "level": {
            "$ref": "#/components/schemas/Level"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "level"
        ],
        "title": "CardSettingsIn"
      },
      "CardSettingsOut": {
        "properties": {
          "level": {
            "$ref": "#/components/schemas/Level"
          },
          "levels": {
            "items": {
              "$ref": "#/components/schemas/LevelOut"
            },
            "type": "array",
            "title": "Levels"
          },
          "can_edit": {
            "type": "boolean",
            "title": "Can Edit",
            "default": false
          },
          "last_style": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Style"
          },
          "last_language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Language"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "level",
          "levels"
        ],
        "title": "CardSettingsOut",
        "description": "The cards settings: the default quality, the three qualities with their ceilings, whether the caller may change it and the caller's last chosen style (`last_style`, the default style of a new card)."
      },
      "CardStage": {
        "type": "string",
        "enum": [
          "queued",
          "identify",
          "cutout",
          "data",
          "photos",
          "references",
          "research",
          "code",
          "callouts",
          "scenes",
          "compose",
          "rules"
        ],
        "title": "CardStage"
      },
      "CardStatus": {
        "type": "string",
        "enum": [
          "draft",
          "running",
          "review",
          "ready",
          "failed"
        ],
        "title": "CardStatus"
      },
      "CellOut": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "engine": {
            "type": "string",
            "title": "Engine"
          },
          "engine_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Engine Version"
          },
          "region": {
            "type": "string",
            "title": "Region"
          },
          "jurisdiction": {
            "type": "string",
            "title": "Jurisdiction"
          }
        },
        "type": "object",
        "required": [
          "code",
          "engine",
          "engine_version",
          "region",
          "jurisdiction"
        ],
        "title": "CellOut"
      },
      "Change": {
        "type": "string",
        "enum": [
          "keep",
          "upgrade",
          "downgrade",
          "none_fits"
        ],
        "title": "Change"
      },
      "ChangeCreateIn": {
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Title"
          },
          "ref": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Ref"
          },
          "summary": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocalizedText"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "title",
          "ref"
        ],
        "title": "ChangeCreateIn",
        "description": "Developer mode: opens a CR from the caller's own draft (`dev/<id>/<name>`); checks start at once."
      },
      "ChangeDetailOut": {
        "properties": {
          "number": {
            "type": "integer",
            "title": "Number"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "summary": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "branch": {
            "type": "string",
            "title": "Branch"
          },
          "base_oid": {
            "type": "string",
            "title": "Base Oid"
          },
          "head_oid": {
            "type": "string",
            "title": "Head Oid"
          },
          "origin": {
            "$ref": "#/components/schemas/ChangeOrigin"
          },
          "author_kind": {
            "$ref": "#/components/schemas/ActorKind"
          },
          "author_user_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author User Id"
          },
          "on_behalf_of_user_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "On Behalf Of User Id"
          },
          "chat_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chat Id"
          },
          "status": {
            "$ref": "#/components/schemas/ChangeStatus"
          },
          "change_kinds": {
            "items": {
              "$ref": "#/components/schemas/ChangeKind"
            },
            "type": "array",
            "title": "Change Kinds"
          },
          "policy_decision": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PolicyDecision"
              },
              {
                "type": "null"
              }
            ]
          },
          "required_capability": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApprovalCapability"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_suggestion": {
            "type": "boolean",
            "title": "Is Suggestion"
          },
          "merged_oid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Merged Oid"
          },
          "deployed_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployed Version"
          },
          "closed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closed At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "reasons": {
            "items": {
              "$ref": "#/components/schemas/Reason"
            },
            "type": "array",
            "title": "Reasons"
          },
          "checks": {
            "items": {
              "$ref": "#/components/schemas/ChangesCheckOut"
            },
            "type": "array",
            "title": "Checks"
          },
          "approvals": {
            "items": {
              "$ref": "#/components/schemas/ApprovalOut"
            },
            "type": "array",
            "title": "Approvals"
          }
        },
        "type": "object",
        "required": [
          "number",
          "title",
          "summary",
          "branch",
          "base_oid",
          "head_oid",
          "origin",
          "author_kind",
          "author_user_id",
          "on_behalf_of_user_id",
          "chat_id",
          "status",
          "change_kinds",
          "policy_decision",
          "required_capability",
          "is_suggestion",
          "merged_oid",
          "deployed_version",
          "closed_at",
          "created_at",
          "updated_at"
        ],
        "title": "ChangeDetailOut"
      },
      "ChangeDiffOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/FileDiffOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          },
          "number": {
            "type": "integer",
            "title": "Number"
          },
          "base_oid": {
            "type": "string",
            "title": "Base Oid"
          },
          "head_oid": {
            "type": "string",
            "title": "Head Oid"
          }
        },
        "type": "object",
        "required": [
          "items",
          "number",
          "base_oid",
          "head_oid"
        ],
        "title": "ChangeDiffOut"
      },
      "ChangeKind": {
        "type": "string",
        "enum": [
          "add_column",
          "add_source_table",
          "add_test",
          "edit_labels",
          "edit_content",
          "edit_delivery",
          "edit_schedule",
          "secret_binding",
          "drop_column",
          "relax_test",
          "drop_source_table",
          "full_reload",
          "connector_code",
          "package_install",
          "package_upgrade",
          "settings_change",
          "access_change",
          "egress_change",
          "enable_browser_connector",
          "capacity_change",
          "engine_change",
          "policy_change",
          "unknown"
        ],
        "title": "ChangeKind"
      },
      "ChangeListItemOut": {
        "properties": {
          "number": {
            "type": "integer",
            "title": "Number"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "summary": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "branch": {
            "type": "string",
            "title": "Branch"
          },
          "base_oid": {
            "type": "string",
            "title": "Base Oid"
          },
          "head_oid": {
            "type": "string",
            "title": "Head Oid"
          },
          "origin": {
            "$ref": "#/components/schemas/ChangeOrigin"
          },
          "author_kind": {
            "$ref": "#/components/schemas/ActorKind"
          },
          "author_user_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author User Id"
          },
          "on_behalf_of_user_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "On Behalf Of User Id"
          },
          "chat_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chat Id"
          },
          "status": {
            "$ref": "#/components/schemas/ChangeStatus"
          },
          "change_kinds": {
            "items": {
              "$ref": "#/components/schemas/ChangeKind"
            },
            "type": "array",
            "title": "Change Kinds"
          },
          "policy_decision": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PolicyDecision"
              },
              {
                "type": "null"
              }
            ]
          },
          "required_capability": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApprovalCapability"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_suggestion": {
            "type": "boolean",
            "title": "Is Suggestion"
          },
          "merged_oid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Merged Oid"
          },
          "deployed_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployed Version"
          },
          "closed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closed At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "checks": {
            "items": {
              "$ref": "#/components/schemas/ChangesCheckOut"
            },
            "type": "array",
            "title": "Checks"
          }
        },
        "type": "object",
        "required": [
          "number",
          "title",
          "summary",
          "branch",
          "base_oid",
          "head_oid",
          "origin",
          "author_kind",
          "author_user_id",
          "on_behalf_of_user_id",
          "chat_id",
          "status",
          "change_kinds",
          "policy_decision",
          "required_capability",
          "is_suggestion",
          "merged_oid",
          "deployed_version",
          "closed_at",
          "created_at",
          "updated_at"
        ],
        "title": "ChangeListItemOut"
      },
      "ChangeListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ChangeListItemOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "ChangeListOut"
      },
      "ChangeOrigin": {
        "type": "string",
        "enum": [
          "ai",
          "user",
          "package",
          "system",
          "measure_request",
          "rollback",
          "git_import"
        ],
        "title": "ChangeOrigin"
      },
      "ChangeStatus": {
        "type": "string",
        "enum": [
          "draft",
          "checking",
          "checks_failed",
          "needs_approval",
          "approved",
          "deploying",
          "deployed",
          "deploy_failed",
          "rejected",
          "stale",
          "closed"
        ],
        "title": "ChangeStatus"
      },
      "ChartAddIn": {
        "properties": {
          "message_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Message Id"
          },
          "block_index": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMaximum": 10.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Block Index"
          },
          "chart": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,62}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chart"
          },
          "title": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocalizedTitle"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ChartAddIn"
      },
      "ChartPatchIn": {
        "properties": {
          "expected_version": {
            "type": "integer",
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Expected Version"
          },
          "title": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocalizedTitle"
              },
              {
                "type": "null"
              }
            ]
          },
          "visual": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChartVisual"
              },
              {
                "type": "null"
              }
            ]
          },
          "position": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TilePosition"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "expected_version"
        ],
        "title": "ChartPatchIn"
      },
      "ChartSavedOut": {
        "properties": {
          "dashboard": {
            "type": "string",
            "title": "Dashboard"
          },
          "chart": {
            "type": "string",
            "title": "Chart"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "added": {
            "type": "boolean",
            "title": "Added"
          },
          "version": {
            "type": "integer",
            "title": "Version"
          },
          "pending_change": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pending Change"
          }
        },
        "type": "object",
        "required": [
          "dashboard",
          "chart",
          "slug",
          "added",
          "version"
        ],
        "title": "ChartSavedOut"
      },
      "ChartVisual": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/VisualKind"
          },
          "x": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 127,
                "pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "X"
          },
          "series": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 127,
                "pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Series"
          },
          "measures": {
            "items": {
              "type": "string",
              "maxLength": 127,
              "pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$"
            },
            "type": "array",
            "maxItems": 10,
            "title": "Measures"
          },
          "stacked": {
            "type": "boolean",
            "title": "Stacked",
            "default": false
          },
          "horizontal": {
            "type": "boolean",
            "title": "Horizontal",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind"
        ],
        "title": "ChartVisual"
      },
      "ChatCreate": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ChatCreate"
      },
      "ChatDetailOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "active_run": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ActiveRunOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "shared": {
            "type": "boolean",
            "title": "Shared",
            "default": false
          },
          "read_only": {
            "type": "boolean",
            "title": "Read Only",
            "default": false
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/MessageOut"
            },
            "type": "array",
            "title": "Messages"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "default": false
          },
          "before": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Before"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "created_at",
          "updated_at",
          "messages"
        ],
        "title": "ChatDetailOut"
      },
      "ChatLimitsOut": {
        "properties": {
          "max_rounds": {
            "type": "integer",
            "title": "Max Rounds"
          },
          "token_budget": {
            "type": "integer",
            "title": "Token Budget"
          },
          "max_rounds_ceiling": {
            "type": "integer",
            "title": "Max Rounds Ceiling"
          },
          "token_budget_ceiling": {
            "type": "integer",
            "title": "Token Budget Ceiling"
          }
        },
        "type": "object",
        "required": [
          "max_rounds",
          "token_budget",
          "max_rounds_ceiling",
          "token_budget_ceiling"
        ],
        "title": "ChatLimitsOut"
      },
      "ChatListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ChatOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "ChatListOut"
      },
      "ChatModelOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "price_tier": {
            "$ref": "#/components/schemas/PriceTier"
          },
          "quality": {
            "type": "integer",
            "title": "Quality"
          },
          "quality_band": {
            "$ref": "#/components/schemas/QualityBand"
          },
          "context_tokens": {
            "type": "integer",
            "title": "Context Tokens"
          },
          "approx_uzs_per_answer": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approx Uzs Per Answer"
          },
          "available": {
            "type": "boolean",
            "title": "Available"
          },
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ModelReason"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "label",
          "provider",
          "price_tier",
          "quality",
          "quality_band",
          "context_tokens",
          "available"
        ],
        "title": "ChatModelOut"
      },
      "ChatModelsOut": {
        "properties": {
          "default_model_id": {
            "type": "string",
            "title": "Default Model Id"
          },
          "default_tier": {
            "$ref": "#/components/schemas/ChatTier"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ChatModelOut"
            },
            "type": "array",
            "title": "Items"
          },
          "tiers": {
            "items": {
              "$ref": "#/components/schemas/ChatTierOut"
            },
            "type": "array",
            "title": "Tiers"
          },
          "attachments": {
            "$ref": "#/components/schemas/AttachmentRulesOut"
          },
          "documents": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AttachmentRulesOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "default_model_id",
          "default_tier",
          "items",
          "tiers",
          "attachments"
        ],
        "title": "ChatModelsOut"
      },
      "ChatOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "active_run": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ActiveRunOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "shared": {
            "type": "boolean",
            "title": "Shared",
            "default": false
          },
          "read_only": {
            "type": "boolean",
            "title": "Read Only",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "created_at",
          "updated_at"
        ],
        "title": "ChatOut"
      },
      "ChatPatch": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ChatPatch",
        "description": "The name (`title`) and/or the model (`model_id`, `null` for the standard tier); only the fields sent change."
      },
      "ChatPreferencesIn": {
        "properties": {
          "answer_details": {
            "type": "boolean",
            "title": "Answer Details"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "answer_details"
        ],
        "title": "ChatPreferencesIn"
      },
      "ChatPreferencesOut": {
        "properties": {
          "answer_details": {
            "type": "boolean",
            "title": "Answer Details"
          }
        },
        "type": "object",
        "required": [
          "answer_details"
        ],
        "title": "ChatPreferencesOut",
        "description": "Chat settings (per member): answer details — steps, time, tokens and price; off by default."
      },
      "ChatRunListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ChatRunOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "ChatRunListOut"
      },
      "ChatRunOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "chat_id": {
            "type": "string",
            "format": "uuid",
            "title": "Chat Id"
          },
          "status": {
            "$ref": "#/components/schemas/ChatRunStatus"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "rounds": {
            "type": "integer",
            "title": "Rounds"
          },
          "executions": {
            "type": "integer",
            "title": "Executions"
          },
          "duration_ms": {
            "type": "integer",
            "title": "Duration Ms"
          },
          "tokens": {
            "$ref": "#/components/schemas/TokensOut"
          },
          "stop_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunStopReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "chat_id",
          "status",
          "provider",
          "model",
          "rounds",
          "executions",
          "duration_ms",
          "tokens",
          "stop_reason",
          "error",
          "created_by",
          "started_at",
          "finished_at",
          "created_at"
        ],
        "title": "ChatRunOut"
      },
      "ChatTier": {
        "type": "string",
        "enum": [
          "fast",
          "standard",
          "strong"
        ],
        "title": "ChatTier"
      },
      "ChatTierOut": {
        "properties": {
          "tier": {
            "$ref": "#/components/schemas/ChatTier"
          },
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "available": {
            "type": "boolean",
            "title": "Available"
          },
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ModelReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "plan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlanKey"
              },
              {
                "type": "null"
              }
            ]
          },
          "answers_left": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answers Left"
          },
          "cost_vs_standard": {
            "type": "number",
            "title": "Cost Vs Standard"
          },
          "approx_uzs_per_answer": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approx Uzs Per Answer"
          }
        },
        "type": "object",
        "required": [
          "tier",
          "model_id",
          "available",
          "cost_vs_standard"
        ],
        "title": "ChatTierOut",
        "description": "A simple-mode tier: the model behind it, the questions left and the cost against one Standard answer; when locked, the plan that opens it."
      },
      "CheckKind": {
        "type": "string",
        "enum": [
          "static"
        ],
        "title": "CheckKind"
      },
      "CheckStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "passed",
          "failed",
          "warning",
          "skipped"
        ],
        "title": "CheckStatus"
      },
      "ChoiceIn": {
        "properties": {
          "option_id": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[a-z0-9][a-z0-9_.:-]{0,127}$",
            "title": "Option Id"
          },
          "input_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "option_id"
        ],
        "title": "ChoiceIn"
      },
      "ChoiceKind": {
        "type": "string",
        "enum": [
          "start",
          "up",
          "down",
          "stay",
          "request"
        ],
        "title": "ChoiceKind"
      },
      "ClassifierInfoOut": {
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "names": {
            "$ref": "#/components/schemas/Words"
          },
          "site": {
            "type": "string",
            "title": "Site"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "names",
          "site"
        ],
        "title": "ClassifierInfoOut"
      },
      "ClickArgs": {
        "properties": {
          "selector": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "Selector"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "selector"
        ],
        "title": "ClickArgs"
      },
      "ClickStep": {
        "properties": {
          "click": {
            "$ref": "#/components/schemas/ClickArgs"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "click"
        ],
        "title": "ClickStep"
      },
      "CodeChoiceOut": {
        "properties": {
          "state": {
            "$ref": "#/components/schemas/CodeState"
          },
          "sure": {
            "type": "boolean",
            "title": "Sure",
            "default": false
          },
          "selected": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CodeOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/CodeOut"
            },
            "type": "array",
            "title": "Options"
          },
          "loaded": {
            "type": "boolean",
            "title": "Loaded",
            "default": false
          },
          "verify_link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verify Link"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "state"
        ],
        "title": "CodeChoiceOut",
        "description": "The card's classifier code: its state, the selected one, the options, whether the dictionary is loaded, the link to check it on the site and `sure`, whether the suggestion is reliable (if not, the result asks \"Which one?\"; the code is never confirmed by itself)."
      },
      "CodeListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CodeOut"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items"
        ],
        "title": "CodeListOut"
      },
      "CodeOut": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "name_uz": {
            "type": "string",
            "title": "Name Uz"
          },
          "name_ru": {
            "type": "string",
            "title": "Name Ru"
          },
          "path_uz": {
            "type": "string",
            "title": "Path Uz",
            "default": ""
          },
          "path_ru": {
            "type": "string",
            "title": "Path Ru",
            "default": ""
          },
          "general": {
            "type": "boolean",
            "title": "General",
            "default": false
          },
          "active": {
            "type": "boolean",
            "title": "Active",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "code",
          "name_uz",
          "name_ru"
        ],
        "title": "CodeOut",
        "description": "A classifier code: name and path in two languages; `general` is its type's general code."
      },
      "CodeState": {
        "type": "string",
        "enum": [
          "none",
          "suggested",
          "confirmed",
          "skipped"
        ],
        "title": "CodeState"
      },
      "ColourSpendOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "spent_uzs": {
            "type": "integer",
            "title": "Spent Uzs"
          },
          "cap_uzs": {
            "type": "integer",
            "title": "Cap Uzs"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "spent_uzs",
          "cap_uzs"
        ],
        "title": "ColourSpendOut",
        "description": "One colour's spend and ceiling (so'm); card-level calls count on colour 1."
      },
      "CompanyInstructionsOut": {
        "properties": {
          "text": {
            "type": "null",
            "title": "Text"
          },
          "length": {
            "type": "integer",
            "title": "Length",
            "default": 0
          },
          "max_length": {
            "type": "integer",
            "title": "Max Length",
            "default": 4000
          }
        },
        "type": "object",
        "title": "CompanyInstructionsOut",
        "description": "Always empty: company instructions are no longer stored and never reach the AI."
      },
      "ConnectionListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ConnectionRowOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "ConnectionListOut",
        "description": "The connections table: rows (without made-up data packages), the next cursor and the total."
      },
      "ConnectionOut": {
        "properties": {
          "install_status": {
            "$ref": "#/components/schemas/InstallStatus"
          },
          "source_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Slug"
          },
          "ready": {
            "type": "boolean",
            "title": "Ready"
          },
          "test": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TestStateOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "load": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoadStateOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "max_file_mb": {
            "type": "integer",
            "title": "Max File Mb"
          },
          "templates": {
            "items": {
              "$ref": "#/components/schemas/TemplateOut"
            },
            "type": "array",
            "title": "Templates"
          },
          "config": {
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "type": "object",
            "title": "Config"
          },
          "recent_loads": {
            "items": {
              "$ref": "#/components/schemas/LoadLineOut"
            },
            "type": "array",
            "title": "Recent Loads"
          },
          "paused": {
            "type": "boolean",
            "title": "Paused",
            "default": false
          },
          "refresh": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RefreshStateOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "progress": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunProgressOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "estimate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoadEstimateOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "removal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RemovalOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "install_status",
          "source_slug",
          "ready",
          "test",
          "load",
          "max_file_mb",
          "templates"
        ],
        "title": "ConnectionOut"
      },
      "ConnectionRowOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "title": {
            "$ref": "#/components/schemas/Localized"
          },
          "category": {
            "$ref": "#/components/schemas/PackageCategory"
          },
          "logo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo"
          },
          "install_id": {
            "type": "integer",
            "title": "Install Id"
          },
          "install_status": {
            "$ref": "#/components/schemas/InstallStatus"
          },
          "change_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Number"
          },
          "source_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Slug"
          },
          "state": {
            "$ref": "#/components/schemas/ConnectionState"
          },
          "last_sync_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Sync At"
          },
          "count": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CountOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "problem": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProblemOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "progress": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunProgressOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "estimate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoadEstimateOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_sync_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Sync At"
          },
          "history": {
            "type": "boolean",
            "title": "History",
            "default": false
          },
          "answers_ready": {
            "type": "boolean",
            "title": "Answers Ready",
            "default": false
          },
          "every_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Every Minutes"
          },
          "topics": {
            "items": {
              "$ref": "#/components/schemas/Localized"
            },
            "type": "array",
            "title": "Topics"
          },
          "questions": {
            "items": {
              "$ref": "#/components/schemas/Localized"
            },
            "type": "array",
            "title": "Questions"
          },
          "removal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RemovalOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "recommended": {
            "type": "boolean",
            "title": "Recommended",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "key",
          "title",
          "category",
          "install_id",
          "install_status",
          "change_number",
          "source_slug",
          "state",
          "last_sync_at",
          "count",
          "problem"
        ],
        "title": "ConnectionRowOut"
      },
      "ConnectionState": {
        "type": "string",
        "enum": [
          "working",
          "failed",
          "pending",
          "loading",
          "paused",
          "deleting"
        ]
      },
      "ContactOut": {
        "properties": {
          "sent_at": {
            "type": "string",
            "format": "date-time",
            "title": "Sent At"
          }
        },
        "type": "object",
        "required": [
          "sent_at"
        ],
        "title": "ContactOut"
      },
      "ContactRequestIn": {
        "properties": {
          "topic": {
            "$ref": "#/components/schemas/RequestTopic"
          },
          "plan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlanKey"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32,
                "pattern": "^[0-9+() -]*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          }
        },
        "type": "object",
        "required": [
          "topic"
        ],
        "title": "ContactRequestIn",
        "description": "A customer request: payment or a plan (Enterprise, or an upgrade the balance cannot cover), with an optional phone."
      },
      "ContractMode": {
        "type": "string",
        "enum": [
          "evolve",
          "freeze",
          "discard_row",
          "discard_value"
        ],
        "title": "ContractMode"
      },
      "CountOut": {
        "properties": {
          "value": {
            "type": "integer",
            "title": "Value"
          },
          "label": {
            "$ref": "#/components/schemas/Localized"
          }
        },
        "type": "object",
        "required": [
          "value",
          "label"
        ],
        "title": "CountOut"
      },
      "DailyCardIn": {
        "properties": {
          "message_id": {
            "type": "integer",
            "minimum": 1.0,
            "title": "Message Id"
          },
          "block_index": {
            "type": "integer",
            "exclusiveMaximum": 10.0,
            "minimum": 0.0,
            "title": "Block Index"
          },
          "hour": {
            "type": "integer",
            "maximum": 23.0,
            "minimum": 0.0,
            "title": "Hour",
            "default": 9
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message_id",
          "block_index"
        ],
        "title": "DailyCardIn",
        "description": "`POST …/daily-cards`: an answer card from the caller's own chat and the hour to send it (workspace time, default 09:00)."
      },
      "DailyCardOut": {
        "properties": {
          "dashboard": {
            "type": "string",
            "title": "Dashboard"
          },
          "chart": {
            "type": "string",
            "title": "Chart"
          },
          "at": {
            "type": "string",
            "title": "At"
          },
          "linked": {
            "type": "boolean",
            "title": "Linked"
          },
          "pending_change": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pending Change"
          }
        },
        "type": "object",
        "required": [
          "dashboard",
          "chart",
          "at",
          "linked"
        ],
        "title": "DailyCardOut"
      },
      "DailySchedule": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "daily",
            "title": "Kind"
          },
          "at": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
            "title": "At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "at"
        ],
        "title": "DailySchedule"
      },
      "DashboardCreateIn": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1
              },
              {
                "$ref": "#/components/schemas/LocalizedTitle"
              }
            ],
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000,
                "minLength": 1
              },
              {
                "$ref": "#/components/schemas/LocalizedText"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,62}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "title"
        ],
        "title": "DashboardCreateIn"
      },
      "DashboardListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/DashboardSummaryOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "DashboardListOut"
      },
      "DashboardPatchIn": {
        "properties": {
          "expected_version": {
            "type": "integer",
            "maximum": 2147483647.0,
            "minimum": 1.0,
            "title": "Expected Version"
          },
          "title": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocalizedTitle"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocalizedText"
              },
              {
                "type": "null"
              }
            ]
          },
          "filters": {
            "anyOf": [
              {
                "items": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DateRangeFilter"
                    },
                    {
                      "$ref": "#/components/schemas/DimensionFilter"
                    }
                  ],
                  "discriminator": {
                    "propertyName": "kind",
                    "mapping": {
                      "date_range": "#/components/schemas/DateRangeFilter",
                      "dimension": "#/components/schemas/DimensionFilter"
                    }
                  }
                },
                "type": "array",
                "maxItems": 10
              },
              {
                "type": "null"
              }
            ],
            "title": "Filters"
          },
          "layout": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/LayoutItem"
                },
                "type": "array",
                "maxItems": 40
              },
              {
                "type": "null"
              }
            ],
            "title": "Layout"
          },
          "access": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Principals"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "expected_version"
        ],
        "title": "DashboardPatchIn"
      },
      "DashboardSummaryOut": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_starter": {
            "type": "boolean",
            "title": "Is Starter"
          },
          "tiles": {
            "type": "integer",
            "title": "Tiles"
          },
          "version": {
            "type": "integer",
            "title": "Version"
          },
          "refresh_mode": {
            "$ref": "#/components/schemas/RefreshMode"
          },
          "live_mode": {
            "type": "boolean",
            "title": "Live Mode"
          },
          "refreshed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refreshed At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "title",
          "description",
          "is_starter",
          "tiles",
          "version",
          "refresh_mode",
          "live_mode",
          "refreshed_at",
          "updated_at"
        ],
        "title": "DashboardSummaryOut"
      },
      "DataPlaneOut": {
        "properties": {
          "status": {
            "$ref": "#/components/schemas/DataPlaneStatus"
          },
          "cell": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CellOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "database": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Database"
          },
          "ddl_version": {
            "type": "integer",
            "title": "Ddl Version"
          },
          "latest_ddl_version": {
            "type": "integer",
            "title": "Latest Ddl Version"
          },
          "ingest_state": {
            "$ref": "#/components/schemas/IngestState"
          },
          "storage": {
            "$ref": "#/components/schemas/DataplaneStorageOut"
          },
          "ingest": {
            "$ref": "#/components/schemas/DataplaneIngestMonthOut"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "status",
          "cell",
          "database",
          "ddl_version",
          "latest_ddl_version",
          "ingest_state",
          "storage",
          "ingest",
          "error_code",
          "updated_at"
        ],
        "title": "DataPlaneOut"
      },
      "DataPlaneStatus": {
        "type": "string",
        "enum": [
          "not_provisioned",
          "requested",
          "provisioning",
          "active",
          "moving",
          "retired",
          "failed"
        ],
        "title": "DataPlaneStatus"
      },
      "DataPlaneTablesOut": {
        "properties": {
          "status": {
            "$ref": "#/components/schemas/TablesStatus"
          },
          "collected_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Collected At"
          },
          "refreshing": {
            "type": "boolean",
            "title": "Refreshing"
          },
          "truncated": {
            "type": "boolean",
            "title": "Truncated"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/WarehouseSchemaOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "status",
          "collected_at",
          "refreshing",
          "truncated",
          "items",
          "total"
        ],
        "title": "DataPlaneTablesOut"
      },
      "DateRange": {
        "properties": {
          "start": {
            "type": "string",
            "format": "date",
            "title": "Start"
          },
          "end": {
            "type": "string",
            "format": "date",
            "title": "End"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "start",
          "end"
        ],
        "title": "DateRange"
      },
      "DateRangeFilter": {
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,62}$",
            "title": "Id"
          },
          "kind": {
            "type": "string",
            "const": "date_range",
            "title": "Kind"
          },
          "label": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocalizedTitle"
              },
              {
                "type": "null"
              }
            ]
          },
          "default": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RelativeRange"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "kind"
        ],
        "title": "DateRangeFilter"
      },
      "DayUsageOut": {
        "properties": {
          "day": {
            "type": "string",
            "format": "date",
            "title": "Day"
          },
          "totals": {
            "$ref": "#/components/schemas/MonitoringUsageTotalsOut"
          }
        },
        "type": "object",
        "required": [
          "day",
          "totals"
        ],
        "title": "DayUsageOut"
      },
      "DeliveryChannel": {
        "type": "string",
        "enum": [
          "telegram",
          "email",
          "pdf"
        ],
        "title": "DeliveryChannel"
      },
      "DeliveryFormat": {
        "properties": {
          "images": {
            "type": "boolean",
            "title": "Images",
            "default": true
          },
          "summary": {
            "type": "boolean",
            "title": "Summary",
            "default": true
          },
          "link": {
            "type": "boolean",
            "title": "Link",
            "default": true
          },
          "protect_content": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Protect Content"
          },
          "locale": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Locale"
              },
              {
                "type": "null"
              }
            ]
          },
          "attach_pdf": {
            "type": "boolean",
            "title": "Attach Pdf",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DeliveryFormat"
      },
      "DeliveryFreshness": {
        "properties": {
          "wait_minutes": {
            "type": "integer",
            "maximum": 240.0,
            "minimum": 0.0,
            "title": "Wait Minutes",
            "default": 60
          },
          "label_if_late": {
            "type": "boolean",
            "title": "Label If Late",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DeliveryFreshness"
      },
      "DeliveryIn": {
        "properties": {
          "key": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,62}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          },
          "channel": {
            "$ref": "#/components/schemas/DeliveryChannel",
            "default": "telegram"
          },
          "schedule": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/IntervalSchedule"
              },
              {
                "$ref": "#/components/schemas/HourlySchedule"
              },
              {
                "$ref": "#/components/schemas/DailySchedule"
              },
              {
                "$ref": "#/components/schemas/WeeklySchedule"
              }
            ],
            "title": "Schedule",
            "discriminator": {
              "propertyName": "kind",
              "mapping": {
                "daily": "#/components/schemas/DailySchedule",
                "hourly": "#/components/schemas/HourlySchedule",
                "interval": "#/components/schemas/IntervalSchedule",
                "weekly": "#/components/schemas/WeeklySchedule"
              }
            }
          },
          "recipients": {
            "$ref": "#/components/schemas/Principals"
          },
          "format": {
            "$ref": "#/components/schemas/DeliveryFormat"
          },
          "freshness": {
            "$ref": "#/components/schemas/DeliveryFreshness"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "schedule"
        ],
        "title": "DeliveryIn",
        "description": "`PUT …/deliveries/{key}`: the `delivery:` entry of `content/dashboards/<slug>.yml`; the key comes from the path."
      },
      "DeliveryListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/DeliveryOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "DeliveryListOut"
      },
      "DeliveryOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "channel": {
            "type": "string",
            "title": "Channel"
          },
          "schedule": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule"
          },
          "recipients": {
            "additionalProperties": true,
            "type": "object",
            "title": "Recipients"
          },
          "format": {
            "additionalProperties": true,
            "type": "object",
            "title": "Format"
          },
          "freshness": {
            "additionalProperties": true,
            "type": "object",
            "title": "Freshness"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "next_run_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Run At"
          },
          "last_run_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Run At"
          },
          "last_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Status"
          },
          "subscribed": {
            "type": "boolean",
            "title": "Subscribed"
          },
          "subscription": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SubscriptionMode"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "key",
          "channel",
          "schedule",
          "recipients",
          "format",
          "freshness",
          "enabled",
          "next_run_at",
          "last_run_at",
          "last_status",
          "subscribed",
          "subscription"
        ],
        "title": "DeliveryOut"
      },
      "DeliveryRunListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/DeliveryRunOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "DeliveryRunListOut"
      },
      "DeliveryRunOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "dashboard": {
            "type": "string",
            "title": "Dashboard"
          },
          "delivery": {
            "type": "string",
            "title": "Delivery"
          },
          "trigger": {
            "type": "string",
            "title": "Trigger"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "skip_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skip Reason"
          },
          "scheduled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled At"
          },
          "waited_seconds": {
            "type": "integer",
            "title": "Waited Seconds"
          },
          "labelled_late": {
            "type": "boolean",
            "title": "Labelled Late"
          },
          "data_as_of": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data As Of"
          },
          "recipients_total": {
            "type": "integer",
            "title": "Recipients Total"
          },
          "recipients_sent": {
            "type": "integer",
            "title": "Recipients Sent"
          },
          "recipients_skipped": {
            "type": "integer",
            "title": "Recipients Skipped"
          },
          "recipients_failed": {
            "type": "integer",
            "title": "Recipients Failed"
          },
          "requested_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested By"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "dashboard",
          "delivery",
          "trigger",
          "status",
          "skip_reason",
          "scheduled_at",
          "waited_seconds",
          "labelled_late",
          "data_as_of",
          "recipients_total",
          "recipients_sent",
          "recipients_skipped",
          "recipients_failed",
          "requested_by",
          "error_code",
          "started_at",
          "finished_at",
          "created_at"
        ],
        "title": "DeliveryRunOut"
      },
      "DeliveryRunStatus": {
        "type": "string",
        "enum": [
          "queued",
          "waiting",
          "running",
          "sent",
          "partial",
          "failed",
          "skipped"
        ],
        "title": "DeliveryRunStatus"
      },
      "DeliverySavedOut": {
        "properties": {
          "version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "change_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Number"
          },
          "delivery": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DeliveryOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "version",
          "change_number",
          "delivery"
        ],
        "title": "DeliverySavedOut",
        "description": "`version`: the content version saved directly; `change_number`: the change waiting for approval."
      },
      "DeliveryTestOut": {
        "properties": {
          "delivery_run_id": {
            "type": "integer",
            "title": "Delivery Run Id"
          },
          "status": {
            "$ref": "#/components/schemas/DeliveryRunStatus"
          }
        },
        "type": "object",
        "required": [
          "delivery_run_id",
          "status"
        ],
        "title": "DeliveryTestOut"
      },
      "DeltaKind": {
        "type": "string",
        "enum": [
          "added",
          "modified",
          "deleted"
        ],
        "title": "DeltaKind"
      },
      "DeploymentDetailOut": {
        "properties": {
          "version": {
            "type": "integer",
            "title": "Version"
          },
          "kind": {
            "$ref": "#/components/schemas/DeploymentKind"
          },
          "status": {
            "$ref": "#/components/schemas/DeploymentStatus"
          },
          "commit_oid": {
            "type": "string",
            "title": "Commit Oid"
          },
          "change_request_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Request Id"
          },
          "rolled_back_to_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rolled Back To Version"
          },
          "deployed_by_kind": {
            "type": "string",
            "title": "Deployed By Kind"
          },
          "deployed_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployed By"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "change_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Number"
          },
          "is_current": {
            "type": "boolean",
            "title": "Is Current",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "version",
          "kind",
          "status",
          "commit_oid",
          "change_request_id",
          "rolled_back_to_version",
          "deployed_by_kind",
          "deployed_by",
          "error_code",
          "error_message",
          "created_at",
          "updated_at"
        ],
        "title": "DeploymentDetailOut"
      },
      "DeploymentKind": {
        "type": "string",
        "enum": [
          "change",
          "content",
          "rollback",
          "system"
        ],
        "title": "DeploymentKind"
      },
      "DeploymentListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/DeploymentOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "DeploymentListOut"
      },
      "DeploymentOut": {
        "properties": {
          "version": {
            "type": "integer",
            "title": "Version"
          },
          "kind": {
            "$ref": "#/components/schemas/DeploymentKind"
          },
          "status": {
            "$ref": "#/components/schemas/DeploymentStatus"
          },
          "commit_oid": {
            "type": "string",
            "title": "Commit Oid"
          },
          "change_request_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Request Id"
          },
          "rolled_back_to_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rolled Back To Version"
          },
          "deployed_by_kind": {
            "type": "string",
            "title": "Deployed By Kind"
          },
          "deployed_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployed By"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "version",
          "kind",
          "status",
          "commit_oid",
          "change_request_id",
          "rolled_back_to_version",
          "deployed_by_kind",
          "deployed_by",
          "error_code",
          "error_message",
          "created_at",
          "updated_at"
        ],
        "title": "DeploymentOut"
      },
      "DeploymentStatus": {
        "type": "string",
        "enum": [
          "pending",
          "building",
          "publishing",
          "live",
          "failed",
          "superseded"
        ],
        "title": "DeploymentStatus"
      },
      "DesignIn": {
        "properties": {
          "style": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,62}$",
            "title": "Style"
          },
          "level": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Level"
              },
              {
                "type": "null"
              }
            ]
          },
          "slots": {
            "anyOf": [
              {
                "items": {
                  "type": "integer",
                  "maximum": 9.0,
                  "minimum": 1.0
                },
                "type": "array",
                "maxItems": 9,
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Slots"
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "variant": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variant"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "style"
        ],
        "title": "DesignIn",
        "description": "Make the images: style and quality (`level`, else the card's); one slot and a note = \"Qayta yaratish\"; `variant` = that colour only: with a slot one image of it, without its missing or fallen-back slots."
      },
      "DetailEscalationOut": {
        "properties": {
          "from_model": {
            "type": "string",
            "title": "From Model"
          },
          "from_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "From Label"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "from_model",
          "from_label",
          "reason"
        ],
        "title": "DetailEscalationOut",
        "description": "A Tezkor answer checked again on the Asosiy tier: the first attempt's model and why it was checked."
      },
      "DetailStepKind": {
        "type": "string",
        "enum": [
          "model",
          "tool"
        ],
        "title": "DetailStepKind"
      },
      "DetailStepOut": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/DetailStepKind"
          },
          "round": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Round"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "duration_ms": {
            "type": "integer",
            "title": "Duration Ms"
          },
          "tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokens"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "title": "Started At"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "name",
          "status",
          "duration_ms",
          "started_at"
        ],
        "title": "DetailStepOut"
      },
      "DetailTokensOut": {
        "properties": {
          "input": {
            "type": "integer",
            "title": "Input"
          },
          "output": {
            "type": "integer",
            "title": "Output"
          },
          "cached": {
            "type": "integer",
            "title": "Cached"
          },
          "cache_write": {
            "type": "integer",
            "title": "Cache Write"
          },
          "reasoning": {
            "type": "integer",
            "title": "Reasoning"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "input",
          "output",
          "cached",
          "cache_write",
          "reasoning",
          "total"
        ],
        "title": "DetailTokensOut"
      },
      "Detector": {
        "type": "string",
        "enum": [
          "change",
          "trend",
          "concentration"
        ],
        "title": "Detector"
      },
      "DimensionFilter": {
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,62}$",
            "title": "Id"
          },
          "kind": {
            "type": "string",
            "const": "dimension",
            "title": "Kind"
          },
          "label": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocalizedTitle"
              },
              {
                "type": "null"
              }
            ]
          },
          "column": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,62}$",
            "title": "Column"
          },
          "default": {
            "items": {
              "type": "string",
              "maxLength": 256
            },
            "type": "array",
            "maxItems": 100,
            "title": "Default"
          },
          "multiple": {
            "type": "boolean",
            "title": "Multiple",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "kind",
          "column"
        ],
        "title": "DimensionFilter"
      },
      "Direction": {
        "type": "string",
        "enum": [
          "up",
          "down"
        ],
        "title": "Direction"
      },
      "DocumentDetailOut": {
        "properties": {
          "document_id": {
            "type": "integer",
            "title": "Document Id"
          },
          "chat_id": {
            "type": "string",
            "format": "uuid",
            "title": "Chat Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "content_type": {
            "type": "string",
            "title": "Content Type"
          },
          "size": {
            "type": "integer",
            "title": "Size"
          },
          "pages": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pages"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "kind": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DocumentKind"
              },
              {
                "type": "null"
              }
            ]
          },
          "supplier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supplier"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "total": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          },
          "method": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ReadMethod"
              },
              {
                "type": "null"
              }
            ]
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/DocumentRowOut"
            },
            "type": "array",
            "title": "Rows"
          },
          "unsure_rows": {
            "type": "integer",
            "title": "Unsure Rows"
          },
          "warnings": {
            "items": {
              "$ref": "#/components/schemas/DocumentWarning"
            },
            "type": "array",
            "title": "Warnings"
          }
        },
        "type": "object",
        "required": [
          "document_id",
          "chat_id",
          "name",
          "content_type",
          "size",
          "pages",
          "status",
          "kind",
          "supplier",
          "currency",
          "total",
          "method",
          "rows",
          "unsure_rows",
          "warnings"
        ],
        "title": "DocumentDetailOut"
      },
      "DocumentIn": {
        "properties": {
          "document_id": {
            "type": "integer",
            "maximum": 9.223372036854776e+18,
            "minimum": 1.0,
            "title": "Document Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "document_id"
        ],
        "title": "DocumentIn"
      },
      "DocumentKind": {
        "type": "string",
        "enum": [
          "price_list",
          "order_list",
          "invoice",
          "receipt",
          "z_report",
          "screenshot",
          "debt_list",
          "payment",
          "product_photo",
          "shelf",
          "chart",
          "api_docs",
          "other"
        ],
        "title": "DocumentKind"
      },
      "DocumentOut": {
        "properties": {
          "document_id": {
            "type": "integer",
            "title": "Document Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "size": {
            "type": "integer",
            "title": "Size"
          },
          "content_type": {
            "type": "string",
            "title": "Content Type"
          },
          "pages": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pages"
          }
        },
        "type": "object",
        "required": [
          "document_id",
          "name",
          "size",
          "content_type",
          "pages"
        ],
        "title": "DocumentOut"
      },
      "DocumentRowOut": {
        "properties": {
          "line": {
            "type": "integer",
            "title": "Line"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "sku": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sku"
          },
          "barcode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Barcode"
          },
          "quantity": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "price": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          },
          "amount": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount"
          },
          "confidence": {
            "type": "number",
            "title": "Confidence"
          },
          "unsure": {
            "type": "boolean",
            "title": "Unsure"
          },
          "checks": {
            "items": {
              "$ref": "#/components/schemas/RowCheck"
            },
            "type": "array",
            "title": "Checks"
          },
          "fixed": {
            "type": "boolean",
            "title": "Fixed"
          }
        },
        "type": "object",
        "required": [
          "line",
          "name",
          "sku",
          "barcode",
          "quantity",
          "unit",
          "price",
          "amount",
          "confidence",
          "unsure",
          "checks",
          "fixed"
        ],
        "title": "DocumentRowOut"
      },
      "DocumentRowPatch": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "sku": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ],
            "title": "Sku"
          },
          "barcode": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{8,14}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Barcode"
          },
          "quantity": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
                  }
                ],
                "decimal_places": 4,
                "ge": 0,
                "lt": "1E+15",
                "max_digits": 21
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "price": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
                  }
                ],
                "decimal_places": 4,
                "ge": 0,
                "lt": "1E+15",
                "max_digits": 21
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          },
          "amount": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
                  }
                ],
                "decimal_places": 4,
                "ge": 0,
                "lt": "1E+15",
                "max_digits": 21
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DocumentRowPatch",
        "description": "A row fixed by a person: only the sent fields change, `null` clears a field (except the name)."
      },
      "DocumentUploadOut": {
        "properties": {
          "document_id": {
            "type": "integer",
            "title": "Document Id"
          },
          "chat_id": {
            "type": "string",
            "format": "uuid",
            "title": "Chat Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "size": {
            "type": "integer",
            "title": "Size"
          },
          "content_type": {
            "type": "string",
            "title": "Content Type"
          },
          "pages": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pages"
          }
        },
        "type": "object",
        "required": [
          "document_id",
          "chat_id",
          "name",
          "size",
          "content_type"
        ],
        "title": "DocumentUploadOut"
      },
      "DocumentWarning": {
        "type": "string",
        "enum": [
          "total_mismatch",
          "truncated",
          "rows_dropped",
          "private_removed"
        ],
        "title": "DocumentWarning"
      },
      "DownloadArgs": {
        "properties": {
          "click": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "Click"
          },
          "resource": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,62}$",
            "title": "Resource"
          },
          "format": {
            "$ref": "#/components/schemas/DownloadFormat",
            "default": "csv"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "click",
          "resource"
        ],
        "title": "DownloadArgs"
      },
      "DownloadFormat": {
        "type": "string",
        "enum": [
          "csv",
          "xlsx",
          "xls"
        ],
        "title": "DownloadFormat"
      },
      "DownloadStep": {
        "properties": {
          "download": {
            "$ref": "#/components/schemas/DownloadArgs"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "download"
        ],
        "title": "DownloadStep"
      },
      "DropFieldsStep": {
        "properties": {
          "drop_fields": {
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_$.\\[\\]*-]{1,200}$"
            },
            "type": "array",
            "maxItems": 50,
            "minItems": 1,
            "title": "Drop Fields"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "drop_fields"
        ],
        "title": "DropFieldsStep"
      },
      "EgressListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/EgressRuleOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "EgressListOut"
      },
      "EgressProtocol": {
        "type": "string",
        "enum": [
          "tls",
          "tcp"
        ],
        "title": "EgressProtocol"
      },
      "EgressPurpose": {
        "type": "string",
        "enum": [
          "api",
          "db",
          "oauth",
          "cdn"
        ],
        "title": "EgressPurpose"
      },
      "EgressRequest": {
        "properties": {
          "host": {
            "type": "string",
            "maxLength": 253,
            "minLength": 1,
            "title": "Host"
          },
          "port": {
            "type": "integer",
            "maximum": 65535.0,
            "minimum": 1.0,
            "title": "Port"
          },
          "protocol": {
            "$ref": "#/components/schemas/EgressProtocol"
          },
          "purpose": {
            "$ref": "#/components/schemas/EgressPurpose",
            "default": "api"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "host",
          "port",
          "protocol"
        ],
        "title": "EgressRequest"
      },
      "EgressRuleOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "host": {
            "type": "string",
            "title": "Host"
          },
          "port": {
            "type": "integer",
            "title": "Port"
          },
          "protocol": {
            "type": "string",
            "title": "Protocol"
          },
          "purpose": {
            "type": "string",
            "title": "Purpose"
          },
          "status": {
            "$ref": "#/components/schemas/EgressRuleStatus"
          },
          "requested_by_kind": {
            "type": "string",
            "title": "Requested By Kind"
          },
          "approved_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved By"
          },
          "approved_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approved At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "host",
          "port",
          "protocol",
          "purpose",
          "status",
          "requested_by_kind",
          "approved_by",
          "approved_at",
          "created_at"
        ],
        "title": "EgressRuleOut"
      },
      "EgressRuleStatus": {
        "type": "string",
        "enum": [
          "pending",
          "approved",
          "revoked"
        ],
        "title": "EgressRuleStatus"
      },
      "EjectRequest": {
        "properties": {
          "path": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "Path"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "path"
        ],
        "title": "EjectRequest"
      },
      "EjectResultOut": {
        "properties": {
          "install": {
            "$ref": "#/components/schemas/InstallOut"
          },
          "change_number": {
            "type": "integer",
            "title": "Change Number"
          },
          "path": {
            "type": "string",
            "title": "Path"
          },
          "ejected_to": {
            "type": "string",
            "title": "Ejected To"
          }
        },
        "type": "object",
        "required": [
          "install",
          "change_number",
          "path",
          "ejected_to"
        ],
        "title": "EjectResultOut"
      },
      "EntryKind": {
        "type": "string",
        "enum": [
          "topup",
          "subscription",
          "usage",
          "adjustment",
          "refund",
          "upgrade",
          "downgrade",
          "service"
        ],
        "title": "EntryKind"
      },
      "EntryListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/EntryOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "EntryListOut"
      },
      "EntryOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "kind": {
            "$ref": "#/components/schemas/EntryKind"
          },
          "amount_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Amount Uzs"
          },
          "period_start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period Start"
          },
          "period_end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End"
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UsagePartsOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "value_uzs": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value Uzs"
          },
          "service": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "title": "Occurred At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "kind",
          "amount_uzs",
          "period_start",
          "period_end",
          "method",
          "provider",
          "reference",
          "note",
          "occurred_at",
          "created_at"
        ],
        "title": "EntryOut",
        "description": "A ledger row as the customer sees it: the amount in so'm and usage parts at the customer's price; no cost, rate or markup."
      },
      "ExploreColumn": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "type": {
            "type": "string",
            "title": "Type"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "type"
        ],
        "title": "ExploreColumn"
      },
      "ExploreQueryIn": {
        "properties": {
          "sql": {
            "type": "string",
            "maxLength": 20000,
            "minLength": 1,
            "title": "Sql"
          },
          "limit": {
            "type": "integer",
            "maximum": 1000.0,
            "minimum": 1.0,
            "title": "Limit",
            "default": 200
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "sql"
        ],
        "title": "ExploreQueryIn"
      },
      "ExploreQueryOut": {
        "properties": {
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ExploreColumn"
            },
            "type": "array",
            "title": "Columns"
          },
          "rows": {
            "items": {
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "array",
            "title": "Rows"
          },
          "row_count": {
            "type": "integer",
            "title": "Row Count"
          },
          "truncated": {
            "type": "boolean",
            "title": "Truncated"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "duration_ms": {
            "type": "integer",
            "title": "Duration Ms"
          }
        },
        "type": "object",
        "required": [
          "columns",
          "rows",
          "row_count",
          "truncated",
          "limit",
          "duration_ms"
        ],
        "title": "ExploreQueryOut"
      },
      "ExportState": {
        "type": "string",
        "enum": [
          "pending",
          "synced",
          "diverged",
          "error"
        ],
        "title": "ExportState"
      },
      "ExportStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "ready",
          "failed",
          "expired"
        ],
        "title": "ExportStatus"
      },
      "Feature": {
        "type": "string",
        "enum": [
          "semantic_layers",
          "dashboards",
          "telegram_delivery",
          "groups",
          "row_filters",
          "alerts",
          "email_delivery",
          "browser_connectors",
          "git_sync",
          "byo_warehouse",
          "partner_mode",
          "sso",
          "voice",
          "documents",
          "analyst",
          "skills",
          "advisor",
          "listing"
        ],
        "title": "Feature"
      },
      "FeedbackIn": {
        "properties": {
          "value": {
            "$ref": "#/components/schemas/FeedbackValue"
          },
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FeedbackReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "shared": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shared"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "value"
        ],
        "title": "FeedbackIn",
        "description": "A rating of an answer: `up` or `down`; a reason code only with `down`; an optional note (up to 500 characters); `shared` sends this one question and answer to Databek (`true`), takes it back (`false`), and leaves it as it is when omitted; only with `down`."
      },
      "FeedbackOut": {
        "properties": {
          "value": {
            "$ref": "#/components/schemas/FeedbackValue"
          },
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FeedbackReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "shared": {
            "type": "boolean",
            "title": "Shared",
            "default": false
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "value",
          "updated_at"
        ],
        "title": "FeedbackOut",
        "description": "The caller's rating of an answer: value, reason, note (secrets masked) and when it last changed."
      },
      "FeedbackReason": {
        "type": "string",
        "enum": [
          "wrong",
          "off_topic",
          "incomplete",
          "unclear",
          "other"
        ],
        "title": "FeedbackReason"
      },
      "FeedbackValue": {
        "type": "string",
        "enum": [
          "up",
          "down"
        ],
        "title": "FeedbackValue"
      },
      "FieldFilter": {
        "properties": {
          "path": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_$.\\[\\]*-]{1,200}$",
            "title": "Path"
          },
          "op": {
            "type": "string",
            "enum": [
              "eq",
              "ne",
              "in",
              "not_in"
            ],
            "title": "Op"
          },
          "value": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "items": {
                  "type": "string",
                  "maxLength": 256
                },
                "type": "array",
                "maxItems": 100
              }
            ],
            "title": "Value"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "path",
          "op",
          "value"
        ],
        "title": "FieldFilter"
      },
      "FileDiffOut": {
        "properties": {
          "path": {
            "type": "string",
            "title": "Path"
          },
          "change": {
            "$ref": "#/components/schemas/DeltaKind"
          },
          "old_oid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Old Oid"
          },
          "new_oid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "New Oid"
          },
          "additions": {
            "type": "integer",
            "title": "Additions"
          },
          "deletions": {
            "type": "integer",
            "title": "Deletions"
          },
          "patch": {
            "type": "string",
            "title": "Patch"
          }
        },
        "type": "object",
        "required": [
          "path",
          "change",
          "old_oid",
          "new_oid",
          "additions",
          "deletions",
          "patch"
        ],
        "title": "FileDiffOut"
      },
      "FileKind": {
        "type": "string",
        "enum": [
          "workspace",
          "packages_lock",
          "source",
          "files",
          "connector_code",
          "chart",
          "dashboard",
          "package"
        ],
        "title": "FileKind"
      },
      "FileState": {
        "type": "string",
        "enum": [
          "pending",
          "too_large",
          "loaded",
          "superseded",
          "unmatched",
          "earlier"
        ],
        "title": "FileState",
        "description": "A file's state in the list: the recorded load state, or the one computed from the plan (`pending`, `too_large`, …)."
      },
      "FillArgs": {
        "properties": {
          "selector": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "Selector"
          },
          "secret": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,62}$",
            "title": "Secret"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "selector",
          "secret"
        ],
        "title": "FillArgs"
      },
      "FillStep": {
        "properties": {
          "fill": {
            "$ref": "#/components/schemas/FillArgs"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "fill"
        ],
        "title": "FillStep"
      },
      "FilterStep": {
        "properties": {
          "filter": {
            "$ref": "#/components/schemas/FieldFilter"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "filter"
        ],
        "title": "FilterStep"
      },
      "FilterValueKind": {
        "type": "string",
        "enum": [
          "date_range",
          "dimension"
        ],
        "title": "FilterValueKind"
      },
      "FilterValueOut": {
        "properties": {
          "value": {
            "type": "string",
            "title": "Value"
          }
        },
        "type": "object",
        "required": [
          "value"
        ],
        "title": "FilterValueOut"
      },
      "FilterValuesOut": {
        "properties": {
          "filter": {
            "type": "string",
            "title": "Filter"
          },
          "kind": {
            "$ref": "#/components/schemas/FilterValueKind"
          },
          "member": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/FilterValueOut"
            },
            "type": "array",
            "title": "Items"
          },
          "restricted": {
            "type": "boolean",
            "title": "Restricted",
            "default": false
          },
          "truncated": {
            "type": "boolean",
            "title": "Truncated",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "filter",
          "kind",
          "items"
        ],
        "title": "FilterValuesOut"
      },
      "FindingKind": {
        "type": "string",
        "enum": [
          "risk",
          "opportunity",
          "change"
        ],
        "title": "FindingKind"
      },
      "FindingListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/FindingOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "FindingListOut"
      },
      "FindingNextOut": {
        "properties": {
          "question": {
            "$ref": "#/components/schemas/TextsOut"
          }
        },
        "type": "object",
        "required": [
          "question"
        ],
        "title": "FindingNextOut",
        "description": "Next step: a ready-to-ask chat question (in three languages)."
      },
      "FindingOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "kind": {
            "$ref": "#/components/schemas/FindingKind"
          },
          "detector": {
            "$ref": "#/components/schemas/Detector"
          },
          "direction": {
            "$ref": "#/components/schemas/Direction"
          },
          "measure": {
            "type": "string",
            "title": "Measure"
          },
          "label": {
            "$ref": "#/components/schemas/TextsOut"
          },
          "period": {
            "$ref": "#/components/schemas/PeriodOut"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "change_pct": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Pct"
          },
          "text": {
            "$ref": "#/components/schemas/TextsOut"
          },
          "next": {
            "$ref": "#/components/schemas/FindingNextOut"
          },
          "data_day": {
            "type": "string",
            "format": "date",
            "title": "Data Day"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "kind",
          "detector",
          "direction",
          "measure",
          "label",
          "period",
          "text",
          "next",
          "data_day",
          "created_at"
        ],
        "title": "FindingOut",
        "description": "A finding card: kind, detector, measure name, period, the number (`value`, `change_pct`), the sentence and the next step."
      },
      "FindingStateOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "done": {
            "type": "boolean",
            "title": "Done"
          },
          "muted_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Muted Until"
          }
        },
        "type": "object",
        "required": [
          "id",
          "done"
        ],
        "title": "FindingStateOut",
        "description": "The caller's mark: `done` — Done; `muted_until` — Not needed (the measure and detector stay hidden until then)."
      },
      "ForgotPasswordRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "human": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/HumanProof"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "email"
        ],
        "title": "ForgotPasswordRequest"
      },
      "FormField": {
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "category",
              "title",
              "short",
              "description",
              "photos",
              "sku",
              "barcode",
              "code",
              "width",
              "length",
              "height",
              "weight",
              "price",
              "discount",
              "features"
            ],
            "title": "Key"
          },
          "names": {
            "$ref": "#/components/schemas/Words"
          },
          "limit": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 30000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Limit"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "mm",
                  "g",
                  "uzs"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "required": {
            "type": "boolean",
            "title": "Required",
            "default": false
          },
          "source": {
            "type": "string",
            "enum": [
              "ai",
              "estimate",
              "seller"
            ],
            "title": "Source",
            "default": "ai"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "key",
          "names"
        ],
        "title": "FormField",
        "description": "One field of the cabinet form: the card key, its label, length limit, unit, whether it is required and its source (`ai` - we write it, `estimate` - our estimate, `seller` - the seller types it)."
      },
      "FormRule": {
        "properties": {
          "steps": {
            "items": {
              "$ref": "#/components/schemas/FormStep"
            },
            "type": "array",
            "maxItems": 5,
            "title": "Steps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "FormRule",
        "description": "The product form of the seller cabinet: steps and fields in the cabinet's order (the result page is drawn from it)."
      },
      "FormStep": {
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "card",
              "sku",
              "price",
              "name",
              "tax",
              "features"
            ],
            "title": "Id"
          },
          "names": {
            "$ref": "#/components/schemas/Words"
          },
          "language": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z]{2}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FormField"
            },
            "type": "array",
            "maxItems": 12,
            "minItems": 1,
            "title": "Fields"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "names",
          "fields"
        ],
        "title": "FormStep",
        "description": "One step of the cabinet form: its name and its fields in order; `language` is the language its values are entered in."
      },
      "FormulaOut": {
        "properties": {
          "version": {
            "type": "string",
            "title": "Version"
          },
          "enforced": {
            "type": "boolean",
            "title": "Enforced"
          },
          "runner_cpu_second": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Runner Cpu Second"
          },
          "db_active_second": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Db Active Second"
          }
        },
        "type": "object",
        "required": [
          "version",
          "enforced",
          "runner_cpu_second",
          "db_active_second"
        ],
        "title": "FormulaOut"
      },
      "GitHubCallbackIn": {
        "properties": {
          "code": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Code"
          },
          "state": {
            "type": "string",
            "maxLength": 1024,
            "minLength": 16,
            "title": "State"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "code",
          "state"
        ],
        "title": "GitHubCallbackIn"
      },
      "GitHubGrantOut": {
        "properties": {
          "workspace_id": {
            "type": "integer",
            "title": "Workspace Id"
          },
          "grant": {
            "type": "string",
            "title": "Grant"
          }
        },
        "type": "object",
        "required": [
          "workspace_id",
          "grant"
        ],
        "title": "GitHubGrantOut"
      },
      "GitHubInstallOut": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "GitHubInstallOut"
      },
      "GitHubRepositoriesIn": {
        "properties": {
          "grant": {
            "type": "string",
            "maxLength": 1024,
            "minLength": 16,
            "title": "Grant"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "grant"
        ],
        "title": "GitHubRepositoriesIn"
      },
      "GitHubRepositoriesOut": {
        "properties": {
          "installation_id": {
            "type": "integer",
            "title": "Installation Id"
          },
          "account": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account"
          },
          "repositories": {
            "items": {
              "$ref": "#/components/schemas/GitHubRepositoryOut"
            },
            "type": "array",
            "title": "Repositories"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "installation_id",
          "account",
          "repositories",
          "total"
        ],
        "title": "GitHubRepositoriesOut"
      },
      "GitHubRepositoryOut": {
        "properties": {
          "full_name": {
            "type": "string",
            "title": "Full Name"
          },
          "private": {
            "type": "boolean",
            "title": "Private"
          },
          "default_branch": {
            "type": "string",
            "title": "Default Branch"
          },
          "connectable": {
            "type": "boolean",
            "title": "Connectable"
          }
        },
        "type": "object",
        "required": [
          "full_name",
          "private",
          "default_branch",
          "connectable"
        ],
        "title": "GitHubRepositoryOut"
      },
      "GitHubSetupIn": {
        "properties": {
          "installation_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Installation Id"
          },
          "setup_action": {
            "type": "string",
            "enum": [
              "install",
              "update",
              "request"
            ],
            "title": "Setup Action",
            "default": "install"
          },
          "state": {
            "type": "string",
            "maxLength": 1024,
            "minLength": 16,
            "title": "State"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "state"
        ],
        "title": "GitHubSetupIn"
      },
      "GitHubSetupOut": {
        "properties": {
          "workspace_id": {
            "type": "integer",
            "title": "Workspace Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "authorize",
              "requested"
            ],
            "title": "Status"
          },
          "authorize_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authorize Url"
          }
        },
        "type": "object",
        "required": [
          "workspace_id",
          "status",
          "authorize_url"
        ],
        "title": "GitHubSetupOut"
      },
      "GitRemoteOut": {
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/Provider"
          },
          "base_url": {
            "type": "string",
            "title": "Base Url"
          },
          "repository": {
            "type": "string",
            "title": "Repository"
          },
          "web_url": {
            "type": "string",
            "title": "Web Url"
          },
          "auth_kind": {
            "$ref": "#/components/schemas/AuthKind"
          },
          "installation_account": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Installation Account"
          },
          "export_branch": {
            "type": "string",
            "title": "Export Branch"
          },
          "import_branch": {
            "type": "string",
            "title": "Import Branch"
          },
          "export_state": {
            "$ref": "#/components/schemas/ExportState"
          },
          "import_state": {
            "$ref": "#/components/schemas/ImportState"
          },
          "exported_oid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exported Oid"
          },
          "exported_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exported At"
          },
          "remote_import_oid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Remote Import Oid"
          },
          "imported_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Imported At"
          },
          "import_change_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Import Change Number"
          },
          "conflict_paths": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Conflict Paths"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "checked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Checked At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "base_url",
          "repository",
          "web_url",
          "auth_kind",
          "installation_account",
          "export_branch",
          "import_branch",
          "export_state",
          "import_state",
          "exported_oid",
          "exported_at",
          "remote_import_oid",
          "imported_at",
          "import_change_number",
          "conflict_paths",
          "error_code",
          "error_message",
          "checked_at",
          "created_at"
        ],
        "title": "GitRemoteOut"
      },
      "GitSyncConnectIn": {
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/Provider"
          },
          "repository": {
            "type": "string",
            "maxLength": 255,
            "minLength": 3,
            "title": "Repository"
          },
          "base_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Url"
          },
          "auth": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/TokenAuth"
              },
              {
                "$ref": "#/components/schemas/AppAuth"
              }
            ],
            "title": "Auth",
            "discriminator": {
              "propertyName": "kind",
              "mapping": {
                "github_app": "#/components/schemas/AppAuth",
                "token": "#/components/schemas/TokenAuth"
              }
            }
          },
          "export_branch": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Export Branch",
            "default": "main"
          },
          "import_branch": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Import Branch",
            "default": "databek/changes"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "provider",
          "repository",
          "auth"
        ],
        "title": "GitSyncConnectIn"
      },
      "GitSyncConnectedOut": {
        "properties": {
          "remote": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GitRemoteOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "webhook_url": {
            "type": "string",
            "title": "Webhook Url"
          },
          "app_available": {
            "type": "boolean",
            "title": "App Available"
          },
          "webhook_secret": {
            "type": "string",
            "title": "Webhook Secret"
          }
        },
        "type": "object",
        "required": [
          "remote",
          "webhook_url",
          "app_available",
          "webhook_secret"
        ],
        "title": "GitSyncConnectedOut"
      },
      "GitSyncOut": {
        "properties": {
          "remote": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GitRemoteOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "webhook_url": {
            "type": "string",
            "title": "Webhook Url"
          },
          "app_available": {
            "type": "boolean",
            "title": "App Available"
          }
        },
        "type": "object",
        "required": [
          "remote",
          "webhook_url",
          "app_available"
        ],
        "title": "GitSyncOut"
      },
      "GotoArgs": {
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 500,
            "minLength": 9,
            "title": "Url"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "url"
        ],
        "title": "GotoArgs"
      },
      "GotoStep": {
        "properties": {
          "goto": {
            "$ref": "#/components/schemas/GotoArgs"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "goto"
        ],
        "title": "GotoStep"
      },
      "GroupCreateRequest": {
        "properties": {
          "slug": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,62}$",
            "title": "Slug"
          },
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "name"
        ],
        "title": "GroupCreateRequest"
      },
      "GroupListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/GroupOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "GroupListOut"
      },
      "GroupMembersRequest": {
        "properties": {
          "user_ids": {
            "items": {
              "type": "integer",
              "minimum": 1.0
            },
            "type": "array",
            "maxItems": 1000,
            "title": "User Ids"
          }
        },
        "type": "object",
        "required": [
          "user_ids"
        ],
        "title": "GroupMembersRequest"
      },
      "GroupOut": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "member_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Member Ids"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "name",
          "description",
          "member_ids",
          "created_at",
          "updated_at"
        ],
        "title": "GroupOut"
      },
      "GroupUpdateRequest": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "title": "GroupUpdateRequest"
      },
      "HourlySchedule": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "hourly",
            "title": "Kind"
          },
          "minute": {
            "type": "integer",
            "maximum": 59.0,
            "minimum": 0.0,
            "title": "Minute",
            "default": 0
          },
          "start": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start"
          },
          "end": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              {
                "type": "null"
              }
            ],
            "title": "End"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind"
        ],
        "title": "HourlySchedule"
      },
      "HumanProof": {
        "properties": {
          "pow_challenge": {
            "type": "string",
            "maxLength": 128,
            "title": "Pow Challenge",
            "default": ""
          },
          "pow_nonce": {
            "type": "string",
            "maxLength": 16,
            "title": "Pow Nonce",
            "default": ""
          },
          "turnstile_token": {
            "type": "string",
            "maxLength": 2048,
            "title": "Turnstile Token",
            "default": ""
          },
          "website": {
            "type": "string",
            "maxLength": 200,
            "title": "Website",
            "default": ""
          }
        },
        "type": "object",
        "title": "HumanProof",
        "description": "The human check (`GET /auth/captcha`): a solved proof of work or a Turnstile token; `website` is a trap that stays empty."
      },
      "ImageOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "main": {
            "type": "boolean",
            "title": "Main",
            "default": false
          },
          "width": {
            "type": "integer",
            "title": "Width"
          },
          "height": {
            "type": "integer",
            "title": "Height"
          },
          "small": {
            "type": "boolean",
            "title": "Small",
            "default": false
          },
          "uncut": {
            "type": "boolean",
            "title": "Uncut",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "width",
          "height"
        ],
        "title": "ImageOut",
        "description": "An own photo: `small` means smaller than the profile's size; `uncut` means its background could not be removed (a close-up), so it is shown framed."
      },
      "ImportState": {
        "type": "string",
        "enum": [
          "idle",
          "imported",
          "conflict",
          "rejected",
          "error"
        ],
        "title": "ImportState"
      },
      "IndustryListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/IndustryOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "IndustryListOut"
      },
      "IndustryOut": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "title": {
            "$ref": "#/components/schemas/TextsOut"
          },
          "categories": {
            "items": {
              "$ref": "#/components/schemas/PackageCategory"
            },
            "type": "array",
            "title": "Categories"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "title",
          "categories"
        ],
        "title": "IndustryOut"
      },
      "InfographicRule": {
        "properties": {
          "languages": {
            "items": {
              "type": "string",
              "pattern": "^[a-z]{2}$"
            },
            "type": "array",
            "maxItems": 3,
            "title": "Languages"
          },
          "title_chars": {
            "type": "integer",
            "maximum": 40.0,
            "minimum": 10.0,
            "title": "Title Chars",
            "default": 40
          },
          "benefit_chars": {
            "type": "integer",
            "maximum": 28.0,
            "minimum": 10.0,
            "title": "Benefit Chars",
            "default": 28
          },
          "benefits": {
            "type": "integer",
            "maximum": 4.0,
            "minimum": 1.0,
            "title": "Benefits",
            "default": 4
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "InfographicRule",
        "description": "Image callouts: languages (empty means the profile's languages), title and benefit length, number of benefits."
      },
      "IngestState": {
        "type": "string",
        "enum": [
          "ok",
          "warn",
          "blocked",
          "hard"
        ],
        "title": "IngestState"
      },
      "InputKind": {
        "type": "string",
        "enum": [
          "secret",
          "choice",
          "confirm",
          "known_number",
          "mapping_review"
        ],
        "title": "InputKind"
      },
      "InstallListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/InstallOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "InstallListOut"
      },
      "InstallOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "package": {
            "type": "string",
            "title": "Package"
          },
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Title"
          },
          "version": {
            "type": "string",
            "title": "Version"
          },
          "status": {
            "$ref": "#/components/schemas/InstallStatus"
          },
          "target_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Version"
          },
          "change_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Number"
          },
          "source_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Slug"
          },
          "managed_paths": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Managed Paths"
          },
          "seeded_paths": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Seeded Paths"
          },
          "ejected_paths": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Ejected Paths"
          },
          "installed_commit_oid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Installed Commit Oid"
          },
          "installed_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Installed By"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "package",
          "title",
          "version",
          "status",
          "target_version",
          "change_number",
          "source_slug",
          "managed_paths",
          "seeded_paths",
          "ejected_paths",
          "installed_commit_oid",
          "installed_by",
          "created_at",
          "updated_at"
        ],
        "title": "InstallOut"
      },
      "InstallRequest": {
        "properties": {
          "package": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,31}/[a-z][a-z0-9-]{0,62}$",
            "title": "Package"
          },
          "version": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]{1,32})?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "config": {
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "type": "object",
            "maxProperties": 64,
            "title": "Config"
          },
          "source_slug": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,31}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Slug"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "package"
        ],
        "title": "InstallRequest"
      },
      "InstallResultOut": {
        "properties": {
          "install": {
            "$ref": "#/components/schemas/InstallOut"
          },
          "change_number": {
            "type": "integer",
            "title": "Change Number"
          }
        },
        "type": "object",
        "required": [
          "install",
          "change_number"
        ],
        "title": "InstallResultOut"
      },
      "InstallStateOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "status": {
            "$ref": "#/components/schemas/InstallStatus"
          },
          "version": {
            "type": "string",
            "title": "Version"
          },
          "change_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Number"
          },
          "target_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Version"
          },
          "upgrade_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upgrade To"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "version",
          "change_number",
          "target_version",
          "upgrade_to"
        ],
        "title": "InstallStateOut"
      },
      "InstallStatus": {
        "type": "string",
        "enum": [
          "pending",
          "installed",
          "upgrading",
          "failed",
          "removed"
        ],
        "title": "InstallStatus"
      },
      "InstallSummaryOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "status": {
            "$ref": "#/components/schemas/InstallStatus"
          },
          "version": {
            "type": "string",
            "title": "Version"
          },
          "change_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Number"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "version",
          "change_number"
        ],
        "title": "InstallSummaryOut"
      },
      "IntervalSchedule": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "interval",
            "title": "Kind"
          },
          "minutes": {
            "type": "integer",
            "maximum": 1440.0,
            "minimum": 15.0,
            "title": "Minutes"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "minutes"
        ],
        "title": "IntervalSchedule"
      },
      "InviteAcceptedOut": {
        "properties": {
          "workspace_id": {
            "type": "integer",
            "title": "Workspace Id"
          },
          "role": {
            "$ref": "#/components/schemas/WorkspaceRole"
          },
          "already_member": {
            "type": "boolean",
            "title": "Already Member"
          }
        },
        "type": "object",
        "required": [
          "workspace_id",
          "role",
          "already_member"
        ],
        "title": "InviteAcceptedOut"
      },
      "InviteCreateRequest": {
        "properties": {
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "role": {
            "$ref": "#/components/schemas/WorkspaceRole"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "role"
        ],
        "title": "InviteCreateRequest",
        "description": "With an email, an email is sent (an existing account joins at once); without one, a one-time link."
      },
      "InviteLinkOut": {
        "properties": {
          "link": {
            "type": "string",
            "title": "Link"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "link",
          "expires_at"
        ],
        "title": "InviteLinkOut"
      },
      "InviteListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/InviteOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "InviteListOut"
      },
      "InviteOpenState": {
        "type": "string",
        "enum": [
          "open",
          "expired",
          "revoked",
          "used"
        ],
        "title": "InviteOpenState"
      },
      "InviteOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "role": {
            "$ref": "#/components/schemas/WorkspaceRole"
          },
          "state": {
            "$ref": "#/components/schemas/InviteState"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "sent_at": {
            "type": "string",
            "format": "date-time",
            "title": "Sent At"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "role",
          "state",
          "created_at",
          "sent_at",
          "expires_at"
        ],
        "title": "InviteOut"
      },
      "InvitePreviewOut": {
        "properties": {
          "workspace_name": {
            "type": "string",
            "title": "Workspace Name"
          },
          "inviter_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inviter Name"
          },
          "role": {
            "$ref": "#/components/schemas/WorkspaceRole"
          },
          "state": {
            "$ref": "#/components/schemas/InviteOpenState"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "workspace_name",
          "inviter_name",
          "role",
          "state",
          "expires_at"
        ],
        "title": "InvitePreviewOut"
      },
      "InviteSentOut": {
        "properties": {
          "status": {
            "$ref": "#/components/schemas/InviteStatus"
          },
          "link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Link"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "InviteSentOut",
        "description": "The answer for an email is always `sent`, so it never tells whether an account exists; a link comes only for an invite without an email."
      },
      "InviteState": {
        "type": "string",
        "enum": [
          "pending",
          "expired"
        ],
        "title": "InviteState"
      },
      "InviteStatus": {
        "type": "string",
        "enum": [
          "sent",
          "link"
        ],
        "title": "InviteStatus"
      },
      "InviteTokenRequest": {
        "properties": {
          "token": {
            "type": "string",
            "maxLength": 128,
            "minLength": 20,
            "pattern": "^[A-Za-z0-9_-]+$",
            "title": "Token"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "token"
        ],
        "title": "InviteTokenRequest"
      },
      "JobsOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SyncRunOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          },
          "scheduler": {
            "$ref": "#/components/schemas/SchedulerOut"
          },
          "stale_runs": {
            "$ref": "#/components/schemas/StaleRunsOut"
          }
        },
        "type": "object",
        "required": [
          "items",
          "scheduler",
          "stale_runs"
        ],
        "title": "JobsOut"
      },
      "JsonValue": {},
      "KindUsageOut": {
        "properties": {
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "totals": {
            "$ref": "#/components/schemas/MonitoringUsageTotalsOut"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "totals"
        ],
        "title": "KindUsageOut"
      },
      "LayoutItem": {
        "properties": {
          "chart": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,62}$",
            "title": "Chart"
          },
          "x": {
            "type": "integer",
            "exclusiveMaximum": 12.0,
            "minimum": 0.0,
            "title": "X"
          },
          "y": {
            "type": "integer",
            "maximum": 500.0,
            "minimum": 0.0,
            "title": "Y"
          },
          "w": {
            "type": "integer",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "W"
          },
          "h": {
            "type": "integer",
            "maximum": 24.0,
            "minimum": 1.0,
            "title": "H"
          },
          "title": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocalizedTitle"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "chart",
          "x",
          "y",
          "w",
          "h"
        ],
        "title": "LayoutItem"
      },
      "Level": {
        "type": "string",
        "enum": [
          "economy",
          "standard",
          "premium"
        ],
        "title": "Level"
      },
      "LevelOut": {
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Level"
          },
          "cap_uzs": {
            "type": "integer",
            "title": "Cap Uzs"
          },
          "estimate_uzs": {
            "type": "integer",
            "title": "Estimate Uzs",
            "default": 0
          },
          "pictures": {
            "type": "integer",
            "title": "Pictures",
            "default": 0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "cap_uzs"
        ],
        "title": "LevelOut",
        "description": "A card quality: its id, the ceiling of one colour, the estimate of a new one-colour card (so'm) and its AI pictures per colour."
      },
      "LevelSpendOut": {
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Level"
          },
          "estimate_uzs": {
            "type": "integer",
            "title": "Estimate Uzs"
          },
          "cap_uzs": {
            "type": "integer",
            "title": "Cap Uzs"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "estimate_uzs",
          "cap_uzs"
        ],
        "title": "LevelSpendOut",
        "description": "One quality on this card: the \"Rasmlarni qayta chizish\" estimate (callouts + the AI pictures that fit) and its ceiling (so'm)."
      },
      "LimitsOut": {
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/PlanKey"
          },
          "rows_month": {
            "$ref": "#/components/schemas/UsageLimitOut"
          },
          "storage_bytes": {
            "$ref": "#/components/schemas/UsageLimitOut"
          },
          "voice_minutes": {
            "$ref": "#/components/schemas/UsageLimitOut"
          },
          "connections": {
            "$ref": "#/components/schemas/UsageLimitOut"
          },
          "sync_minutes": {
            "type": "integer",
            "title": "Sync Minutes"
          },
          "resets_on": {
            "type": "string",
            "format": "date",
            "title": "Resets On"
          }
        },
        "type": "object",
        "required": [
          "plan",
          "rows_month",
          "storage_bytes",
          "voice_minutes",
          "connections",
          "sync_minutes",
          "resets_on"
        ],
        "title": "LimitsOut",
        "description": "The workspace's limits: monthly load (rows), storage (bytes), today's voice, connections and the fastest refresh."
      },
      "LoadEstimateOut": {
        "properties": {
          "low_seconds": {
            "type": "integer",
            "title": "Low Seconds"
          },
          "high_seconds": {
            "type": "integer",
            "title": "High Seconds"
          },
          "first_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Seconds"
          }
        },
        "type": "object",
        "required": [
          "low_seconds",
          "high_seconds"
        ],
        "title": "LoadEstimateOut",
        "description": "The first load's estimate from the timing model: the full history's lower and upper bound and the time to the first answers, in seconds."
      },
      "LoadLineOut": {
        "properties": {
          "run_id": {
            "type": "integer",
            "title": "Run Id"
          },
          "status": {
            "$ref": "#/components/schemas/RunsRunStatus"
          },
          "rows_loaded": {
            "type": "integer",
            "title": "Rows Loaded"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "trigger": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trigger"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "requests": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requests"
          },
          "objects": {
            "items": {
              "$ref": "#/components/schemas/ObjectRowsOut"
            },
            "type": "array",
            "title": "Objects"
          }
        },
        "type": "object",
        "required": [
          "run_id",
          "status",
          "rows_loaded",
          "error_code",
          "error_message",
          "created_at",
          "finished_at"
        ],
        "title": "LoadLineOut"
      },
      "LoadProgressOut": {
        "properties": {
          "slice": {
            "type": "integer",
            "title": "Slice"
          },
          "rows": {
            "type": "integer",
            "title": "Rows"
          },
          "estimate": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimate"
          },
          "tables": {
            "type": "integer",
            "title": "Tables"
          }
        },
        "type": "object",
        "required": [
          "slice",
          "rows",
          "estimate",
          "tables"
        ],
        "title": "LoadProgressOut",
        "description": "A load in chunks is running: highest chunk number, rows loaded, estimate, number of tables."
      },
      "LoadStateOut": {
        "properties": {
          "run_id": {
            "type": "integer",
            "title": "Run Id"
          },
          "status": {
            "$ref": "#/components/schemas/RunsRunStatus"
          },
          "rows_loaded": {
            "type": "integer",
            "title": "Rows Loaded"
          },
          "checks": {
            "items": {
              "$ref": "#/components/schemas/ProbeOut"
            },
            "type": "array",
            "title": "Checks"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "last_loaded_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Loaded At"
          }
        },
        "type": "object",
        "required": [
          "run_id",
          "status",
          "rows_loaded",
          "checks",
          "error_code",
          "error_message",
          "created_at",
          "started_at",
          "finished_at",
          "last_loaded_at"
        ],
        "title": "LoadStateOut"
      },
      "Locale": {
        "type": "string",
        "enum": [
          "uz",
          "ru",
          "en"
        ],
        "title": "Locale"
      },
      "Localized": {
        "additionalProperties": {
          "type": "string"
        },
        "type": "object"
      },
      "LocalizedText": {
        "properties": {
          "uz": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 1,
            "title": "Uz"
          },
          "ru": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Ru"
          },
          "en": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "En"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "uz"
        ],
        "title": "LocalizedText"
      },
      "LocalizedTitle": {
        "properties": {
          "uz": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Uz"
          },
          "ru": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Ru"
          },
          "en": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "En"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "uz"
        ],
        "title": "LocalizedTitle"
      },
      "LogDetailOut": {
        "properties": {
          "ref": {
            "type": "string",
            "title": "Ref"
          },
          "origin": {
            "type": "string",
            "enum": [
              "event",
              "audit",
              "run"
            ],
            "title": "Origin"
          },
          "workspace_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workspace Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "level": {
            "type": "string",
            "title": "Level"
          },
          "code": {
            "type": "string",
            "title": "Code"
          },
          "title": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "resource_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Kind"
          },
          "resource_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Id"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "actor_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Email"
          },
          "workspace_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workspace Name"
          },
          "actor_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Id"
          },
          "retention": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retention"
          },
          "fields": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fields"
          }
        },
        "type": "object",
        "required": [
          "ref",
          "origin",
          "workspace_id",
          "created_at",
          "level",
          "code",
          "resource_kind",
          "resource_id",
          "request_id",
          "message"
        ],
        "title": "LogDetailOut"
      },
      "LogEntryOut": {
        "properties": {
          "ref": {
            "type": "string",
            "title": "Ref"
          },
          "origin": {
            "type": "string",
            "enum": [
              "event",
              "audit",
              "run"
            ],
            "title": "Origin"
          },
          "workspace_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workspace Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "level": {
            "type": "string",
            "title": "Level"
          },
          "code": {
            "type": "string",
            "title": "Code"
          },
          "title": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "resource_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Kind"
          },
          "resource_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Id"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "actor_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Email"
          },
          "workspace_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workspace Name"
          }
        },
        "type": "object",
        "required": [
          "ref",
          "origin",
          "workspace_id",
          "created_at",
          "level",
          "code",
          "resource_kind",
          "resource_id",
          "request_id",
          "message"
        ],
        "title": "LogEntryOut"
      },
      "LogLevel": {
        "type": "string",
        "enum": [
          "debug",
          "info",
          "warning",
          "error"
        ],
        "title": "LogLevel"
      },
      "LogOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "ts": {
            "type": "string",
            "format": "date-time",
            "title": "Ts"
          },
          "level": {
            "$ref": "#/components/schemas/LogLevel"
          },
          "event": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "step_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Step Id"
          }
        },
        "type": "object",
        "required": [
          "id",
          "ts",
          "level",
          "event",
          "message",
          "step_id"
        ],
        "title": "LogOut"
      },
      "LoginOut": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "code_required",
              "authenticated"
            ],
            "title": "Status"
          },
          "challenge": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoginStartedOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "tokens": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TokenPairOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "LoginOut",
        "description": "Two outcomes: a code is asked for, or a trusted device is recognised and tokens are issued."
      },
      "LoginRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "maxLength": 200,
            "title": "Password"
          },
          "remember_device": {
            "type": "boolean",
            "title": "Remember Device",
            "default": false
          },
          "telegram_init_data": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4096
              },
              {
                "type": "null"
              }
            ],
            "title": "Telegram Init Data"
          },
          "human": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/HumanProof"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "LoginRequest"
      },
      "LoginStartedOut": {
        "properties": {
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "max_attempts": {
            "type": "integer",
            "title": "Max Attempts"
          }
        },
        "type": "object",
        "required": [
          "expires_at",
          "max_attempts"
        ],
        "title": "LoginStartedOut",
        "description": "The code itself is never in the response; it only goes by email."
      },
      "LoginVerifyRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "code": {
            "type": "string",
            "maxLength": 12,
            "minLength": 1,
            "title": "Code"
          }
        },
        "type": "object",
        "required": [
          "email",
          "code"
        ],
        "title": "LoginVerifyRequest"
      },
      "MarketplaceInstallRequest": {
        "properties": {
          "version": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]{1,32})?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "config": {
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "type": "object",
            "maxProperties": 64,
            "title": "Config"
          },
          "source_slug": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,31}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Slug"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "MarketplaceInstallRequest"
      },
      "MeasureOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "title": {
            "$ref": "#/components/schemas/Localized"
          },
          "description": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Localized"
              },
              {
                "type": "null"
              }
            ]
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "sensitive": {
            "type": "boolean",
            "title": "Sensitive"
          }
        },
        "type": "object",
        "required": [
          "key",
          "title",
          "description",
          "unit",
          "sensitive"
        ],
        "title": "MeasureOut"
      },
      "MemberListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/MemberOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "MemberListOut"
      },
      "MemberOut": {
        "properties": {
          "user_id": {
            "type": "integer",
            "title": "User Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "full_name": {
            "type": "string",
            "title": "Full Name"
          },
          "role": {
            "$ref": "#/components/schemas/WorkspaceRole"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "email",
          "full_name",
          "role",
          "created_at"
        ],
        "title": "MemberOut"
      },
      "MenuOrderIn": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/MenuPinRef"
            },
            "type": "array",
            "maxItems": 12,
            "title": "Items"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items"
        ],
        "title": "MenuOrderIn",
        "description": "The shown pins in their new order; pins not named (hidden ones too) keep their old order at the end."
      },
      "MenuPinListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/MenuPinOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "MenuPinListOut"
      },
      "MenuPinOut": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/PinKind"
          },
          "target": {
            "type": "string",
            "title": "Target"
          },
          "title": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "target",
          "title"
        ],
        "title": "MenuPinOut",
        "description": "A pin: kind, target and, for a dashboard, its `{uz, ru, en}` title; the web names a service itself."
      },
      "MenuPinRef": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/PinKind"
          },
          "target": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,62}$",
            "title": "Target"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "target"
        ],
        "title": "MenuPinRef"
      },
      "MergeStrategy": {
        "type": "string",
        "enum": [
          "delete-insert",
          "scd2",
          "upsert"
        ],
        "title": "MergeStrategy"
      },
      "MessageIn": {
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 4000,
            "title": "Text",
            "default": ""
          },
          "choice": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChoiceIn"
              },
              {
                "type": "null"
              }
            ]
          },
          "attachments": {
            "items": {
              "$ref": "#/components/schemas/AttachmentIn"
            },
            "type": "array",
            "maxItems": 5,
            "title": "Attachments"
          },
          "input_mode": {
            "type": "string",
            "enum": [
              "text",
              "voice"
            ],
            "title": "Input Mode",
            "default": "text"
          },
          "voice_seconds": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 60.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice Seconds"
          },
          "documents": {
            "items": {
              "$ref": "#/components/schemas/DocumentIn"
            },
            "type": "array",
            "maxItems": 5,
            "title": "Documents"
          },
          "skill": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SkillIn-Input"
              },
              {
                "type": "null"
              }
            ]
          },
          "skill_hint": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SkillIn-Input"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "MessageIn"
      },
      "MessageOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text"
          },
          "blocks": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Blocks"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "attachments": {
            "items": {
              "$ref": "#/components/schemas/AttachmentOut"
            },
            "type": "array",
            "title": "Attachments"
          },
          "stop_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop Reason"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/ChatStepOut"
            },
            "type": "array",
            "title": "Steps"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "input_mode": {
            "type": "string",
            "enum": [
              "text",
              "voice"
            ],
            "title": "Input Mode",
            "default": "text"
          },
          "voice_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice Seconds"
          },
          "documents": {
            "items": {
              "$ref": "#/components/schemas/DocumentOut"
            },
            "type": "array",
            "title": "Documents"
          },
          "skill": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SkillIn-Output"
              },
              {
                "type": "null"
              }
            ]
          },
          "skill_hint": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SkillIn-Output"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_hints": {
            "items": {
              "$ref": "#/components/schemas/NextStepOut"
            },
            "type": "array",
            "title": "Next Hints"
          },
          "feedback": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FeedbackOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "role",
          "text",
          "blocks",
          "run_id",
          "created_at"
        ],
        "title": "MessageOut"
      },
      "MessagePageOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/MessageOut"
            },
            "type": "array",
            "title": "Items"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More"
          },
          "before": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Before"
          }
        },
        "type": "object",
        "required": [
          "items",
          "has_more"
        ],
        "title": "MessagePageOut"
      },
      "Miss": {
        "type": "string",
        "enum": [
          "utilization",
          "storage",
          "queries",
          "jobs",
          "ai_credits"
        ],
        "title": "Miss"
      },
      "ModelReason": {
        "type": "string",
        "enum": [
          "no_key",
          "plan",
          "legacy"
        ],
        "title": "ModelReason"
      },
      "NextStepOut": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "skill": {
            "$ref": "#/components/schemas/SkillIn-Output"
          }
        },
        "type": "object",
        "required": [
          "label",
          "skill"
        ],
        "title": "NextStepOut",
        "description": "A next analysis under an answer: its ready label (\"Kunma-kun tushum · 30 kun\") and the choice to post back as is."
      },
      "NoteIn": {
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 1,
            "title": "Text"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "text"
        ],
        "title": "NoteIn",
        "description": "Free feedback: 1–1000 characters."
      },
      "NoteOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at"
        ],
        "title": "NoteOut"
      },
      "NotificationListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/NotificationOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "NotificationListOut"
      },
      "NotificationOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "payload": {
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "type": "object",
            "title": "Payload"
          },
          "link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Link"
          },
          "read_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Read At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "kind",
          "payload",
          "link",
          "read_at",
          "created_at"
        ],
        "title": "NotificationOut"
      },
      "ObjectRowsOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "title": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Localized"
              },
              {
                "type": "null"
              }
            ]
          },
          "rows": {
            "type": "integer",
            "title": "Rows"
          }
        },
        "type": "object",
        "required": [
          "name",
          "rows"
        ],
        "title": "ObjectRowsOut"
      },
      "OnboardingOut": {
        "properties": {
          "steps": {
            "items": {
              "$ref": "#/components/schemas/OnboardingStepOut"
            },
            "type": "array",
            "title": "Steps"
          },
          "done": {
            "type": "integer",
            "title": "Done"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "dashboard": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dashboard"
          }
        },
        "type": "object",
        "required": [
          "steps",
          "done",
          "total",
          "dashboard"
        ],
        "title": "OnboardingOut",
        "description": "`GET …/onboarding`: the \"Get started\" checklist; steps come from the real state, and a step the plan lacks is not listed."
      },
      "OnboardingStepOut": {
        "properties": {
          "key": {
            "$ref": "#/components/schemas/StepKey"
          },
          "done": {
            "type": "boolean",
            "title": "Done"
          }
        },
        "type": "object",
        "required": [
          "key",
          "done"
        ],
        "title": "OnboardingStepOut"
      },
      "PackageCardListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PackageCardOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "PackageCardListOut"
      },
      "PackageCardOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "title": {
            "$ref": "#/components/schemas/Localized"
          },
          "description": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Localized"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "$ref": "#/components/schemas/PackageKind"
          },
          "category": {
            "$ref": "#/components/schemas/PackageCategory"
          },
          "provides": {
            "items": {
              "$ref": "#/components/schemas/Provides"
            },
            "type": "array",
            "title": "Provides"
          },
          "publisher": {
            "$ref": "#/components/schemas/PublisherOut"
          },
          "verified": {
            "type": "boolean",
            "title": "Verified"
          },
          "featured_rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Featured Rank"
          },
          "is_fragile": {
            "type": "boolean",
            "title": "Is Fragile"
          },
          "is_beta": {
            "type": "boolean",
            "title": "Is Beta"
          },
          "latest_version": {
            "type": "string",
            "title": "Latest Version"
          },
          "license": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "License"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          },
          "measures": {
            "type": "integer",
            "title": "Measures"
          },
          "dashboards": {
            "type": "integer",
            "title": "Dashboards"
          },
          "install": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InstallStateOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "logo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo"
          },
          "recommended": {
            "type": "boolean",
            "title": "Recommended",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "key",
          "title",
          "description",
          "kind",
          "category",
          "provides",
          "publisher",
          "verified",
          "featured_rank",
          "is_fragile",
          "is_beta",
          "latest_version",
          "license",
          "tags",
          "measures",
          "dashboards",
          "install"
        ],
        "title": "PackageCardOut"
      },
      "PackageCategory": {
        "type": "string",
        "enum": [
          "retail",
          "restaurants",
          "accounting",
          "marketplaces",
          "databases",
          "files",
          "demo",
          "other"
        ],
        "title": "PackageCategory"
      },
      "PackageDetailOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "title": {
            "$ref": "#/components/schemas/Localized"
          },
          "description": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Localized"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "$ref": "#/components/schemas/PackageKind"
          },
          "category": {
            "$ref": "#/components/schemas/PackageCategory"
          },
          "provides": {
            "items": {
              "$ref": "#/components/schemas/Provides"
            },
            "type": "array",
            "title": "Provides"
          },
          "publisher": {
            "$ref": "#/components/schemas/PublisherOut"
          },
          "verified": {
            "type": "boolean",
            "title": "Verified"
          },
          "featured_rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Featured Rank"
          },
          "is_fragile": {
            "type": "boolean",
            "title": "Is Fragile"
          },
          "is_beta": {
            "type": "boolean",
            "title": "Is Beta"
          },
          "latest_version": {
            "type": "string",
            "title": "Latest Version"
          },
          "license": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "License"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          },
          "measures": {
            "type": "integer",
            "title": "Measures"
          },
          "dashboards": {
            "type": "integer",
            "title": "Dashboards"
          },
          "install": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InstallStateOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "logo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo"
          },
          "recommended": {
            "type": "boolean",
            "title": "Recommended",
            "default": false
          },
          "attribution": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Localized"
              },
              {
                "type": "null"
              }
            ]
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/VersionOut"
            },
            "type": "array",
            "title": "Versions"
          },
          "config_schema": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config Schema"
          },
          "secrets": {
            "items": {
              "$ref": "#/components/schemas/SecretStatusOut"
            },
            "type": "array",
            "title": "Secrets"
          },
          "installed_secrets": {
            "items": {
              "$ref": "#/components/schemas/SecretStatusOut"
            },
            "type": "array",
            "title": "Installed Secrets"
          },
          "source": {
            "$ref": "#/components/schemas/SourceInfoOut"
          },
          "views": {
            "items": {
              "$ref": "#/components/schemas/ViewOut"
            },
            "type": "array",
            "title": "Views"
          },
          "dashboard_list": {
            "items": {
              "$ref": "#/components/schemas/MarketplaceDashboardOut"
            },
            "type": "array",
            "title": "Dashboard List"
          },
          "samples": {
            "items": {
              "$ref": "#/components/schemas/SampleOut"
            },
            "type": "array",
            "title": "Samples"
          },
          "managed_files": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Managed Files"
          },
          "seeded_files": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Seeded Files"
          }
        },
        "type": "object",
        "required": [
          "key",
          "title",
          "description",
          "kind",
          "category",
          "provides",
          "publisher",
          "verified",
          "featured_rank",
          "is_fragile",
          "is_beta",
          "latest_version",
          "license",
          "tags",
          "measures",
          "dashboards",
          "install",
          "attribution",
          "versions",
          "config_schema",
          "secrets",
          "installed_secrets",
          "source",
          "views",
          "dashboard_list",
          "samples",
          "managed_files",
          "seeded_files"
        ],
        "title": "PackageDetailOut"
      },
      "PackageKind": {
        "type": "string",
        "enum": [
          "source",
          "domain",
          "bundle"
        ],
        "title": "PackageKind"
      },
      "PackageListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PackageOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "PackageListOut"
      },
      "PackageOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "kind": {
            "$ref": "#/components/schemas/PackageKind"
          },
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "connector": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connector"
          },
          "is_fragile": {
            "type": "boolean",
            "title": "Is Fragile"
          },
          "latest_version": {
            "type": "string",
            "title": "Latest Version"
          },
          "versions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Versions"
          },
          "config_schema": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config Schema"
          },
          "secrets": {
            "items": {
              "$ref": "#/components/schemas/PackageSecretOut"
            },
            "type": "array",
            "title": "Secrets"
          },
          "install": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InstallSummaryOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "key",
          "kind",
          "title",
          "description",
          "connector",
          "is_fragile",
          "latest_version",
          "versions",
          "config_schema",
          "secrets",
          "install"
        ],
        "title": "PackageOut"
      },
      "PackageSecretOut": {
        "properties": {
          "slot": {
            "type": "string",
            "title": "Slot"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "kind": {
            "$ref": "#/components/schemas/SecretKind"
          },
          "label": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Label"
          },
          "help_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Help Url"
          },
          "required": {
            "type": "boolean",
            "title": "Required"
          }
        },
        "type": "object",
        "required": [
          "slot",
          "name",
          "kind",
          "label",
          "help_url",
          "required"
        ],
        "title": "PackageSecretOut"
      },
      "PdfExportIn": {
        "properties": {
          "filters": {
            "patternProperties": {
              "^[a-z][a-z0-9_]{0,62}$": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RelativeRange"
                  },
                  {
                    "$ref": "#/components/schemas/DateRange"
                  },
                  {
                    "items": {
                      "type": "string",
                      "maxLength": 256
                    },
                    "type": "array",
                    "maxItems": 100
                  }
                ]
              }
            },
            "type": "object",
            "maxProperties": 10,
            "title": "Filters"
          },
          "locale": {
            "$ref": "#/components/schemas/Locale",
            "default": "uz"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PdfExportIn",
        "description": "The page's filters and language, so the PDF matches the screen."
      },
      "PdfExportOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "status": {
            "$ref": "#/components/schemas/ExportStatus"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size Bytes"
          },
          "pages": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pages"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "size_bytes",
          "pages",
          "error_code",
          "expires_at",
          "created_at"
        ],
        "title": "PdfExportOut"
      },
      "PeriodOut": {
        "properties": {
          "start": {
            "type": "string",
            "format": "date",
            "title": "Start"
          },
          "end": {
            "type": "string",
            "format": "date",
            "title": "End"
          }
        },
        "type": "object",
        "required": [
          "start",
          "end"
        ],
        "title": "PeriodOut"
      },
      "PhotoPatch": {
        "properties": {
          "main": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Main"
          },
          "chosen": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chosen"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PhotoPatch",
        "description": "An own photo: main (`main`); a sample found on the web: ticked (`chosen`)."
      },
      "PhotoRule": {
        "properties": {
          "ratio": {
            "type": "string",
            "pattern": "^[1-9][0-9]?:[1-9][0-9]?$",
            "title": "Ratio"
          },
          "min_width": {
            "type": "integer",
            "maximum": 10000.0,
            "minimum": 100.0,
            "title": "Min Width"
          },
          "min_height": {
            "type": "integer",
            "maximum": 10000.0,
            "minimum": 100.0,
            "title": "Min Height"
          },
          "max_mb": {
            "type": "integer",
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "Max Mb"
          },
          "max_count": {
            "type": "integer",
            "maximum": 8.0,
            "minimum": 1.0,
            "title": "Max Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ratio",
          "min_width",
          "min_height",
          "max_mb",
          "max_count"
        ],
        "title": "PhotoRule"
      },
      "PinKind": {
        "type": "string",
        "enum": [
          "dashboard",
          "service"
        ],
        "title": "PinKind"
      },
      "PinRequest": {
        "properties": {
          "pinned": {
            "type": "boolean",
            "title": "Pinned"
          }
        },
        "type": "object",
        "required": [
          "pinned"
        ],
        "title": "PinRequest"
      },
      "PlanChoiceIn": {
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/PlanKey"
          }
        },
        "type": "object",
        "required": [
          "plan"
        ],
        "title": "PlanChoiceIn"
      },
      "PlanKey": {
        "type": "string",
        "enum": [
          "starter",
          "business",
          "pro",
          "partner",
          "enterprise",
          "pilot",
          "trial"
        ],
        "title": "PlanKey"
      },
      "PlanOptionOut": {
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/PlanKey"
          },
          "price_uzs": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Uzs"
          },
          "answers": {
            "type": "integer",
            "title": "Answers"
          },
          "voice_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice Minutes"
          },
          "sync_minutes": {
            "type": "integer",
            "title": "Sync Minutes"
          },
          "change": {
            "$ref": "#/components/schemas/ChoiceKind"
          },
          "charge_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Charge Uzs"
          },
          "credit_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Credit Uzs",
            "default": "0"
          },
          "starts_on": {
            "type": "string",
            "format": "date",
            "title": "Starts On"
          },
          "funded": {
            "type": "boolean",
            "title": "Funded"
          }
        },
        "type": "object",
        "required": [
          "plan",
          "price_uzs",
          "answers",
          "voice_minutes",
          "sync_minutes",
          "change",
          "charge_uzs",
          "starts_on",
          "funded"
        ],
        "title": "PlanOptionOut",
        "description": "A plan choice: price (agreed for Enterprise), about how many questions, voice, refresh and what choosing it does today."
      },
      "PlanOut": {
        "properties": {
          "key": {
            "$ref": "#/components/schemas/PlanKey"
          },
          "features": {
            "items": {
              "$ref": "#/components/schemas/Feature"
            },
            "type": "array",
            "title": "Features"
          },
          "included": {
            "items": {
              "$ref": "#/components/schemas/Feature"
            },
            "type": "array",
            "title": "Included"
          },
          "coming_soon": {
            "items": {
              "$ref": "#/components/schemas/Feature"
            },
            "type": "array",
            "title": "Coming Soon"
          },
          "skus": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Skus"
          },
          "builder_seats": {
            "type": "integer",
            "title": "Builder Seats"
          },
          "sku": {
            "$ref": "#/components/schemas/SkuOut"
          },
          "capacity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CapacityOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "limits": {
            "$ref": "#/components/schemas/SkuLimits"
          },
          "trial": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TrialOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "key",
          "features",
          "included",
          "coming_soon",
          "skus",
          "builder_seats",
          "sku",
          "capacity",
          "limits"
        ],
        "title": "PlanOut"
      },
      "PolicyDecision": {
        "type": "string",
        "enum": [
          "auto",
          "human"
        ],
        "title": "PolicyDecision"
      },
      "PolicyReason": {
        "type": "string",
        "enum": [
          "floor",
          "not_auto",
          "needs_person",
          "person_kind",
          "package_upgrade",
          "suggestion",
          "viewer_request",
          "checks_pending",
          "check_failed",
          "check_warning",
          "daily_limit"
        ],
        "title": "PolicyReason"
      },
      "PreferencesOut": {
        "properties": {
          "ui_mode": {
            "$ref": "#/components/schemas/UiMode"
          }
        },
        "type": "object",
        "required": [
          "ui_mode"
        ],
        "title": "PreferencesOut"
      },
      "PreferencesRequest": {
        "properties": {
          "ui_mode": {
            "$ref": "#/components/schemas/UiMode"
          }
        },
        "type": "object",
        "required": [
          "ui_mode"
        ],
        "title": "PreferencesRequest"
      },
      "PriceTier": {
        "type": "string",
        "enum": [
          "$",
          "$$",
          "$$$"
        ],
        "title": "PriceTier"
      },
      "Principals": {
        "properties": {
          "roles": {
            "items": {
              "$ref": "#/components/schemas/Role"
            },
            "type": "array",
            "maxItems": 4,
            "title": "Roles"
          },
          "groups": {
            "items": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,62}$"
            },
            "type": "array",
            "maxItems": 100,
            "title": "Groups"
          },
          "users": {
            "items": {
              "type": "integer",
              "minimum": 1.0
            },
            "type": "array",
            "maxItems": 500,
            "title": "Users"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "Principals"
      },
      "ProbeOut": {
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,62}$",
            "title": "Key"
          },
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "key",
          "ok"
        ],
        "title": "ProbeOut"
      },
      "ProblemKind": {
        "type": "string",
        "enum": [
          "install_failed",
          "load_failed",
          "test_failed",
          "limit"
        ]
      },
      "ProblemOut": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/ProblemKind"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "code",
          "detail"
        ],
        "title": "ProblemOut"
      },
      "Producer": {
        "type": "string",
        "enum": [
          "ai",
          "cutout",
          "fit"
        ],
        "title": "Producer"
      },
      "ProfileListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ProfileOut"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items"
        ],
        "title": "ProfileListOut"
      },
      "ProfileOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "names": {
            "$ref": "#/components/schemas/Words"
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Languages"
          },
          "classifier": {
            "$ref": "#/components/schemas/ClassifierInfoOut"
          },
          "title": {
            "$ref": "#/components/schemas/TitleRule"
          },
          "photos": {
            "$ref": "#/components/schemas/PhotoRule"
          },
          "short_max": {
            "type": "integer",
            "title": "Short Max"
          },
          "description_max": {
            "type": "integer",
            "title": "Description Max"
          },
          "sku": {
            "$ref": "#/components/schemas/SkuRule"
          },
          "form": {
            "$ref": "#/components/schemas/FormRule"
          },
          "uploads": {
            "$ref": "#/components/schemas/UploadRule"
          },
          "references": {
            "$ref": "#/components/schemas/ReferenceRule"
          },
          "infographic": {
            "$ref": "#/components/schemas/InfographicRule"
          },
          "features_max": {
            "type": "integer",
            "title": "Features Max"
          },
          "stop_words": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Stop Words"
          },
          "stop_phrases": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Stop Phrases"
          },
          "cabinet_path": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Cabinet Path"
          },
          "styles": {
            "items": {
              "$ref": "#/components/schemas/StyleOut"
            },
            "type": "array",
            "title": "Styles"
          },
          "default_style": {
            "type": "string",
            "title": "Default Style"
          },
          "variants": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VariantRule"
              },
              {
                "type": "null"
              }
            ]
          },
          "rules": {
            "items": {
              "$ref": "#/components/schemas/RuleOut"
            },
            "type": "array",
            "title": "Rules"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "names",
          "languages",
          "classifier",
          "title",
          "photos",
          "short_max",
          "description_max",
          "sku",
          "form",
          "uploads",
          "references",
          "infographic",
          "features_max",
          "default_style"
        ],
        "title": "ProfileOut",
        "description": "A marketplace profile serving the workspace's industry: names, limits, stop words, styles."
      },
      "ProfileUpdateRequest": {
        "properties": {
          "locale": {
            "type": "string",
            "enum": [
              "uz",
              "ru",
              "en"
            ],
            "title": "Locale"
          }
        },
        "type": "object",
        "required": [
          "locale"
        ],
        "title": "ProfileUpdateRequest",
        "description": "The language the person chose: kept on the account; Telegram replies, emails and reports use it too."
      },
      "ProgressOut": {
        "properties": {
          "stage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CardStage"
              },
              {
                "type": "null"
              }
            ]
          },
          "percent": {
            "type": "integer",
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Percent"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/ListingStepOut"
            },
            "type": "array",
            "title": "Steps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "percent"
        ],
        "title": "ProgressOut",
        "description": "Progress: the stage (`queued` means waiting), the percent and the four lines the web shows."
      },
      "Provider": {
        "type": "string",
        "enum": [
          "github",
          "gitlab"
        ],
        "title": "Provider"
      },
      "Provides": {
        "type": "string",
        "enum": [
          "connector",
          "files",
          "views",
          "dashboards"
        ],
        "title": "Provides"
      },
      "PublisherKind": {
        "type": "string",
        "enum": [
          "databek",
          "partner",
          "workspace"
        ],
        "title": "PublisherKind"
      },
      "PublisherOut": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/PublisherKind"
          },
          "name": {
            "type": "string",
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "name"
        ],
        "title": "PublisherOut"
      },
      "QualityBand": {
        "type": "string",
        "enum": [
          "top",
          "high",
          "medium",
          "basic"
        ],
        "title": "QualityBand"
      },
      "QueryLogListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/QueryLogOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "QueryLogListOut"
      },
      "QueryLogOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "actor_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor Id"
          },
          "status": {
            "$ref": "#/components/schemas/QueryStatus"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "duration_ms": {
            "type": "integer",
            "title": "Duration Ms"
          },
          "row_count": {
            "type": "integer",
            "title": "Row Count"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "actor_id",
          "status",
          "error_code",
          "duration_ms",
          "row_count",
          "created_at"
        ],
        "title": "QueryLogOut"
      },
      "QueryStatus": {
        "type": "string",
        "enum": [
          "ok",
          "rejected",
          "failed"
        ],
        "title": "QueryStatus"
      },
      "QuotaLevel": {
        "type": "string",
        "enum": [
          "ok",
          "warn",
          "stopped"
        ],
        "title": "QuotaLevel"
      },
      "QuotaLimit": {
        "type": "string",
        "enum": [
          "ingest_rows",
          "ingest_bytes",
          "storage"
        ],
        "title": "QuotaLimit"
      },
      "QuotaMeterOut": {
        "properties": {
          "limit": {
            "$ref": "#/components/schemas/QuotaLimit"
          },
          "used": {
            "type": "integer",
            "title": "Used"
          },
          "allowed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed"
          },
          "percent": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Percent"
          },
          "level": {
            "$ref": "#/components/schemas/QuotaLevel"
          }
        },
        "type": "object",
        "required": [
          "limit",
          "used",
          "allowed",
          "percent",
          "level"
        ],
        "title": "QuotaMeterOut"
      },
      "QuotaOut": {
        "properties": {
          "level": {
            "$ref": "#/components/schemas/QuotaLevel"
          },
          "stop_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop Code"
          },
          "resets_on": {
            "type": "string",
            "format": "date",
            "title": "Resets On"
          },
          "period_start": {
            "type": "string",
            "format": "date-time",
            "title": "Period Start"
          },
          "storage_state": {
            "$ref": "#/components/schemas/IngestState"
          },
          "waiting_loads": {
            "type": "integer",
            "title": "Waiting Loads"
          },
          "meters": {
            "items": {
              "$ref": "#/components/schemas/QuotaMeterOut"
            },
            "type": "array",
            "title": "Meters"
          }
        },
        "type": "object",
        "required": [
          "level",
          "stop_code",
          "resets_on",
          "period_start",
          "storage_state",
          "waiting_loads",
          "meters"
        ],
        "title": "QuotaOut",
        "description": "Load limits: the worst level, the code when loads stopped, the day the month rolls over and the waiting loads."
      },
      "RateLimit": {
        "properties": {
          "rps": {
            "type": "number",
            "maximum": 50.0,
            "exclusiveMinimum": 0.0,
            "title": "Rps"
          },
          "scope": {
            "type": "string",
            "const": "egress_ip",
            "title": "Scope",
            "default": "egress_ip"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "rps"
        ],
        "title": "RateLimit"
      },
      "ReadMethod": {
        "type": "string",
        "enum": [
          "local",
          "text",
          "vision",
          "pdf",
          "copy"
        ],
        "title": "ReadMethod"
      },
      "Reason": {
        "properties": {
          "code": {
            "$ref": "#/components/schemas/PolicyReason"
          },
          "kind": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChangeKind"
              },
              {
                "type": "null"
              }
            ]
          },
          "check": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CheckKind"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "code"
        ],
        "title": "Reason"
      },
      "RecommendationOut": {
        "properties": {
          "sku": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sku"
          },
          "current": {
            "type": "string",
            "title": "Current"
          },
          "change": {
            "$ref": "#/components/schemas/Change"
          },
          "enough_data": {
            "type": "boolean",
            "title": "Enough Data"
          },
          "days_observed": {
            "type": "integer",
            "title": "Days Observed"
          },
          "p95_daily_dcu_s": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "P95 Daily Dcu S"
          },
          "storage_gb": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Storage Gb"
          },
          "storage_gb_projected": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Storage Gb Projected"
          },
          "peak_queries": {
            "type": "integer",
            "title": "Peak Queries"
          },
          "peak_jobs": {
            "type": "integer",
            "title": "Peak Jobs"
          },
          "ai_credits_month": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Ai Credits Month"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/SkuFitOut"
            },
            "type": "array",
            "title": "Options"
          }
        },
        "type": "object",
        "required": [
          "sku",
          "current",
          "change",
          "enough_data",
          "days_observed",
          "p95_daily_dcu_s",
          "storage_gb",
          "storage_gb_projected",
          "peak_queries",
          "peak_jobs",
          "ai_credits_month",
          "options"
        ],
        "title": "RecommendationOut"
      },
      "ReferenceOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "chosen": {
            "type": "boolean",
            "title": "Chosen",
            "default": false
          },
          "site": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site"
          },
          "page": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id"
        ],
        "title": "ReferenceOut",
        "description": "A sample found on the web: ticked or not, its site and page."
      },
      "ReferenceRule": {
        "properties": {
          "max_found": {
            "type": "integer",
            "maximum": 8.0,
            "minimum": 0.0,
            "title": "Max Found",
            "default": 8
          },
          "max_chosen": {
            "type": "integer",
            "maximum": 8.0,
            "minimum": 0.0,
            "title": "Max Chosen",
            "default": 2
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ReferenceRule",
        "description": "Samples found on the web: how many are fetched and how many can be ticked."
      },
      "RefreshMode": {
        "type": "string",
        "enum": [
          "data",
          "schedule",
          "manual"
        ],
        "title": "RefreshMode"
      },
      "RefreshOut": {
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/RefreshMode"
          },
          "schedule": {
            "anyOf": [
              {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/IntervalSchedule"
                  },
                  {
                    "$ref": "#/components/schemas/HourlySchedule"
                  },
                  {
                    "$ref": "#/components/schemas/DailySchedule"
                  },
                  {
                    "$ref": "#/components/schemas/WeeklySchedule"
                  }
                ],
                "discriminator": {
                  "propertyName": "kind",
                  "mapping": {
                    "daily": "#/components/schemas/DailySchedule",
                    "hourly": "#/components/schemas/HourlySchedule",
                    "interval": "#/components/schemas/IntervalSchedule",
                    "weekly": "#/components/schemas/WeeklySchedule"
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule"
          },
          "live": {
            "type": "boolean",
            "title": "Live"
          },
          "live_interval_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Live Interval Minutes"
          },
          "min_interval_minutes": {
            "type": "integer",
            "title": "Min Interval Minutes"
          },
          "refreshed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refreshed At"
          },
          "next_refresh_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Refresh At"
          }
        },
        "type": "object",
        "required": [
          "mode",
          "schedule",
          "live",
          "live_interval_minutes",
          "min_interval_minutes",
          "refreshed_at",
          "next_refresh_at"
        ],
        "title": "RefreshOut"
      },
      "RefreshRequest": {
        "properties": {
          "refresh_token": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Refresh Token"
          }
        },
        "type": "object",
        "required": [
          "refresh_token"
        ],
        "title": "RefreshRequest"
      },
      "RefreshSettingsIn": {
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/RefreshMode",
            "default": "data"
          },
          "schedule": {
            "anyOf": [
              {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/IntervalSchedule"
                  },
                  {
                    "$ref": "#/components/schemas/HourlySchedule"
                  },
                  {
                    "$ref": "#/components/schemas/DailySchedule"
                  },
                  {
                    "$ref": "#/components/schemas/WeeklySchedule"
                  }
                ],
                "discriminator": {
                  "propertyName": "kind",
                  "mapping": {
                    "daily": "#/components/schemas/DailySchedule",
                    "hourly": "#/components/schemas/HourlySchedule",
                    "interval": "#/components/schemas/IntervalSchedule",
                    "weekly": "#/components/schemas/WeeklySchedule"
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule"
          },
          "live": {
            "type": "boolean",
            "title": "Live",
            "default": false
          },
          "live_interval_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1440.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Live Interval Minutes"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "RefreshSettingsIn"
      },
      "RefreshStateOut": {
        "properties": {
          "refresh_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refresh Minutes"
          },
          "refresh_plan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WeeklyTimesSchedule"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Minutes"
          },
          "minimum": {
            "type": "integer",
            "title": "Minimum"
          },
          "choices": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Choices"
          },
          "next_sync_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Sync At"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          }
        },
        "type": "object",
        "required": [
          "refresh_minutes",
          "minimum",
          "choices",
          "next_sync_at"
        ],
        "title": "RefreshStateOut"
      },
      "RegisterRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "maxLength": 200,
            "title": "Password"
          },
          "full_name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 2,
            "title": "Full Name"
          },
          "locale": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "uz",
                  "ru",
                  "en"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Locale"
          },
          "telegram_init_data": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4096
              },
              {
                "type": "null"
              }
            ],
            "title": "Telegram Init Data"
          },
          "human": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/HumanProof"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "email",
          "password",
          "full_name"
        ],
        "title": "RegisterRequest"
      },
      "RejectIn": {
        "properties": {
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "RejectIn"
      },
      "RelativeRange": {
        "type": "string",
        "enum": [
          "today",
          "yesterday",
          "this_week",
          "last_week",
          "this_month",
          "last_month",
          "this_quarter",
          "last_quarter",
          "this_year",
          "last_year",
          "last_7_days",
          "last_30_days",
          "last_90_days",
          "last_12_months",
          "last_24_months"
        ],
        "title": "RelativeRange"
      },
      "RemovalOut": {
        "properties": {
          "state": {
            "$ref": "#/components/schemas/RemovalState"
          },
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RemovalReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "change_number": {
            "type": "integer",
            "title": "Change Number"
          }
        },
        "type": "object",
        "required": [
          "state",
          "change_number"
        ],
        "title": "RemovalOut"
      },
      "RemovalReason": {
        "type": "string",
        "enum": [
          "owner_needed",
          "checks_failed",
          "deploy_failed",
          "rejected",
          "stale"
        ],
        "title": "RemovalReason"
      },
      "RemovalState": {
        "type": "string",
        "enum": [
          "removing",
          "waiting",
          "failed"
        ],
        "title": "RemovalState"
      },
      "RepoEntryOut": {
        "properties": {
          "path": {
            "type": "string",
            "title": "Path"
          },
          "oid": {
            "type": "string",
            "title": "Oid"
          },
          "size": {
            "type": "integer",
            "title": "Size"
          },
          "kind": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FileKind"
              },
              {
                "type": "null"
              }
            ]
          },
          "managed": {
            "type": "boolean",
            "title": "Managed"
          }
        },
        "type": "object",
        "required": [
          "path",
          "oid",
          "size",
          "kind",
          "managed"
        ],
        "title": "RepoEntryOut"
      },
      "RepoFileIn": {
        "properties": {
          "ref": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Ref"
          },
          "path": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "Path"
          },
          "content": {
            "type": "string",
            "maxLength": 524288,
            "title": "Content"
          },
          "message": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "ref",
          "path",
          "content"
        ],
        "title": "RepoFileIn"
      },
      "RepoFileOut": {
        "properties": {
          "ref": {
            "type": "string",
            "title": "Ref"
          },
          "commit_oid": {
            "type": "string",
            "title": "Commit Oid"
          },
          "path": {
            "type": "string",
            "title": "Path"
          },
          "oid": {
            "type": "string",
            "title": "Oid"
          },
          "size": {
            "type": "integer",
            "title": "Size"
          },
          "kind": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FileKind"
              },
              {
                "type": "null"
              }
            ]
          },
          "managed": {
            "type": "boolean",
            "title": "Managed"
          },
          "content": {
            "type": "string",
            "title": "Content"
          }
        },
        "type": "object",
        "required": [
          "ref",
          "commit_oid",
          "path",
          "oid",
          "size",
          "kind",
          "managed",
          "content"
        ],
        "title": "RepoFileOut"
      },
      "RepoFileSavedOut": {
        "properties": {
          "ref": {
            "type": "string",
            "title": "Ref"
          },
          "commit_oid": {
            "type": "string",
            "title": "Commit Oid"
          },
          "path": {
            "type": "string",
            "title": "Path"
          },
          "oid": {
            "type": "string",
            "title": "Oid"
          },
          "size": {
            "type": "integer",
            "title": "Size"
          },
          "committed": {
            "type": "boolean",
            "title": "Committed"
          },
          "change_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Number"
          }
        },
        "type": "object",
        "required": [
          "ref",
          "commit_oid",
          "path",
          "oid",
          "size",
          "committed"
        ],
        "title": "RepoFileSavedOut"
      },
      "RepoTreeOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/RepoEntryOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          },
          "ref": {
            "type": "string",
            "title": "Ref"
          },
          "commit_oid": {
            "type": "string",
            "title": "Commit Oid"
          }
        },
        "type": "object",
        "required": [
          "items",
          "ref",
          "commit_oid"
        ],
        "title": "RepoTreeOut"
      },
      "RequestTopic": {
        "type": "string",
        "enum": [
          "payment",
          "plan"
        ],
        "title": "RequestTopic"
      },
      "ResearchState": {
        "type": "string",
        "enum": [
          "pending",
          "running",
          "done",
          "failed"
        ],
        "title": "ResearchState"
      },
      "ResetPasswordRequest": {
        "properties": {
          "token": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Token"
          },
          "password": {
            "type": "string",
            "maxLength": 200,
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "token",
          "password"
        ],
        "title": "ResetPasswordRequest"
      },
      "ResolveIn": {
        "properties": {
          "action": {
            "type": "string",
            "const": "overwrite_remote",
            "title": "Action"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "action"
        ],
        "title": "ResolveIn"
      },
      "Resource": {
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,62}$",
            "title": "Name"
          },
          "target_table": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,62}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Table"
          },
          "write_disposition": {
            "$ref": "#/components/schemas/WriteDisposition",
            "default": "append"
          },
          "merge_strategy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MergeStrategy"
              },
              {
                "type": "null"
              }
            ]
          },
          "primary_key": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z_][a-z0-9_]{0,62}$"
              },
              {
                "items": {
                  "type": "string",
                  "pattern": "^[a-z_][a-z0-9_]{0,62}$"
                },
                "type": "array",
                "maxItems": 8,
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Key"
          },
          "cursor_column": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z_][a-z0-9_]{0,62}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cursor Column"
          },
          "lag_seconds": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2592000.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Lag Seconds"
          },
          "schema_contract": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SchemaContract"
              },
              {
                "type": "null"
              }
            ]
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          },
          "reload_generation": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Reload Generation",
            "default": 0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name"
        ],
        "title": "Resource"
      },
      "RestApiConfig": {
        "properties": {
          "base_url": {
            "type": "string",
            "maxLength": 500,
            "minLength": 9,
            "title": "Base Url"
          },
          "auth": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RestAuth"
              },
              {
                "type": "null"
              }
            ]
          },
          "headers": {
            "patternProperties": {
              "^[A-Za-z0-9-]{1,64}$": {
                "type": "string",
                "maxLength": 256
              }
            },
            "type": "object",
            "maxProperties": 20,
            "title": "Headers"
          },
          "paginator": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RestPaginator"
              },
              {
                "type": "null"
              }
            ]
          },
          "endpoints": {
            "patternProperties": {
              "^[a-z][a-z0-9_]{0,62}$": {
                "$ref": "#/components/schemas/RestEndpoint"
              }
            },
            "type": "object",
            "maxProperties": 100,
            "minProperties": 1,
            "title": "Endpoints"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "base_url",
          "endpoints"
        ],
        "title": "RestApiConfig"
      },
      "RestAuth": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "bearer",
              "api_key",
              "http_basic",
              "oauth2_client_credentials"
            ],
            "title": "Type"
          },
          "secret": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{1,63}$",
            "title": "Secret"
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.\\[\\]-]{1,64}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "location": {
            "type": "string",
            "enum": [
              "header",
              "query"
            ],
            "title": "Location",
            "default": "header"
          },
          "username": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Username"
          },
          "client_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Id"
          },
          "token_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500,
                "minLength": 9
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Url"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[\\x21-\\x7e]([\\x20-\\x7e]{0,498}[\\x21-\\x7e])?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scope"
          },
          "audience": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[\\x21-\\x7e]([\\x20-\\x7e]{0,498}[\\x21-\\x7e])?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audience"
          },
          "client_auth": {
            "type": "string",
            "enum": [
              "basic",
              "post"
            ],
            "title": "Client Auth",
            "default": "basic"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "secret"
        ],
        "title": "RestAuth"
      },
      "RestEndpoint": {
        "properties": {
          "path": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_./{}~-]{0,300}$",
            "title": "Path"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST"
            ],
            "title": "Method",
            "default": "GET"
          },
          "params": {
            "patternProperties": {
              "^[A-Za-z0-9_.\\[\\]-]{1,64}$": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 256
                  },
                  {
                    "type": "boolean"
                  }
                ]
              }
            },
            "type": "object",
            "maxProperties": 30,
            "title": "Params"
          },
          "json": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Json"
          },
          "data_selector": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_$.\\[\\]*-]{1,200}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Selector"
          },
          "paginator": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RestPaginator"
              },
              {
                "type": "null"
              }
            ]
          },
          "incremental": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RestIncremental"
              },
              {
                "type": "null"
              }
            ]
          },
          "processing_steps": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/DropFieldsStep"
                },
                {
                  "$ref": "#/components/schemas/FilterStep"
                }
              ]
            },
            "type": "array",
            "maxItems": 10,
            "title": "Processing Steps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "path"
        ],
        "title": "RestEndpoint"
      },
      "RestIncremental": {
        "properties": {
          "cursor_path": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_$.\\[\\]*-]{1,200}$",
            "title": "Cursor Path"
          },
          "initial_value": {
            "type": "string",
            "maxLength": 256,
            "title": "Initial Value"
          },
          "param": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.\\[\\]-]{1,64}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Param"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "cursor_path",
          "initial_value"
        ],
        "title": "RestIncremental"
      },
      "RestPaginator": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "json_link",
              "header_link",
              "offset",
              "page_number",
              "cursor",
              "single_page"
            ],
            "title": "Type"
          },
          "next_url_path": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_$.\\[\\]*-]{1,200}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Url Path"
          },
          "cursor_path": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_$.\\[\\]*-]{1,200}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cursor Path"
          },
          "cursor_param": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.\\[\\]-]{1,64}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cursor Param"
          },
          "offset_param": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.\\[\\]-]{1,64}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Offset Param"
          },
          "limit_param": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.\\[\\]-]{1,64}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Limit Param"
          },
          "limit": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 10000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Limit"
          },
          "page_param": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.\\[\\]-]{1,64}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Param"
          },
          "base_page": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Page"
          },
          "total_path": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_$.\\[\\]*-]{1,200}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Path"
          },
          "maximum_pages": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Maximum Pages"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type"
        ],
        "title": "RestPaginator"
      },
      "RevokedOut": {
        "properties": {
          "revoked": {
            "type": "integer",
            "title": "Revoked"
          }
        },
        "type": "object",
        "required": [
          "revoked"
        ],
        "title": "RevokedOut"
      },
      "Role": {
        "type": "string",
        "enum": [
          "owner",
          "admin",
          "builder",
          "viewer"
        ],
        "title": "Role"
      },
      "RoleChangeRequest": {
        "properties": {
          "role": {
            "$ref": "#/components/schemas/WorkspaceRole"
          }
        },
        "type": "object",
        "required": [
          "role"
        ],
        "title": "RoleChangeRequest"
      },
      "RollbackIn": {
        "properties": {
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "RollbackIn"
      },
      "RollbackOut": {
        "properties": {
          "target_version": {
            "type": "integer",
            "title": "Target Version"
          },
          "change_number": {
            "type": "integer",
            "title": "Change Number"
          },
          "job_id": {
            "type": "integer",
            "title": "Job Id"
          }
        },
        "type": "object",
        "required": [
          "target_version",
          "change_number",
          "job_id"
        ],
        "title": "RollbackOut"
      },
      "RowCheck": {
        "type": "string",
        "enum": [
          "amount_mismatch",
          "barcode_invalid",
          "no_numbers"
        ],
        "title": "RowCheck"
      },
      "RuleOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "automatic",
              "warning",
              "seller"
            ],
            "title": "Kind"
          },
          "text": {
            "$ref": "#/components/schemas/RuleText"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "kind",
          "text"
        ],
        "title": "RuleOut",
        "description": "A profile rule for the web: id, kind (`seller` is the checklist before listing) and the text the seller sees."
      },
      "RuleText": {
        "properties": {
          "uz": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "Uz"
          },
          "ru": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "Ru"
          },
          "en": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "En"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "uz",
          "ru",
          "en"
        ],
        "title": "RuleText",
        "description": "The one line of a rule the seller sees (no technical words), in three languages."
      },
      "RunCreateRequest": {
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "manual",
              "backfill"
            ],
            "title": "Mode",
            "default": "manual"
          },
          "backfill_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Backfill From"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "RunCreateRequest"
      },
      "RunDetailOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "kind": {
            "$ref": "#/components/schemas/RunKind"
          },
          "trigger": {
            "$ref": "#/components/schemas/RunTrigger"
          },
          "status": {
            "$ref": "#/components/schemas/RunsRunStatus"
          },
          "skip_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skip Reason"
          },
          "parent_run_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Run Id"
          },
          "schedule_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule Id"
          },
          "scheduled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled At"
          },
          "source_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Id"
          },
          "change_request_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Request Id"
          },
          "deployment_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployment Id"
          },
          "commit_oid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Commit Oid"
          },
          "requested_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested By"
          },
          "image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image"
          },
          "rows_extracted": {
            "type": "integer",
            "title": "Rows Extracted"
          },
          "rows_loaded": {
            "type": "integer",
            "title": "Rows Loaded"
          },
          "bytes_loaded": {
            "type": "integer",
            "title": "Bytes Loaded"
          },
          "cpu_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cpu Ms"
          },
          "peak_mem_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Peak Mem Bytes"
          },
          "dcu_s": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dcu S"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "heartbeat_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Heartbeat At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "source_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Slug"
          },
          "change_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Number"
          },
          "deployment_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployment Version"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/RunsStepOut"
            },
            "type": "array",
            "title": "Steps"
          }
        },
        "type": "object",
        "required": [
          "id",
          "kind",
          "trigger",
          "status",
          "skip_reason",
          "parent_run_id",
          "schedule_id",
          "scheduled_at",
          "source_id",
          "change_request_id",
          "deployment_id",
          "commit_oid",
          "requested_by",
          "image",
          "rows_extracted",
          "rows_loaded",
          "bytes_loaded",
          "cpu_ms",
          "peak_mem_bytes",
          "dcu_s",
          "error_code",
          "error_message",
          "duration_ms",
          "started_at",
          "heartbeat_at",
          "finished_at",
          "created_at"
        ],
        "title": "RunDetailOut"
      },
      "RunIn": {
        "properties": {
          "product": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 2
              },
              {
                "type": "null"
              }
            ],
            "title": "Product"
          },
          "barcode": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9]{8,14}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Barcode"
          },
          "link": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 600,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Link"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "style": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,62}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Style"
          },
          "instruction": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "title": "Instruction"
          },
          "language": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z]{2}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "level": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Level"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "RunIn",
        "description": "\"Kartochka yaratish\" (one button): everything optional — the name (if known), barcode, link, facts, style, instruction (`null` clears) and quality."
      },
      "RunKind": {
        "type": "string",
        "enum": [
          "source_load",
          "ci",
          "deploy",
          "sandbox",
          "inspect",
          "test_connection"
        ],
        "title": "RunKind"
      },
      "RunProgressOut": {
        "properties": {
          "stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage"
          },
          "stage_title": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage Title"
          },
          "done": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Done"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          },
          "days_done": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Days Done"
          },
          "days_total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Days Total"
          },
          "percent": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Percent"
          },
          "eta_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Eta Seconds"
          },
          "requests": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requests"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "title": "RunProgressOut",
        "description": "A running load's state: stage (resource name and title), tasks, history days, percent and time left."
      },
      "RunStatus-Input": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "succeeded",
          "failed",
          "cancelled",
          "skipped",
          "blocked"
        ],
        "title": "RunStatus"
      },
      "RunStopReason": {
        "type": "string",
        "enum": [
          "present",
          "round_limit",
          "execute_limit",
          "token_limit",
          "cost_limit",
          "time_limit",
          "error_limit",
          "cancelled",
          "error"
        ],
        "title": "RunStopReason"
      },
      "RunTrigger": {
        "type": "string",
        "enum": [
          "schedule",
          "manual",
          "event",
          "change",
          "system"
        ],
        "title": "RunTrigger"
      },
      "SampleOut": {
        "properties": {
          "file": {
            "type": "string",
            "title": "File"
          },
          "columns": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Columns"
          },
          "rows": {
            "items": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "array",
            "title": "Rows"
          }
        },
        "type": "object",
        "required": [
          "file",
          "columns",
          "rows"
        ],
        "title": "SampleOut"
      },
      "SchedulerOut": {
        "properties": {
          "last_tick_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Tick At"
          }
        },
        "type": "object",
        "title": "SchedulerOut"
      },
      "SchemaContract": {
        "properties": {
          "tables": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContractMode"
              },
              {
                "type": "null"
              }
            ]
          },
          "columns": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContractMode"
              },
              {
                "type": "null"
              }
            ]
          },
          "data_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContractMode"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "SchemaContract"
      },
      "SchemaKind": {
        "type": "string",
        "enum": [
          "raw",
          "raw_staging",
          "views",
          "other"
        ],
        "title": "SchemaKind"
      },
      "ScrapeTableArgs": {
        "properties": {
          "selector": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "Selector"
          },
          "resource": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,62}$",
            "title": "Resource"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "selector",
          "resource"
        ],
        "title": "ScrapeTableArgs"
      },
      "ScrapeTableStep": {
        "properties": {
          "scrape_table": {
            "$ref": "#/components/schemas/ScrapeTableArgs"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "scrape_table"
        ],
        "title": "ScrapeTableStep"
      },
      "SearchOutcome": {
        "type": "string",
        "enum": [
          "found",
          "nothing",
          "capped",
          "failed"
        ],
        "title": "SearchOutcome",
        "description": "The last \"Internetdan topish\": the texts were updated, nothing new was found, it did not fit the ceiling, or the call failed."
      },
      "SecretKind": {
        "type": "string",
        "enum": [
          "password",
          "token",
          "api_key",
          "oauth_client",
          "certificate",
          "plain"
        ],
        "title": "SecretKind"
      },
      "SecretListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SecretOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "SecretListOut"
      },
      "SecretOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "kind": {
            "$ref": "#/components/schemas/SecretKind"
          },
          "is_set": {
            "type": "boolean",
            "title": "Is Set"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "name",
          "kind",
          "is_set",
          "updated_at"
        ],
        "title": "SecretOut"
      },
      "SecretPutRequest": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/SecretKind"
          },
          "value": {
            "type": "string",
            "maxLength": 8192,
            "minLength": 1,
            "format": "password",
            "title": "Value",
            "writeOnly": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "value"
        ],
        "title": "SecretPutRequest"
      },
      "SecretRequestListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SecretRequestOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "SecretRequestListOut"
      },
      "SecretRequestOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "kind": {
            "$ref": "#/components/schemas/SecretKind"
          },
          "label": {
            "$ref": "#/components/schemas/LocalizedTitle"
          },
          "help": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocalizedText"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Slug"
          },
          "requested_by_kind": {
            "$ref": "#/components/schemas/SecretRequester"
          },
          "status": {
            "$ref": "#/components/schemas/SecretRequestStatus"
          },
          "is_set": {
            "type": "boolean",
            "title": "Is Set"
          },
          "chat_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chat Id"
          },
          "change_request_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Request Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "fulfilled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fulfilled At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "kind",
          "label",
          "help",
          "source_slug",
          "requested_by_kind",
          "status",
          "is_set",
          "chat_id",
          "change_request_id",
          "created_at",
          "expires_at",
          "fulfilled_at"
        ],
        "title": "SecretRequestOut"
      },
      "SecretRequestStatus": {
        "type": "string",
        "enum": [
          "pending",
          "fulfilled",
          "dismissed",
          "expired"
        ],
        "title": "SecretRequestStatus"
      },
      "SecretRequester": {
        "type": "string",
        "enum": [
          "ai",
          "user",
          "package"
        ],
        "title": "SecretRequester"
      },
      "SecretStatusOut": {
        "properties": {
          "slot": {
            "type": "string",
            "title": "Slot"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "kind": {
            "$ref": "#/components/schemas/SecretKind"
          },
          "label": {
            "$ref": "#/components/schemas/Localized"
          },
          "help": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Localized"
              },
              {
                "type": "null"
              }
            ]
          },
          "help_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Help Url"
          },
          "required": {
            "type": "boolean",
            "title": "Required"
          },
          "is_set": {
            "type": "boolean",
            "title": "Is Set"
          }
        },
        "type": "object",
        "required": [
          "slot",
          "name",
          "kind",
          "label",
          "help_url",
          "required",
          "is_set"
        ],
        "title": "SecretStatusOut"
      },
      "SessionListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SessionOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "SessionListOut"
      },
      "SessionOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip"
          },
          "user_agent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Agent"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time",
            "title": "Last Seen At"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "is_current": {
            "type": "boolean",
            "title": "Is Current",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "ip",
          "user_agent",
          "last_seen_at",
          "expires_at",
          "created_at"
        ],
        "title": "SessionOut",
        "description": "How users see their own sessions. The token hash never leaves the server."
      },
      "SettingsOut": {
        "properties": {
          "chat_token_budget": {
            "type": "integer",
            "title": "Chat Token Budget"
          },
          "chat_max_rounds": {
            "type": "integer",
            "title": "Chat Max Rounds"
          },
          "chat_limits": {
            "$ref": "#/components/schemas/ChatLimitsOut"
          },
          "theme": {
            "$ref": "#/components/schemas/Theme"
          },
          "accent_color": {
            "type": "string",
            "title": "Accent Color"
          },
          "logo_url": {
            "type": "null",
            "title": "Logo Url",
            "deprecated": true
          },
          "ai_data_access": {
            "$ref": "#/components/schemas/AiDataAccess"
          }
        },
        "type": "object",
        "required": [
          "chat_token_budget",
          "chat_max_rounds",
          "chat_limits",
          "theme",
          "accent_color",
          "ai_data_access"
        ],
        "title": "SettingsOut"
      },
      "Size": {
        "type": "string",
        "enum": [
          "thumb",
          "full"
        ]
      },
      "SkillIn-Input": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "period": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RelativeRange"
              },
              {
                "type": "null"
              }
            ]
          },
          "values": {
            "patternProperties": {
              "^[a-z][a-z0-9_]{0,31}$": {
                "type": "string",
                "maxLength": 4000
              }
            },
            "type": "object",
            "maxProperties": 8,
            "title": "Values"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "slug"
        ],
        "title": "SkillIn",
        "description": "The analysis chosen with a message: its name or alias, the period (the default when absent) and its other values by key."
      },
      "SkillIn-Output": {
        "properties": {
          "slug": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{1,31}$",
            "title": "Slug"
          },
          "period": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RelativeRange"
              },
              {
                "type": "null"
              }
            ]
          },
          "values": {
            "patternProperties": {
              "^[a-z][a-z0-9_]{0,31}$": {
                "type": "string",
                "maxLength": 4000
              }
            },
            "type": "object",
            "maxProperties": 8,
            "title": "Values"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "slug"
        ],
        "title": "SkillIn",
        "description": "The analysis chosen with a message: its name or alias, the period (the default when absent) and its other values by key."
      },
      "SkillInputKind": {
        "type": "string",
        "enum": [
          "period",
          "choice",
          "product",
          "text",
          "number"
        ],
        "title": "SkillInputKind"
      },
      "SkillInputOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "kind": {
            "$ref": "#/components/schemas/SkillInputKind"
          },
          "label": {
            "$ref": "#/components/schemas/TextsOut"
          },
          "placeholder": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TextsOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "required": {
            "type": "boolean",
            "title": "Required"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/SkillOptionOut"
            },
            "type": "array",
            "title": "Options",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "key",
          "kind",
          "label",
          "required"
        ],
        "title": "SkillInputOut",
        "description": "What the composer and the bot ask for: kind, label, placeholder, whether it is required and its options (periods, a choice's own)."
      },
      "SkillListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SkillOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "SkillListOut"
      },
      "SkillOptionOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "title": {
            "$ref": "#/components/schemas/TextsOut"
          }
        },
        "type": "object",
        "required": [
          "key",
          "title"
        ],
        "title": "SkillOptionOut"
      },
      "SkillOut": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "group": {
            "type": "string",
            "title": "Group"
          },
          "version": {
            "type": "integer",
            "title": "Version"
          },
          "title": {
            "$ref": "#/components/schemas/TextsOut"
          },
          "hint": {
            "$ref": "#/components/schemas/TextsOut"
          },
          "aliases": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Aliases"
          },
          "periods": {
            "items": {
              "$ref": "#/components/schemas/SkillPeriodOut"
            },
            "type": "array",
            "title": "Periods"
          },
          "inputs": {
            "items": {
              "$ref": "#/components/schemas/SkillInputOut"
            },
            "type": "array",
            "title": "Inputs"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "group",
          "version",
          "title",
          "hint",
          "aliases",
          "periods",
          "inputs"
        ],
        "title": "SkillOut"
      },
      "SkillPeriodOut": {
        "properties": {
          "key": {
            "$ref": "#/components/schemas/RelativeRange"
          },
          "title": {
            "$ref": "#/components/schemas/TextsOut"
          }
        },
        "type": "object",
        "required": [
          "key",
          "title"
        ],
        "title": "SkillPeriodOut"
      },
      "SkuFitOut": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "fits": {
            "type": "boolean",
            "title": "Fits"
          },
          "utilization_pct": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Utilization Pct"
          },
          "misses": {
            "items": {
              "$ref": "#/components/schemas/Miss"
            },
            "type": "array",
            "title": "Misses"
          }
        },
        "type": "object",
        "required": [
          "code",
          "fits",
          "utilization_pct",
          "misses"
        ],
        "title": "SkuFitOut"
      },
      "SkuLimits": {
        "properties": {
          "jobs": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Jobs"
          },
          "queries_interactive": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Queries Interactive"
          },
          "queries_background": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Queries Background"
          },
          "storage_gb": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Storage Gb"
          },
          "ingest_rows_month": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Ingest Rows Month"
          },
          "ingest_gb_month": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Ingest Gb Month"
          },
          "ai_credits_month": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Ai Credits Month"
          },
          "min_refresh_minutes": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Min Refresh Minutes"
          },
          "query_timeout_seconds": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Query Timeout Seconds"
          },
          "ingest_timeout_seconds": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Ingest Timeout Seconds"
          },
          "explore_connections": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Explore Connections"
          },
          "work_mem_mb": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Work Mem Mb"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "jobs",
          "queries_interactive",
          "queries_background",
          "storage_gb",
          "ingest_rows_month",
          "ingest_gb_month",
          "ai_credits_month",
          "min_refresh_minutes",
          "query_timeout_seconds",
          "ingest_timeout_seconds",
          "explore_connections",
          "work_mem_mb"
        ],
        "title": "SkuLimits"
      },
      "SkuOut": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "version": {
            "type": "integer",
            "title": "Version"
          },
          "dcu": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dcu"
          },
          "tenancy": {
            "$ref": "#/components/schemas/SkuTenancy"
          },
          "engines": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Engines"
          }
        },
        "type": "object",
        "required": [
          "code",
          "version",
          "dcu",
          "tenancy",
          "engines"
        ],
        "title": "SkuOut"
      },
      "SkuRule": {
        "properties": {
          "product_max_chars": {
            "type": "integer",
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "Product Max Chars",
            "default": 32
          },
          "variant_max_chars": {
            "type": "integer",
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "Variant Max Chars",
            "default": 32
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "SkuRule",
        "description": "The SKU length: the product's and one colour's (variant's)."
      },
      "SkuTenancy": {
        "type": "string",
        "enum": [
          "shared",
          "dedicated",
          "byo"
        ],
        "title": "SkuTenancy"
      },
      "SlotOut": {
        "properties": {
          "slot": {
            "type": "integer",
            "maximum": 9.0,
            "minimum": 1.0,
            "title": "Slot"
          },
          "layout": {
            "type": "string",
            "title": "Layout"
          },
          "text": {
            "type": "boolean",
            "title": "Text"
          },
          "ai": {
            "type": "boolean",
            "title": "Ai",
            "default": false
          },
          "state": {
            "type": "string",
            "enum": [
              "waiting",
              "running",
              "ready",
              "failed"
            ],
            "title": "State"
          },
          "producer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Producer"
              },
              {
                "type": "null"
              }
            ]
          },
          "issue": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issue"
          },
          "has_previous": {
            "type": "boolean",
            "title": "Has Previous",
            "default": false
          },
          "versions": {
            "patternProperties": {
              "^[a-z]{2}$": {
                "type": "string",
                "format": "uuid"
              }
            },
            "type": "object",
            "title": "Versions"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "slot",
          "layout",
          "text",
          "state"
        ],
        "title": "SlotOut",
        "description": "A final image slot: layout, with text or not, state, who made it, issue and image ids per language."
      },
      "SnapshotOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "schema_hash": {
            "type": "string",
            "title": "Schema Hash"
          },
          "tables": {
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "type": "object",
            "title": "Tables"
          },
          "profile": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "run_id",
          "schema_hash",
          "tables",
          "profile",
          "created_at"
        ],
        "title": "SnapshotOut"
      },
      "SourceCreateRequest": {
        "properties": {
          "version": {
            "type": "integer",
            "const": 1,
            "title": "Version",
            "default": 1
          },
          "connector": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,31}$",
            "title": "Connector"
          },
          "package": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9-]{0,31}/[a-z][a-z0-9-]{0,62}@(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]{1,32})?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Package"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "config": {
            "patternProperties": {
              "^[a-z][a-z0-9_]{0,62}$": {
                "$ref": "#/components/schemas/JsonValue"
              }
            },
            "type": "object",
            "maxProperties": 64,
            "title": "Config"
          },
          "secrets": {
            "patternProperties": {
              "^[a-z][a-z0-9_]{0,62}$": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{1,63}$"
              }
            },
            "type": "object",
            "maxProperties": 20,
            "title": "Secrets"
          },
          "resources": {
            "items": {
              "$ref": "#/components/schemas/Resource"
            },
            "type": "array",
            "maxItems": 100,
            "title": "Resources"
          },
          "schedule": {
            "anyOf": [
              {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/IntervalSchedule"
                  },
                  {
                    "$ref": "#/components/schemas/HourlySchedule"
                  },
                  {
                    "$ref": "#/components/schemas/DailySchedule"
                  },
                  {
                    "$ref": "#/components/schemas/WeeklySchedule"
                  }
                ],
                "discriminator": {
                  "propertyName": "kind",
                  "mapping": {
                    "daily": "#/components/schemas/DailySchedule",
                    "hourly": "#/components/schemas/HourlySchedule",
                    "interval": "#/components/schemas/IntervalSchedule",
                    "weekly": "#/components/schemas/WeeklySchedule"
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule"
          },
          "egress": {
            "items": {
              "$ref": "#/components/schemas/EgressRequest"
            },
            "type": "array",
            "maxItems": 20,
            "title": "Egress"
          },
          "rate_limit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RateLimit"
              },
              {
                "type": "null"
              }
            ]
          },
          "schema_contract": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SchemaContract"
              },
              {
                "type": "null"
              }
            ]
          },
          "rest_api": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RestApiConfig"
              },
              {
                "type": "null"
              }
            ]
          },
          "browser": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BrowserFlow"
              },
              {
                "type": "null"
              }
            ]
          },
          "slug": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,31}$",
            "title": "Slug"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "connector",
          "slug"
        ],
        "title": "SourceCreateRequest",
        "description": "From the Connect form or an agent: the content of `sources/<slug>/source.yml` plus the slug; secrets by name only."
      },
      "SourceCreatedOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "connector_key": {
            "type": "string",
            "title": "Connector Key"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "origin": {
            "type": "string",
            "title": "Origin"
          },
          "timezone": {
            "type": "string",
            "title": "Timezone"
          },
          "raw_schema": {
            "type": "string",
            "title": "Raw Schema"
          },
          "data_version": {
            "type": "integer",
            "title": "Data Version"
          },
          "last_loaded_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Loaded At"
          },
          "last_load_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Load Status"
          },
          "last_load_rows": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Load Rows"
          },
          "load_stopped": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Load Stopped"
          },
          "load_progress": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoadProgressOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "change_number": {
            "type": "integer",
            "title": "Change Number"
          }
        },
        "type": "object",
        "required": [
          "id",
          "slug",
          "title",
          "connector_key",
          "kind",
          "status",
          "origin",
          "timezone",
          "raw_schema",
          "data_version",
          "last_loaded_at",
          "last_load_status",
          "last_load_rows",
          "created_at",
          "updated_at",
          "change_number"
        ],
        "title": "SourceCreatedOut"
      },
      "SourceDetailOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "connector_key": {
            "type": "string",
            "title": "Connector Key"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "origin": {
            "type": "string",
            "title": "Origin"
          },
          "timezone": {
            "type": "string",
            "title": "Timezone"
          },
          "raw_schema": {
            "type": "string",
            "title": "Raw Schema"
          },
          "data_version": {
            "type": "integer",
            "title": "Data Version"
          },
          "last_loaded_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Loaded At"
          },
          "last_load_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Load Status"
          },
          "last_load_rows": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Load Rows"
          },
          "load_stopped": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Load Stopped"
          },
          "load_progress": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoadProgressOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "config": {
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonValue"
            },
            "type": "object",
            "title": "Config"
          },
          "secret_names": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Secret Names"
          },
          "resources": {
            "items": {
              "$ref": "#/components/schemas/SourcesResourceOut"
            },
            "type": "array",
            "title": "Resources"
          },
          "egress": {
            "items": {
              "$ref": "#/components/schemas/EgressRuleOut"
            },
            "type": "array",
            "title": "Egress"
          },
          "snapshot": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SnapshotOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "slug",
          "title",
          "connector_key",
          "kind",
          "status",
          "origin",
          "timezone",
          "raw_schema",
          "data_version",
          "last_loaded_at",
          "last_load_status",
          "last_load_rows",
          "created_at",
          "updated_at",
          "config",
          "secret_names",
          "resources",
          "egress",
          "snapshot"
        ],
        "title": "SourceDetailOut"
      },
      "SourceFileItemOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "file_name": {
            "type": "string",
            "title": "File Name"
          },
          "content_type": {
            "type": "string",
            "title": "Content Type"
          },
          "size_bytes": {
            "type": "integer",
            "title": "Size Bytes"
          },
          "state": {
            "$ref": "#/components/schemas/FileState"
          },
          "load_table": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Load Table"
          },
          "load_run_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Load Run Id"
          },
          "loaded_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Loaded At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "file_name",
          "content_type",
          "size_bytes",
          "state",
          "load_table",
          "load_run_id",
          "loaded_at",
          "created_at"
        ],
        "title": "SourceFileItemOut",
        "description": "A source file in the list: its `state` is computed the same way as the source's file plan."
      },
      "SourceFileListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SourceFileItemOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          },
          "max_file_mb": {
            "type": "integer",
            "title": "Max File Mb"
          },
          "pending": {
            "type": "integer",
            "title": "Pending"
          },
          "pending_bytes": {
            "type": "integer",
            "title": "Pending Bytes"
          }
        },
        "type": "object",
        "required": [
          "items",
          "max_file_mb",
          "pending",
          "pending_bytes"
        ],
        "title": "SourceFileListOut"
      },
      "SourceFileOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "file_name": {
            "type": "string",
            "title": "File Name"
          },
          "content_type": {
            "type": "string",
            "title": "Content Type"
          },
          "size_bytes": {
            "type": "integer",
            "title": "Size Bytes"
          },
          "sha256": {
            "type": "string",
            "title": "Sha256"
          },
          "source_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Slug"
          },
          "sheets": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": {
                    "$ref": "#/components/schemas/JsonValue"
                  },
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sheets"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "file_name",
          "content_type",
          "size_bytes",
          "sha256",
          "sheets",
          "created_at"
        ],
        "title": "SourceFileOut"
      },
      "SourceFileRemovedOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "file_name": {
            "type": "string",
            "title": "File Name"
          },
          "state": {
            "$ref": "#/components/schemas/FileState"
          },
          "load_table": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Load Table"
          },
          "kept": {
            "type": "string",
            "enum": [
              "none",
              "rows",
              "table"
            ],
            "title": "Kept"
          }
        },
        "type": "object",
        "required": [
          "id",
          "file_name",
          "state",
          "load_table",
          "kept"
        ],
        "title": "SourceFileRemovedOut",
        "description": "A removed file: `kept` tells whether the data loaded from it stays in the warehouse (`rows`, `table`) or not (`none`)."
      },
      "SourceIn": {
        "properties": {
          "image_id": {
            "type": "string",
            "format": "uuid",
            "title": "Image Id"
          },
          "original": {
            "type": "boolean",
            "title": "Original",
            "default": false
          },
          "variant": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variant"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "image_id"
        ],
        "title": "SourceIn",
        "description": "Swap: an own photo of this card (cut out, `original` = framed as is) or an earlier version of the slot; with `variant` the photo must belong to that colour."
      },
      "SourceInfoOut": {
        "properties": {
          "connector": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connector"
          },
          "egress_hosts": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Egress Hosts"
          },
          "schedule": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule"
          },
          "resources": {
            "items": {
              "$ref": "#/components/schemas/MarketplaceResourceOut"
            },
            "type": "array",
            "title": "Resources"
          },
          "phones_masked": {
            "type": "boolean",
            "title": "Phones Masked",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "connector",
          "egress_hosts",
          "schedule",
          "resources"
        ],
        "title": "SourceInfoOut"
      },
      "SourceListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SourcesSourceOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "SourceListOut"
      },
      "SourceOrigin": {
        "type": "string",
        "enum": [
          "form",
          "ai",
          "package",
          "onboarding"
        ],
        "title": "SourceOrigin"
      },
      "SourceRefreshIn": {
        "properties": {
          "refresh_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1440.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Refresh Minutes"
          },
          "refresh_plan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WeeklyTimesSchedule"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "SourceRefreshIn",
        "description": "An interval (minutes) or days and times, one of them; both `null` is the package's own schedule (`source.yml`)."
      },
      "SourceStatus": {
        "type": "string",
        "enum": [
          "draft",
          "active",
          "paused",
          "removed"
        ],
        "title": "SourceStatus"
      },
      "SpeechOut": {
        "properties": {
          "message_id": {
            "type": "integer",
            "title": "Message Id"
          },
          "status": {
            "$ref": "#/components/schemas/SpeechStatus"
          },
          "voice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice"
          },
          "seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seconds"
          }
        },
        "type": "object",
        "required": [
          "message_id",
          "status"
        ],
        "title": "SpeechOut"
      },
      "SpeechStatus": {
        "type": "string",
        "enum": [
          "ready",
          "pending",
          "failed"
        ],
        "title": "SpeechStatus"
      },
      "SpendOut": {
        "properties": {
          "spent_uzs": {
            "type": "integer",
            "title": "Spent Uzs"
          },
          "cap_uzs": {
            "type": "integer",
            "title": "Cap Uzs"
          },
          "capped": {
            "type": "boolean",
            "title": "Capped",
            "default": false
          },
          "estimate_uzs": {
            "type": "integer",
            "title": "Estimate Uzs",
            "default": 0
          },
          "redo_uzs": {
            "type": "integer",
            "title": "Redo Uzs",
            "default": 0
          },
          "search_uzs": {
            "type": "integer",
            "title": "Search Uzs",
            "default": 0
          },
          "search_fits": {
            "type": "boolean",
            "title": "Search Fits",
            "default": false
          },
          "colours": {
            "items": {
              "$ref": "#/components/schemas/ColourSpendOut"
            },
            "type": "array",
            "title": "Colours"
          },
          "levels": {
            "items": {
              "$ref": "#/components/schemas/LevelSpendOut"
            },
            "type": "array",
            "title": "Levels"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "spent_uzs",
          "cap_uzs"
        ],
        "title": "SpendOut",
        "description": "Spend in so'm: spent, ceiling and estimate (all colours), whether capped, the \"Qayta yaratish\" and \"Internetdan topish\" prices (`search_fits`: whether the search fits colour 1's ceiling) and each colour's (`colours`)."
      },
      "SpendStop": {
        "type": "string",
        "enum": [
          "cap",
          "budget"
        ],
        "title": "SpendStop",
        "description": "Why money cannot be spent: the card's own quality ceiling is used up, or the workspace's money stopped AI."
      },
      "SqlColumn": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "Name"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "number",
              "time",
              "boolean"
            ],
            "title": "Type"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 12,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "label": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "type"
        ],
        "title": "SqlColumn"
      },
      "SqlResultElement": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "sql_result",
            "title": "Kind",
            "default": "sql_result"
          },
          "visual": {
            "type": "string",
            "enum": [
              "number",
              "bar",
              "line",
              "table"
            ],
            "title": "Visual"
          },
          "columns": {
            "items": {
              "$ref": "#/components/schemas/SqlColumn"
            },
            "type": "array",
            "maxItems": 30,
            "minItems": 1,
            "title": "Columns"
          },
          "rows": {
            "items": {
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            "type": "array",
            "maxItems": 200,
            "title": "Rows"
          },
          "row_count": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Row Count"
          },
          "truncated": {
            "type": "boolean",
            "title": "Truncated",
            "default": false
          },
          "hidden": {
            "type": "boolean",
            "title": "Hidden",
            "default": false
          },
          "sql": {
            "type": "string",
            "maxLength": 8000,
            "minLength": 1,
            "title": "Sql"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "visual",
          "columns",
          "row_count",
          "sql"
        ],
        "title": "SqlResultElement"
      },
      "StaleRunsOut": {
        "properties": {
          "chat_runs": {
            "type": "integer",
            "title": "Chat Runs"
          }
        },
        "type": "object",
        "required": [
          "chat_runs"
        ],
        "title": "StaleRunsOut"
      },
      "StepKey": {
        "type": "string",
        "enum": [
          "connection",
          "chat",
          "telegram",
          "delivery"
        ],
        "title": "StepKey"
      },
      "StepKind": {
        "type": "string",
        "enum": [
          "extract",
          "normalize",
          "load",
          "test",
          "publish",
          "check"
        ],
        "title": "StepKind"
      },
      "StepStatus": {
        "type": "string",
        "enum": [
          "running",
          "succeeded",
          "failed",
          "warned",
          "skipped"
        ],
        "title": "StepStatus"
      },
      "SttChoice": {
        "type": "string",
        "enum": [
          "gemini",
          "transcribe",
          "openai"
        ],
        "title": "SttChoice"
      },
      "StyleOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "names": {
            "$ref": "#/components/schemas/Words"
          },
          "hints": {
            "$ref": "#/components/schemas/Words"
          },
          "preview": {
            "type": "string",
            "title": "Preview"
          },
          "text": {
            "type": "boolean",
            "title": "Text"
          },
          "scene_only": {
            "type": "boolean",
            "title": "Scene Only",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "names",
          "hints",
          "preview",
          "text"
        ],
        "title": "StyleOut",
        "description": "A style: name and hint in three languages, its preview path, whether the image carries text and whether the style only shows in an AI picture."
      },
      "SubscriptionIn": {
        "properties": {
          "subscribed": {
            "type": "boolean",
            "title": "Subscribed"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "subscribed"
        ],
        "title": "SubscriptionIn"
      },
      "SubscriptionMode": {
        "type": "string",
        "enum": [
          "opt_in",
          "opt_out"
        ],
        "title": "SubscriptionMode"
      },
      "SubscriptionOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "subscribed": {
            "type": "boolean",
            "title": "Subscribed"
          },
          "subscription": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SubscriptionMode"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "key",
          "subscribed",
          "subscription"
        ],
        "title": "SubscriptionOut"
      },
      "SyncRunOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "connection_id": {
            "type": "integer",
            "title": "Connection Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "total_objects": {
            "type": "integer",
            "title": "Total Objects"
          },
          "done_objects": {
            "type": "integer",
            "title": "Done Objects"
          },
          "added_count": {
            "type": "integer",
            "title": "Added Count"
          },
          "changed_count": {
            "type": "integer",
            "title": "Changed Count"
          },
          "deleted_count": {
            "type": "integer",
            "title": "Deleted Count"
          },
          "failed_count": {
            "type": "integer",
            "title": "Failed Count"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "connection_id",
          "status",
          "total_objects",
          "done_objects",
          "added_count",
          "changed_count",
          "deleted_count",
          "failed_count",
          "error",
          "started_at",
          "finished_at",
          "created_at"
        ],
        "title": "SyncRunOut"
      },
      "TableColumnOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "data_type": {
            "type": "string",
            "title": "Data Type"
          },
          "nullable": {
            "type": "boolean",
            "title": "Nullable"
          }
        },
        "type": "object",
        "required": [
          "name",
          "data_type",
          "nullable"
        ],
        "title": "TableColumnOut"
      },
      "TablesStatus": {
        "type": "string",
        "enum": [
          "ready",
          "collecting",
          "not_provisioned"
        ],
        "title": "TablesStatus"
      },
      "TelegramGoogleClaimOut": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "authenticated"
            ],
            "title": "Status"
          },
          "tokens": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TokenPairOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "TelegramGoogleClaimOut",
        "description": "Not yet confirmed in the browser (`pending`), or confirmed with a session opened (`authenticated`)."
      },
      "TelegramGoogleClaimRequest": {
        "properties": {
          "nonce": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "title": "Nonce"
          },
          "init_data": {
            "type": "string",
            "maxLength": 4096,
            "minLength": 1,
            "title": "Init Data"
          }
        },
        "type": "object",
        "required": [
          "nonce",
          "init_data"
        ],
        "title": "TelegramGoogleClaimRequest"
      },
      "TelegramGoogleRequest": {
        "properties": {
          "nonce": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "title": "Nonce"
          }
        },
        "type": "object",
        "required": [
          "nonce"
        ],
        "title": "TelegramGoogleRequest",
        "description": "The nonce of a Google link request (`/tg/google?r=`)."
      },
      "TelegramGoogleStartOut": {
        "properties": {
          "nonce": {
            "type": "string",
            "title": "Nonce"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "nonce",
          "url",
          "expires_at"
        ],
        "title": "TelegramGoogleStartOut",
        "description": "The address to open in the browser (`url`) and the nonce the Mini App asks with; it expires at `expires_at`."
      },
      "TelegramGoogleViewOut": {
        "properties": {
          "telegram": {
            "type": "string",
            "title": "Telegram"
          },
          "account": {
            "type": "string",
            "title": "Account"
          },
          "confirmed": {
            "type": "boolean",
            "title": "Confirmed"
          }
        },
        "type": "object",
        "required": [
          "telegram",
          "account",
          "confirmed"
        ],
        "title": "TelegramGoogleViewOut",
        "description": "The confirm page: which Telegram (`@username` or first name), which account, and whether it is already confirmed."
      },
      "TelegramLinkCodeOut": {
        "properties": {
          "link": {
            "type": "string",
            "title": "Link"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "link",
          "expires_at"
        ],
        "title": "TelegramLinkCodeOut"
      },
      "TelegramLinkOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "username": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Username"
          },
          "locale": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Locale"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "linked_at": {
            "type": "string",
            "format": "date-time",
            "title": "Linked At"
          },
          "unlinked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unlinked At"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          }
        },
        "type": "object",
        "required": [
          "id",
          "username",
          "locale",
          "is_active",
          "linked_at",
          "unlinked_at",
          "last_error"
        ],
        "title": "TelegramLinkOut"
      },
      "TelegramLoginRequest": {
        "properties": {
          "init_data": {
            "type": "string",
            "maxLength": 4096,
            "minLength": 1,
            "title": "Init Data"
          }
        },
        "type": "object",
        "required": [
          "init_data"
        ],
        "title": "TelegramLoginRequest",
        "description": "The `initData` the Telegram Mini App gives, unchanged (`Telegram.WebApp.initData`)."
      },
      "TelegramStatusOut": {
        "properties": {
          "configured": {
            "type": "boolean",
            "title": "Configured"
          },
          "bot_username": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bot Username"
          },
          "links": {
            "items": {
              "$ref": "#/components/schemas/TelegramLinkOut"
            },
            "type": "array",
            "title": "Links"
          }
        },
        "type": "object",
        "required": [
          "configured",
          "bot_username",
          "links"
        ],
        "title": "TelegramStatusOut"
      },
      "TemplateOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "title": {
            "$ref": "#/components/schemas/Localized"
          },
          "headers": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Headers"
          }
        },
        "type": "object",
        "required": [
          "key",
          "title",
          "headers"
        ],
        "title": "TemplateOut"
      },
      "TestStateOut": {
        "properties": {
          "run_id": {
            "type": "integer",
            "title": "Run Id"
          },
          "status": {
            "$ref": "#/components/schemas/RunsRunStatus"
          },
          "ok": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ok"
          },
          "checks": {
            "items": {
              "$ref": "#/components/schemas/ProbeOut"
            },
            "type": "array",
            "title": "Checks"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "read_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Read Only"
          }
        },
        "type": "object",
        "required": [
          "run_id",
          "status",
          "ok",
          "checks",
          "error_code",
          "error_message",
          "started_at",
          "finished_at"
        ],
        "title": "TestStateOut"
      },
      "TextsOut": {
        "properties": {
          "uz": {
            "type": "string",
            "title": "Uz"
          },
          "ru": {
            "type": "string",
            "title": "Ru"
          },
          "en": {
            "type": "string",
            "title": "En"
          }
        },
        "type": "object",
        "required": [
          "uz",
          "ru",
          "en"
        ],
        "title": "TextsOut"
      },
      "Theme": {
        "type": "string",
        "enum": [
          "system",
          "light",
          "dark"
        ],
        "title": "Theme"
      },
      "TierStateOut": {
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/PlanKey"
          },
          "sku": {
            "type": "string",
            "title": "Sku"
          },
          "price_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Price Uzs"
          },
          "allowance_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Allowance Uzs"
          },
          "usage_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Usage Uzs"
          },
          "left_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Left Uzs"
          },
          "answers_left": {
            "type": "integer",
            "title": "Answers Left"
          },
          "answer_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Answer Uzs"
          },
          "next_plan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlanKey"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_price_uzs": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Price Uzs"
          },
          "next_price_agreed": {
            "type": "boolean",
            "title": "Next Price Agreed",
            "default": false
          },
          "move_up_uzs": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Move Up Uzs"
          },
          "pinned": {
            "type": "boolean",
            "title": "Pinned"
          }
        },
        "type": "object",
        "required": [
          "plan",
          "sku",
          "price_uzs",
          "allowance_uzs",
          "usage_uzs",
          "left_uzs",
          "answers_left",
          "answer_uzs",
          "next_plan",
          "next_price_uzs",
          "move_up_uzs",
          "pinned"
        ],
        "title": "TierStateOut",
        "description": "The current tier: price, this month's included and used usage, \"~N answers\", the next tier and the pin."
      },
      "TileDataIn": {
        "properties": {
          "filters": {
            "patternProperties": {
              "^[a-z][a-z0-9_]{0,62}$": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RelativeRange"
                  },
                  {
                    "$ref": "#/components/schemas/DateRange"
                  },
                  {
                    "items": {
                      "type": "string",
                      "maxLength": 256
                    },
                    "type": "array",
                    "maxItems": 100
                  }
                ]
              }
            },
            "type": "object",
            "maxProperties": 10,
            "title": "Filters"
          },
          "locale": {
            "$ref": "#/components/schemas/Locale",
            "default": "uz"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "TileDataIn"
      },
      "TileDataOut": {
        "properties": {
          "dashboard": {
            "type": "string",
            "title": "Dashboard"
          },
          "chart": {
            "type": "string",
            "title": "Chart"
          },
          "status": {
            "$ref": "#/components/schemas/TileStatus"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "visual": {
            "$ref": "#/components/schemas/ChartVisual"
          },
          "sql_result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SqlResultElement"
              },
              {
                "type": "null"
              }
            ]
          },
          "filters": {
            "$ref": "#/components/schemas/TileFiltersOut"
          },
          "poll_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Poll Seconds"
          }
        },
        "type": "object",
        "required": [
          "dashboard",
          "chart",
          "status",
          "title",
          "visual",
          "filters"
        ],
        "title": "TileDataOut"
      },
      "TileFiltersOut": {
        "properties": {
          "applied": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Applied"
          },
          "ignored": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Ignored"
          }
        },
        "type": "object",
        "required": [
          "applied",
          "ignored"
        ],
        "title": "TileFiltersOut"
      },
      "TileOut": {
        "properties": {
          "chart": {
            "type": "string",
            "title": "Chart"
          },
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Title"
          },
          "visual": {
            "$ref": "#/components/schemas/ChartVisual"
          },
          "x": {
            "type": "integer",
            "title": "X"
          },
          "y": {
            "type": "integer",
            "title": "Y"
          },
          "w": {
            "type": "integer",
            "title": "W"
          },
          "h": {
            "type": "integer",
            "title": "H"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "chart",
          "title",
          "visual",
          "x",
          "y",
          "w",
          "h",
          "status"
        ],
        "title": "TileOut"
      },
      "TilePosition": {
        "properties": {
          "x": {
            "type": "integer",
            "exclusiveMaximum": 12.0,
            "minimum": 0.0,
            "title": "X"
          },
          "y": {
            "type": "integer",
            "maximum": 500.0,
            "minimum": 0.0,
            "title": "Y"
          },
          "w": {
            "type": "integer",
            "maximum": 12.0,
            "minimum": 1.0,
            "title": "W"
          },
          "h": {
            "type": "integer",
            "maximum": 24.0,
            "minimum": 1.0,
            "title": "H"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "x",
          "y",
          "w",
          "h"
        ],
        "title": "TilePosition"
      },
      "TileStatus": {
        "type": "string",
        "enum": [
          "ok",
          "recreate",
          "error"
        ],
        "title": "TileStatus"
      },
      "TitleRule": {
        "properties": {
          "min_words": {
            "type": "integer",
            "maximum": 10.0,
            "minimum": 1.0,
            "title": "Min Words"
          },
          "max_chars": {
            "type": "integer",
            "maximum": 120.0,
            "minimum": 20.0,
            "title": "Max Chars"
          },
          "rule": {
            "$ref": "#/components/schemas/Words"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "min_words",
          "max_chars",
          "rule"
        ],
        "title": "TitleRule"
      },
      "TodayLineOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "package": {
            "type": "string",
            "title": "Package"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "ask": {
            "type": "string",
            "title": "Ask"
          },
          "value": {
            "type": "number",
            "title": "Value"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "day": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Day"
          },
          "change": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change"
          },
          "versus": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Versus"
          },
          "part": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Part"
          },
          "part_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Part Label"
          },
          "names": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Names"
          }
        },
        "type": "object",
        "required": [
          "key",
          "package",
          "label",
          "ask",
          "value",
          "unit",
          "day",
          "change",
          "versus",
          "part",
          "part_label",
          "names"
        ],
        "title": "TodayLineOut"
      },
      "TodayOut": {
        "properties": {
          "today": {
            "type": "string",
            "format": "date",
            "title": "Today"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/TodayLineOut"
            },
            "type": "array",
            "title": "Lines"
          },
          "tip": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TodayTipOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "today",
          "lines",
          "tip"
        ],
        "title": "TodayOut"
      },
      "TodayTipOut": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "values": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Values"
          }
        },
        "type": "object",
        "required": [
          "text",
          "values"
        ],
        "title": "TodayTipOut"
      },
      "TokenAuth": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "token",
            "title": "Kind"
          },
          "token": {
            "type": "string",
            "maxLength": 512,
            "minLength": 8,
            "format": "password",
            "title": "Token",
            "writeOnly": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "token"
        ],
        "title": "TokenAuth"
      },
      "TokenPairOut": {
        "properties": {
          "access_token": {
            "type": "string",
            "title": "Access Token"
          },
          "refresh_token": {
            "type": "string",
            "title": "Refresh Token"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "refresh_expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Refresh Expires At"
          },
          "token_type": {
            "type": "string",
            "title": "Token Type",
            "default": "bearer"
          }
        },
        "type": "object",
        "required": [
          "access_token",
          "refresh_token",
          "expires_at",
          "refresh_expires_at"
        ],
        "title": "TokenPairOut"
      },
      "TokensOut": {
        "properties": {
          "input": {
            "type": "integer",
            "title": "Input"
          },
          "output": {
            "type": "integer",
            "title": "Output"
          },
          "cached": {
            "type": "integer",
            "title": "Cached"
          },
          "reasoning": {
            "type": "integer",
            "title": "Reasoning"
          }
        },
        "type": "object",
        "required": [
          "input",
          "output",
          "cached",
          "reasoning"
        ],
        "title": "TokensOut"
      },
      "TranscriptOut": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "language": {
            "$ref": "#/components/schemas/Locale"
          },
          "seconds": {
            "type": "number",
            "title": "Seconds"
          }
        },
        "type": "object",
        "required": [
          "text",
          "language",
          "seconds"
        ],
        "title": "TranscriptOut"
      },
      "TrialOut": {
        "properties": {
          "started_at": {
            "type": "string",
            "format": "date-time",
            "title": "Started At"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time",
            "title": "Ends At"
          },
          "ended": {
            "type": "boolean",
            "title": "Ended"
          },
          "seconds_left": {
            "type": "integer",
            "title": "Seconds Left"
          }
        },
        "type": "object",
        "required": [
          "started_at",
          "ends_at",
          "ended",
          "seconds_left"
        ],
        "title": "TrialOut",
        "description": "The free trial: start and end time (UTC), whether it had ended when answered and how many seconds remain."
      },
      "TtsChoice": {
        "type": "string",
        "enum": [
          "gemini",
          "gemini_lite",
          "openai"
        ],
        "title": "TtsChoice"
      },
      "UiMode": {
        "type": "string",
        "enum": [
          "simple",
          "developer"
        ],
        "title": "UiMode"
      },
      "UninstallPreviewOut": {
        "properties": {
          "dashboards": {
            "type": "integer",
            "title": "Dashboards"
          },
          "deliveries": {
            "type": "integer",
            "title": "Deliveries"
          },
          "blockers": {
            "items": {
              "$ref": "#/components/schemas/BlockerOut"
            },
            "type": "array",
            "title": "Blockers"
          },
          "removable": {
            "type": "boolean",
            "title": "Removable"
          }
        },
        "type": "object",
        "required": [
          "dashboards",
          "deliveries",
          "blockers",
          "removable"
        ],
        "title": "UninstallPreviewOut",
        "description": "Before a connection is removed: how many dashboards and deliveries go with it and what stands in the way."
      },
      "UninstallRequest": {
        "properties": {
          "force": {
            "type": "boolean",
            "title": "Force",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "UninstallRequest"
      },
      "UninstallResultOut": {
        "properties": {
          "package": {
            "type": "string",
            "title": "Package"
          },
          "change_number": {
            "type": "integer",
            "title": "Change Number"
          },
          "approval": {
            "type": "string",
            "enum": [
              "given",
              "owner_needed"
            ],
            "title": "Approval"
          },
          "broken_charts": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Broken Charts"
          },
          "broken_dashboards": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Broken Dashboards"
          },
          "removal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RemovalOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "package",
          "change_number",
          "approval"
        ],
        "title": "UninstallResultOut"
      },
      "UnsubscribeOut": {
        "properties": {
          "dashboard": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dashboard"
          },
          "workspace": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workspace"
          },
          "unsubscribed": {
            "type": "boolean",
            "title": "Unsubscribed"
          }
        },
        "type": "object",
        "required": [
          "dashboard",
          "workspace",
          "unsubscribed"
        ],
        "title": "UnsubscribeOut",
        "description": "What the link unsubscribes from: names only, never data or addresses."
      },
      "UpgradeRequest": {
        "properties": {
          "version": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]{1,32})?$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "UpgradeRequest"
      },
      "UploadRule": {
        "properties": {
          "max_count": {
            "type": "integer",
            "maximum": 8.0,
            "minimum": 1.0,
            "title": "Max Count",
            "default": 6
          },
          "max_mb": {
            "type": "integer",
            "maximum": 7.0,
            "minimum": 1.0,
            "title": "Max Mb",
            "default": 7
          },
          "min_side": {
            "type": "integer",
            "maximum": 2000.0,
            "minimum": 100.0,
            "title": "Min Side",
            "default": 400
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "UploadRule",
        "description": "The seller's own photos: count, size (MB) and the shortest side (px)."
      },
      "UsageBucket": {
        "type": "string",
        "enum": [
          "hour",
          "day"
        ],
        "title": "UsageBucket"
      },
      "UsageDayOut": {
        "properties": {
          "calls": {
            "type": "integer",
            "title": "Calls"
          },
          "errors": {
            "type": "integer",
            "title": "Errors"
          },
          "blocked": {
            "type": "integer",
            "title": "Blocked"
          },
          "input_tokens": {
            "type": "integer",
            "title": "Input Tokens"
          },
          "output_tokens": {
            "type": "integer",
            "title": "Output Tokens"
          },
          "cache_read_tokens": {
            "type": "integer",
            "title": "Cache Read Tokens"
          },
          "cache_write_tokens": {
            "type": "integer",
            "title": "Cache Write Tokens"
          },
          "cache_write_1h_tokens": {
            "type": "integer",
            "title": "Cache Write 1H Tokens",
            "default": 0
          },
          "reasoning_tokens": {
            "type": "integer",
            "title": "Reasoning Tokens"
          },
          "cost_usd": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Cost Usd"
          },
          "credits": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Credits"
          },
          "day": {
            "type": "string",
            "format": "date",
            "title": "Day"
          }
        },
        "type": "object",
        "required": [
          "calls",
          "errors",
          "blocked",
          "input_tokens",
          "output_tokens",
          "cache_read_tokens",
          "cache_write_tokens",
          "reasoning_tokens",
          "cost_usd",
          "credits",
          "day"
        ],
        "title": "UsageDayOut"
      },
      "UsageLimitOut": {
        "properties": {
          "used": {
            "type": "integer",
            "title": "Used"
          },
          "allowed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed"
          }
        },
        "type": "object",
        "required": [
          "used",
          "allowed"
        ],
        "title": "UsageLimitOut"
      },
      "UsageModelOut": {
        "properties": {
          "calls": {
            "type": "integer",
            "title": "Calls"
          },
          "errors": {
            "type": "integer",
            "title": "Errors"
          },
          "blocked": {
            "type": "integer",
            "title": "Blocked"
          },
          "input_tokens": {
            "type": "integer",
            "title": "Input Tokens"
          },
          "output_tokens": {
            "type": "integer",
            "title": "Output Tokens"
          },
          "cache_read_tokens": {
            "type": "integer",
            "title": "Cache Read Tokens"
          },
          "cache_write_tokens": {
            "type": "integer",
            "title": "Cache Write Tokens"
          },
          "cache_write_1h_tokens": {
            "type": "integer",
            "title": "Cache Write 1H Tokens",
            "default": 0
          },
          "reasoning_tokens": {
            "type": "integer",
            "title": "Reasoning Tokens"
          },
          "cost_usd": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Cost Usd"
          },
          "credits": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Credits"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "price_tier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PriceTier"
              },
              {
                "type": "null"
              }
            ]
          },
          "quality": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quality"
          },
          "quality_band": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QualityBand"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "calls",
          "errors",
          "blocked",
          "input_tokens",
          "output_tokens",
          "cache_read_tokens",
          "cache_write_tokens",
          "reasoning_tokens",
          "cost_usd",
          "credits",
          "provider",
          "model"
        ],
        "title": "UsageModelOut"
      },
      "UsagePartsOut": {
        "properties": {
          "ai_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Ai Uzs"
          },
          "compute_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Compute Uzs"
          },
          "storage_uzs": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Storage Uzs"
          }
        },
        "type": "object",
        "required": [
          "ai_uzs",
          "compute_uzs",
          "storage_uzs"
        ],
        "title": "UsagePartsOut",
        "description": "A usage day's parts at the customer's price (so'm); they add up to the day value (`value_uzs`)."
      },
      "UsagePointOut": {
        "properties": {
          "dcu_s": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Dcu S"
          },
          "dcu_hours": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Dcu Hours"
          },
          "utilization_pct": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Utilization Pct"
          },
          "interactive_dcu_s": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Interactive Dcu S"
          },
          "background_dcu_s": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Background Dcu S"
          },
          "runner_cpu_s": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Runner Cpu S"
          },
          "db_active_s": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Db Active S"
          },
          "storage_gb_avg": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Storage Gb Avg"
          },
          "ai_credits": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Ai Credits"
          },
          "ai_cost_usd": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Ai Cost Usd"
          },
          "ingest_rows": {
            "type": "integer",
            "title": "Ingest Rows"
          },
          "ingest_bytes": {
            "type": "integer",
            "title": "Ingest Bytes"
          },
          "peak_queries": {
            "type": "integer",
            "title": "Peak Queries"
          },
          "peak_jobs": {
            "type": "integer",
            "title": "Peak Jobs"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start"
          }
        },
        "type": "object",
        "required": [
          "dcu_s",
          "dcu_hours",
          "utilization_pct",
          "interactive_dcu_s",
          "background_dcu_s",
          "runner_cpu_s",
          "db_active_s",
          "storage_gb_avg",
          "ai_credits",
          "ai_cost_usd",
          "ingest_rows",
          "ingest_bytes",
          "peak_queries",
          "peak_jobs",
          "start"
        ],
        "title": "UsagePointOut"
      },
      "UsagePurposeOut": {
        "properties": {
          "calls": {
            "type": "integer",
            "title": "Calls"
          },
          "errors": {
            "type": "integer",
            "title": "Errors"
          },
          "blocked": {
            "type": "integer",
            "title": "Blocked"
          },
          "input_tokens": {
            "type": "integer",
            "title": "Input Tokens"
          },
          "output_tokens": {
            "type": "integer",
            "title": "Output Tokens"
          },
          "cache_read_tokens": {
            "type": "integer",
            "title": "Cache Read Tokens"
          },
          "cache_write_tokens": {
            "type": "integer",
            "title": "Cache Write Tokens"
          },
          "cache_write_1h_tokens": {
            "type": "integer",
            "title": "Cache Write 1H Tokens",
            "default": 0
          },
          "reasoning_tokens": {
            "type": "integer",
            "title": "Reasoning Tokens"
          },
          "cost_usd": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Cost Usd"
          },
          "credits": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Credits"
          },
          "purpose": {
            "type": "string",
            "title": "Purpose"
          }
        },
        "type": "object",
        "required": [
          "calls",
          "errors",
          "blocked",
          "input_tokens",
          "output_tokens",
          "cache_read_tokens",
          "cache_write_tokens",
          "reasoning_tokens",
          "cost_usd",
          "credits",
          "purpose"
        ],
        "title": "UsagePurposeOut"
      },
      "UsageReportOut": {
        "properties": {
          "since": {
            "type": "string",
            "format": "date-time",
            "title": "Since"
          },
          "total": {
            "$ref": "#/components/schemas/MonitoringUsageTotalsOut"
          },
          "by_day": {
            "items": {
              "$ref": "#/components/schemas/DayUsageOut"
            },
            "type": "array",
            "title": "By Day"
          },
          "by_kind": {
            "items": {
              "$ref": "#/components/schemas/KindUsageOut"
            },
            "type": "array",
            "title": "By Kind"
          }
        },
        "type": "object",
        "required": [
          "since",
          "total",
          "by_day",
          "by_kind"
        ],
        "title": "UsageReportOut"
      },
      "UsageSumsOut": {
        "properties": {
          "calls": {
            "type": "integer",
            "title": "Calls"
          },
          "errors": {
            "type": "integer",
            "title": "Errors"
          },
          "blocked": {
            "type": "integer",
            "title": "Blocked"
          },
          "input_tokens": {
            "type": "integer",
            "title": "Input Tokens"
          },
          "output_tokens": {
            "type": "integer",
            "title": "Output Tokens"
          },
          "cache_read_tokens": {
            "type": "integer",
            "title": "Cache Read Tokens"
          },
          "cache_write_tokens": {
            "type": "integer",
            "title": "Cache Write Tokens"
          },
          "cache_write_1h_tokens": {
            "type": "integer",
            "title": "Cache Write 1H Tokens",
            "default": 0
          },
          "reasoning_tokens": {
            "type": "integer",
            "title": "Reasoning Tokens"
          },
          "cost_usd": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Cost Usd"
          },
          "credits": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Credits"
          }
        },
        "type": "object",
        "required": [
          "calls",
          "errors",
          "blocked",
          "input_tokens",
          "output_tokens",
          "cache_read_tokens",
          "cache_write_tokens",
          "reasoning_tokens",
          "cost_usd",
          "credits"
        ],
        "title": "UsageSumsOut"
      },
      "UserOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "full_name": {
            "type": "string",
            "title": "Full Name"
          },
          "locale": {
            "type": "string",
            "title": "Locale"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "full_name",
          "locale"
        ],
        "title": "UserOut"
      },
      "VariantIn": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "names": {
            "anyOf": [
              {
                "patternProperties": {
                  "^[a-z]{2}$": {
                    "type": "string",
                    "maxLength": 40
                  }
                },
                "type": "object",
                "maxProperties": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Names"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "VariantIn",
        "description": "A new colour: the name as typed (`name`) or a suggestion's name in every language (`names`)."
      },
      "VariantOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "default": ""
          },
          "names": {
            "patternProperties": {
              "^[a-z]{2}$": {
                "type": "string"
              }
            },
            "type": "object",
            "title": "Names"
          },
          "barcode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Barcode"
          },
          "sku": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sku"
          },
          "package": {
            "$ref": "#/components/schemas/BoxOut"
          },
          "price_uzs": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Uzs"
          },
          "discount_uzs": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Uzs"
          },
          "photos": {
            "items": {
              "$ref": "#/components/schemas/ImageOut"
            },
            "type": "array",
            "title": "Photos"
          },
          "images": {
            "items": {
              "$ref": "#/components/schemas/SlotOut"
            },
            "type": "array",
            "title": "Images"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id"
        ],
        "title": "VariantOut",
        "description": "One colour of the card: its name (as typed and per language), barcode, SKU, package, price, discount, own photos and result slots."
      },
      "VariantPatch": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "names": {
            "anyOf": [
              {
                "patternProperties": {
                  "^[a-z]{2}$": {
                    "type": "string",
                    "maxLength": 40
                  }
                },
                "type": "object",
                "maxProperties": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Names"
          },
          "barcode": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9]{8,14}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Barcode"
          },
          "sku": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Sku"
          },
          "package": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BoxIn"
              },
              {
                "type": "null"
              }
            ]
          },
          "price_uzs": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1000000000000.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Uzs"
          },
          "discount_uzs": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1000000000000.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Uzs"
          },
          "position": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 7.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Position"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "VariantPatch",
        "description": "Changing a colour: only the fields sent; `null` clears the barcode, SKU, package or price."
      },
      "VariantRule": {
        "properties": {
          "max": {
            "type": "integer",
            "maximum": 8.0,
            "minimum": 2.0,
            "title": "Max"
          },
          "names": {
            "$ref": "#/components/schemas/Words"
          },
          "plural": {
            "$ref": "#/components/schemas/Words"
          },
          "count": {
            "patternProperties": {
              "^[a-z]{2}$": {
                "additionalProperties": {
                  "type": "string",
                  "maxLength": 300,
                  "minLength": 1
                },
                "propertyNames": {
                  "enum": [
                    "one",
                    "few",
                    "other"
                  ]
                },
                "type": "object"
              }
            },
            "type": "object",
            "title": "Count"
          },
          "feature_names": {
            "items": {
              "type": "string",
              "maxLength": 60,
              "minLength": 1
            },
            "type": "array",
            "maxItems": 12,
            "title": "Feature Names"
          },
          "sku_pattern": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Sku Pattern"
          },
          "suggest": {
            "items": {
              "$ref": "#/components/schemas/Words"
            },
            "type": "array",
            "maxItems": 30,
            "title": "Suggest"
          },
          "cabinet_hint": {
            "patternProperties": {
              "^[a-z]{2}$": {
                "type": "string",
                "maxLength": 300,
                "minLength": 1
              }
            },
            "type": "object",
            "title": "Cabinet Hint"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "max",
          "names",
          "plural",
          "count",
          "sku_pattern"
        ],
        "title": "VariantRule",
        "description": "Product colours: how many, the words (name, plural, count), feature names, SKU pattern and suggestions."
      },
      "VersionOut": {
        "properties": {
          "version": {
            "type": "string",
            "title": "Version"
          },
          "published_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published At"
          },
          "changelog": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Localized"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "version",
          "published_at",
          "changelog"
        ],
        "title": "VersionOut"
      },
      "ViewOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "title": {
            "$ref": "#/components/schemas/Localized"
          },
          "description": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Localized"
              },
              {
                "type": "null"
              }
            ]
          },
          "measures": {
            "items": {
              "$ref": "#/components/schemas/MeasureOut"
            },
            "type": "array",
            "title": "Measures"
          },
          "dimensions": {
            "type": "integer",
            "title": "Dimensions"
          }
        },
        "type": "object",
        "required": [
          "name",
          "title",
          "description",
          "measures",
          "dimensions"
        ],
        "title": "ViewOut"
      },
      "VisualKind": {
        "type": "string",
        "enum": [
          "kpi",
          "line",
          "bar",
          "area",
          "pie",
          "table"
        ],
        "title": "VisualKind"
      },
      "VoiceSampleIn": {
        "properties": {
          "tts_provider": {
            "$ref": "#/components/schemas/TtsChoice"
          },
          "voice": {
            "type": "string",
            "maxLength": 32,
            "minLength": 1,
            "title": "Voice"
          },
          "language": {
            "$ref": "#/components/schemas/Locale",
            "default": "uz"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tts_provider",
          "voice"
        ],
        "title": "VoiceSampleIn"
      },
      "VoiceSettingsIn": {
        "properties": {
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "stt_provider": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SttChoice"
              },
              {
                "type": "null"
              }
            ]
          },
          "tts_provider": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TtsChoice"
              },
              {
                "type": "null"
              }
            ]
          },
          "voice": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice"
          },
          "daily_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1440.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Daily Minutes"
          },
          "clear_daily_minutes": {
            "type": "boolean",
            "title": "Clear Daily Minutes",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "VoiceSettingsIn"
      },
      "VoiceSettingsOut": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "stt_provider": {
            "$ref": "#/components/schemas/SttChoice"
          },
          "tts_provider": {
            "$ref": "#/components/schemas/TtsChoice"
          },
          "voice": {
            "type": "string",
            "title": "Voice"
          },
          "daily_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Daily Minutes"
          },
          "plan_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Plan Minutes"
          },
          "minutes_left": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Minutes Left"
          },
          "tts_providers": {
            "items": {
              "$ref": "#/components/schemas/TtsChoice"
            },
            "type": "array",
            "title": "Tts Providers"
          },
          "voices": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "propertyNames": {
              "$ref": "#/components/schemas/TtsChoice"
            },
            "type": "object",
            "title": "Voices"
          },
          "spoken_answers": {
            "type": "boolean",
            "title": "Spoken Answers",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "enabled",
          "stt_provider",
          "tts_provider",
          "voice",
          "daily_minutes",
          "tts_providers",
          "voices"
        ],
        "title": "VoiceSettingsOut"
      },
      "WaitArgs": {
        "properties": {
          "selector": {
            "type": "string",
            "maxLength": 300,
            "minLength": 1,
            "title": "Selector"
          },
          "state": {
            "$ref": "#/components/schemas/WaitState",
            "default": "visible"
          },
          "timeout_seconds": {
            "type": "integer",
            "maximum": 120.0,
            "minimum": 1.0,
            "title": "Timeout Seconds",
            "default": 30
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "selector"
        ],
        "title": "WaitArgs"
      },
      "WaitState": {
        "type": "string",
        "enum": [
          "visible",
          "attached",
          "hidden"
        ],
        "title": "WaitState"
      },
      "WaitStep": {
        "properties": {
          "wait": {
            "$ref": "#/components/schemas/WaitArgs"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "wait"
        ],
        "title": "WaitStep"
      },
      "WarehouseSchemaOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "kind": {
            "$ref": "#/components/schemas/SchemaKind"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "tables": {
            "items": {
              "$ref": "#/components/schemas/WarehouseTableOut"
            },
            "type": "array",
            "title": "Tables"
          }
        },
        "type": "object",
        "required": [
          "name",
          "kind",
          "source",
          "tables"
        ],
        "title": "WarehouseSchemaOut"
      },
      "WarehouseTableOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "kind": {
            "type": "string",
            "enum": [
              "table",
              "partitioned",
              "view",
              "materialized_view",
              "foreign"
            ],
            "title": "Kind"
          },
          "rows": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rows"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size Bytes"
          },
          "internal": {
            "type": "boolean",
            "title": "Internal"
          },
          "columns": {
            "items": {
              "$ref": "#/components/schemas/TableColumnOut"
            },
            "type": "array",
            "title": "Columns"
          }
        },
        "type": "object",
        "required": [
          "name",
          "kind",
          "rows",
          "size_bytes",
          "internal",
          "columns"
        ],
        "title": "WarehouseTableOut"
      },
      "WebhookOut": {
        "properties": {
          "queued": {
            "type": "boolean",
            "title": "Queued"
          }
        },
        "type": "object",
        "required": [
          "queued"
        ],
        "title": "WebhookOut"
      },
      "WebhookSecretOut": {
        "properties": {
          "webhook_url": {
            "type": "string",
            "title": "Webhook Url"
          },
          "webhook_secret": {
            "type": "string",
            "title": "Webhook Secret"
          }
        },
        "type": "object",
        "required": [
          "webhook_url",
          "webhook_secret"
        ],
        "title": "WebhookSecretOut"
      },
      "Weekday": {
        "type": "string",
        "enum": [
          "mon",
          "tue",
          "wed",
          "thu",
          "fri",
          "sat",
          "sun"
        ],
        "title": "Weekday"
      },
      "WeeklySchedule": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "weekly",
            "title": "Kind"
          },
          "days": {
            "items": {
              "$ref": "#/components/schemas/Weekday"
            },
            "type": "array",
            "maxItems": 7,
            "minItems": 1,
            "title": "Days"
          },
          "at": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
            "title": "At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "days",
          "at"
        ],
        "title": "WeeklySchedule"
      },
      "WeeklyTimesSchedule": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "weekly_times",
            "title": "Kind"
          },
          "days": {
            "items": {
              "$ref": "#/components/schemas/Weekday"
            },
            "type": "array",
            "maxItems": 7,
            "minItems": 1,
            "title": "Days"
          },
          "times": {
            "items": {
              "type": "string",
              "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
            },
            "type": "array",
            "maxItems": 4,
            "minItems": 1,
            "title": "Times"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "days",
          "times"
        ],
        "title": "WeeklyTimesSchedule",
        "description": "1-4 times a day on the chosen weekdays (a source's refresh schedule); not a repo file."
      },
      "Words": {
        "properties": {
          "uz": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Uz"
          },
          "ru": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Ru"
          },
          "en": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "En"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "uz",
          "ru",
          "en"
        ],
        "title": "Words"
      },
      "WorkspaceAccess": {
        "type": "string",
        "enum": [
          "member"
        ],
        "title": "WorkspaceAccess"
      },
      "WorkspaceCreateRequest": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "deprecated": true
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "title": "Timezone",
            "default": "Asia/Tashkent"
          },
          "industry": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32,
                "pattern": "^[a-z][a-z0-9_]*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry"
          }
        },
        "type": "object",
        "title": "WorkspaceCreateRequest",
        "description": "`title` is the name a person reads (optional); `name` is always `ws:<n>`, one sent by an old client is ignored."
      },
      "WorkspaceListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/WorkspaceWithRoleOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "WorkspaceListOut"
      },
      "WorkspaceRole": {
        "type": "string",
        "enum": [
          "owner",
          "admin",
          "builder",
          "viewer"
        ],
        "title": "WorkspaceRole"
      },
      "WorkspaceUpdateRequest": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "deprecated": true
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "industry": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32,
                "pattern": "^[a-z][a-z0-9_]*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "WorkspaceUpdateRequest",
        "description": "Only the sent fields change: `title` (`null` or blank removes the name) and the industry (`industry: null` removes the choice); `name` is always `ws:<n>`, a sent one is ignored."
      },
      "WorkspaceWithRoleOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "timezone": {
            "type": "string",
            "title": "Timezone"
          },
          "industry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "stop_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop Reason"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "role": {
            "$ref": "#/components/schemas/WorkspaceRole"
          },
          "capabilities": {
            "items": {
              "$ref": "#/components/schemas/Capability"
            },
            "type": "array",
            "title": "Capabilities"
          },
          "ui_mode": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UiMode"
              },
              {
                "type": "null"
              }
            ]
          },
          "access": {
            "$ref": "#/components/schemas/WorkspaceAccess"
          },
          "plan": {
            "$ref": "#/components/schemas/PlanKey"
          },
          "features": {
            "items": {
              "$ref": "#/components/schemas/Feature"
            },
            "type": "array",
            "title": "Features"
          },
          "trial": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TrialOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "title",
          "display_name",
          "timezone",
          "industry",
          "is_active",
          "stop_reason",
          "created_at",
          "role",
          "capabilities",
          "ui_mode",
          "access",
          "plan",
          "features"
        ],
        "title": "WorkspaceWithRoleOut"
      },
      "WriteDisposition": {
        "type": "string",
        "enum": [
          "append",
          "replace",
          "merge"
        ],
        "title": "WriteDisposition"
      },
      "CapacityIngestMonthOut": {
        "properties": {
          "rows": {
            "type": "integer",
            "title": "Rows"
          },
          "bytes": {
            "type": "integer",
            "title": "Bytes"
          },
          "rows_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rows Limit"
          },
          "gb_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gb Limit"
          },
          "period_start": {
            "type": "string",
            "format": "date-time",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "format": "date-time",
            "title": "Period End"
          }
        },
        "type": "object",
        "required": [
          "rows",
          "bytes",
          "rows_limit",
          "gb_limit",
          "period_start",
          "period_end"
        ],
        "title": "IngestMonthOut"
      },
      "CapacityStorageOut": {
        "properties": {
          "used_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Used Bytes"
          },
          "quota_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quota Bytes"
          },
          "used_pct": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Used Pct"
          },
          "checked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Checked At"
          },
          "ingest_state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IngestState"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "used_bytes",
          "quota_bytes",
          "used_pct",
          "checked_at",
          "ingest_state"
        ],
        "title": "StorageOut"
      },
      "CapacityUsagePeriod": {
        "type": "string",
        "enum": [
          "24h",
          "7d",
          "30d",
          "90d"
        ],
        "title": "UsagePeriod"
      },
      "CapacityUsageTotalsOut": {
        "properties": {
          "dcu_s": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Dcu S"
          },
          "dcu_hours": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Dcu Hours"
          },
          "utilization_pct": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Utilization Pct"
          },
          "interactive_dcu_s": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Interactive Dcu S"
          },
          "background_dcu_s": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Background Dcu S"
          },
          "runner_cpu_s": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Runner Cpu S"
          },
          "db_active_s": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Db Active S"
          },
          "storage_gb_avg": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Storage Gb Avg"
          },
          "ai_credits": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Ai Credits"
          },
          "ai_cost_usd": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Ai Cost Usd"
          },
          "ingest_rows": {
            "type": "integer",
            "title": "Ingest Rows"
          },
          "ingest_bytes": {
            "type": "integer",
            "title": "Ingest Bytes"
          },
          "peak_queries": {
            "type": "integer",
            "title": "Peak Queries"
          },
          "peak_jobs": {
            "type": "integer",
            "title": "Peak Jobs"
          }
        },
        "type": "object",
        "required": [
          "dcu_s",
          "dcu_hours",
          "utilization_pct",
          "interactive_dcu_s",
          "background_dcu_s",
          "runner_cpu_s",
          "db_active_s",
          "storage_gb_avg",
          "ai_credits",
          "ai_cost_usd",
          "ingest_rows",
          "ingest_bytes",
          "peak_queries",
          "peak_jobs"
        ],
        "title": "UsageTotalsOut"
      },
      "ChangesCheckOut": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/CheckKind"
          },
          "attempt": {
            "type": "integer",
            "title": "Attempt"
          },
          "status": {
            "$ref": "#/components/schemas/CheckStatus"
          },
          "head_oid": {
            "type": "string",
            "title": "Head Oid"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "summary": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "attempt",
          "status",
          "head_oid",
          "run_id",
          "summary",
          "created_at",
          "updated_at"
        ],
        "title": "CheckOut"
      },
      "ChatRunStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "awaiting_input",
          "done",
          "needs_help",
          "failed",
          "cancelled"
        ],
        "title": "RunStatus"
      },
      "ChatStepOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "tool": {
            "type": "string",
            "title": "Tool"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "name",
          "tool",
          "status",
          "ok"
        ],
        "title": "StepOut"
      },
      "DashboardsDashboardOut": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "path": {
            "type": "string",
            "title": "Path"
          },
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Title"
          },
          "description": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_starter": {
            "type": "boolean",
            "title": "Is Starter"
          },
          "version": {
            "type": "integer",
            "title": "Version"
          },
          "filters": {
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/DateRangeFilter"
                },
                {
                  "$ref": "#/components/schemas/DimensionFilter"
                }
              ],
              "discriminator": {
                "propertyName": "kind",
                "mapping": {
                  "date_range": "#/components/schemas/DateRangeFilter",
                  "dimension": "#/components/schemas/DimensionFilter"
                }
              }
            },
            "type": "array",
            "title": "Filters"
          },
          "tiles": {
            "items": {
              "$ref": "#/components/schemas/TileOut"
            },
            "type": "array",
            "title": "Tiles"
          },
          "refresh": {
            "$ref": "#/components/schemas/RefreshOut"
          },
          "can_edit": {
            "type": "boolean",
            "title": "Can Edit"
          },
          "access": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Principals"
              },
              {
                "type": "null"
              }
            ]
          },
          "pending_change": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pending Change"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "path",
          "title",
          "description",
          "is_starter",
          "version",
          "filters",
          "tiles",
          "refresh",
          "can_edit",
          "updated_at"
        ],
        "title": "DashboardOut"
      },
      "DataplaneIngestMonthOut": {
        "properties": {
          "rows": {
            "type": "integer",
            "title": "Rows"
          },
          "bytes": {
            "type": "integer",
            "title": "Bytes"
          },
          "rows_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rows Limit"
          },
          "bytes_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bytes Limit"
          },
          "period_start": {
            "type": "string",
            "format": "date-time",
            "title": "Period Start"
          },
          "resets_on": {
            "type": "string",
            "format": "date",
            "title": "Resets On"
          },
          "exhausted": {
            "type": "boolean",
            "title": "Exhausted"
          }
        },
        "type": "object",
        "required": [
          "rows",
          "bytes",
          "rows_limit",
          "bytes_limit",
          "period_start",
          "resets_on",
          "exhausted"
        ],
        "title": "IngestMonthOut"
      },
      "DataplaneStorageOut": {
        "properties": {
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size Bytes"
          },
          "quota_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quota Bytes"
          },
          "used_percent": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Used Percent"
          },
          "state": {
            "$ref": "#/components/schemas/IngestState"
          },
          "checked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Checked At"
          }
        },
        "type": "object",
        "required": [
          "size_bytes",
          "quota_bytes",
          "used_percent",
          "state",
          "checked_at"
        ],
        "title": "StorageOut"
      },
      "ListingCheckOut": {
        "properties": {
          "rule": {
            "type": "string",
            "title": "Rule"
          },
          "kind": {
            "type": "string",
            "enum": [
              "automatic",
              "warning"
            ],
            "title": "Kind"
          },
          "field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Field"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "found": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Found"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "rule",
          "kind"
        ],
        "title": "CheckOut",
        "description": "One break of a marketplace rule: the rule (an id from the profile `rules`), kind, field, language and the words found."
      },
      "ListingSourceOut": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title"
          },
          "site": {
            "type": "string",
            "title": "Site"
          },
          "url": {
            "type": "string",
            "title": "Url"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "title",
          "site",
          "url"
        ],
        "title": "SourceOut"
      },
      "ListingStepOut": {
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "research",
              "texts",
              "images",
              "rules"
            ],
            "title": "Id"
          },
          "state": {
            "type": "string",
            "enum": [
              "waiting",
              "running",
              "done",
              "failed",
              "skipped"
            ],
            "title": "State"
          },
          "done": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Done"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "state"
        ],
        "title": "StepOut"
      },
      "LogsLogListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/LogEntryOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "LogListOut"
      },
      "MarketplaceDashboardOut": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "title": {
            "$ref": "#/components/schemas/Localized"
          },
          "description": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Localized"
              },
              {
                "type": "null"
              }
            ]
          },
          "tiles": {
            "type": "integer",
            "title": "Tiles"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "title",
          "description",
          "tiles"
        ],
        "title": "DashboardOut"
      },
      "MarketplaceResourceOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "title": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Localized"
              },
              {
                "type": "null"
              }
            ]
          },
          "write_disposition": {
            "type": "string",
            "title": "Write Disposition"
          }
        },
        "type": "object",
        "required": [
          "name",
          "write_disposition"
        ],
        "title": "ResourceOut"
      },
      "MonitoringUsageTotalsOut": {
        "properties": {
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "tokens": {
            "$ref": "#/components/schemas/TokensOut"
          }
        },
        "type": "object",
        "required": [
          "requests",
          "tokens"
        ],
        "title": "UsageTotalsOut"
      },
      "RunsRunStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "succeeded",
          "failed",
          "cancelled",
          "skipped",
          "blocked"
        ],
        "title": "RunStatus"
      },
      "RunsLogListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/LogOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          },
          "run_status": {
            "$ref": "#/components/schemas/RunsRunStatus"
          }
        },
        "type": "object",
        "required": [
          "items",
          "run_status"
        ],
        "title": "LogListOut"
      },
      "RunsRunListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/RunsRunOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "RunListOut"
      },
      "RunsRunOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "kind": {
            "$ref": "#/components/schemas/RunKind"
          },
          "trigger": {
            "$ref": "#/components/schemas/RunTrigger"
          },
          "status": {
            "$ref": "#/components/schemas/RunsRunStatus"
          },
          "skip_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skip Reason"
          },
          "parent_run_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Run Id"
          },
          "schedule_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule Id"
          },
          "scheduled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled At"
          },
          "source_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Id"
          },
          "change_request_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Request Id"
          },
          "deployment_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployment Id"
          },
          "commit_oid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Commit Oid"
          },
          "requested_by": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested By"
          },
          "image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image"
          },
          "rows_extracted": {
            "type": "integer",
            "title": "Rows Extracted"
          },
          "rows_loaded": {
            "type": "integer",
            "title": "Rows Loaded"
          },
          "bytes_loaded": {
            "type": "integer",
            "title": "Bytes Loaded"
          },
          "cpu_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cpu Ms"
          },
          "peak_mem_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Peak Mem Bytes"
          },
          "dcu_s": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dcu S"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "heartbeat_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Heartbeat At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "source_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Slug"
          },
          "change_number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Number"
          },
          "deployment_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployment Version"
          }
        },
        "type": "object",
        "required": [
          "id",
          "kind",
          "trigger",
          "status",
          "skip_reason",
          "parent_run_id",
          "schedule_id",
          "scheduled_at",
          "source_id",
          "change_request_id",
          "deployment_id",
          "commit_oid",
          "requested_by",
          "image",
          "rows_extracted",
          "rows_loaded",
          "bytes_loaded",
          "cpu_ms",
          "peak_mem_bytes",
          "dcu_s",
          "error_code",
          "error_message",
          "duration_ms",
          "started_at",
          "heartbeat_at",
          "finished_at",
          "created_at"
        ],
        "title": "RunOut"
      },
      "RunsStepOut": {
        "properties": {
          "seq": {
            "type": "integer",
            "title": "Seq"
          },
          "kind": {
            "$ref": "#/components/schemas/StepKind"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "status": {
            "$ref": "#/components/schemas/StepStatus"
          },
          "rows_inserted": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rows Inserted"
          },
          "rows_updated": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rows Updated"
          },
          "rows_deleted": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rows Deleted"
          },
          "rows_affected": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rows Affected"
          },
          "failures": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failures"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "details": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "seq",
          "kind",
          "name",
          "status",
          "rows_inserted",
          "rows_updated",
          "rows_deleted",
          "rows_affected",
          "failures",
          "message",
          "details",
          "duration_ms",
          "created_at"
        ],
        "title": "StepOut"
      },
      "SourcesResourceOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "target_table": {
            "type": "string",
            "title": "Target Table"
          },
          "write_disposition": {
            "type": "string",
            "title": "Write Disposition"
          },
          "primary_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Key"
          },
          "cursor_column": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cursor Column"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled"
          },
          "columns": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/JsonValue"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Columns"
          },
          "last_rows": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Rows"
          },
          "last_loaded_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Loaded At"
          }
        },
        "type": "object",
        "required": [
          "name",
          "target_table",
          "write_disposition",
          "primary_key",
          "cursor_column",
          "is_enabled",
          "columns",
          "last_rows",
          "last_loaded_at"
        ],
        "title": "ResourceOut"
      },
      "SourcesRunListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SourcesRunOut"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "RunListOut"
      },
      "SourcesRunOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "trigger": {
            "type": "string",
            "title": "Trigger"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "rows_loaded": {
            "type": "integer",
            "title": "Rows Loaded"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          }
        },
        "type": "object",
        "required": [
          "id",
          "kind",
          "trigger",
          "status",
          "rows_loaded",
          "error_code",
          "error_message",
          "created_at",
          "started_at",
          "finished_at",
          "duration_ms"
        ],
        "title": "RunOut"
      },
      "SourcesSourceOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "connector_key": {
            "type": "string",
            "title": "Connector Key"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "origin": {
            "type": "string",
            "title": "Origin"
          },
          "timezone": {
            "type": "string",
            "title": "Timezone"
          },
          "raw_schema": {
            "type": "string",
            "title": "Raw Schema"
          },
          "data_version": {
            "type": "integer",
            "title": "Data Version"
          },
          "last_loaded_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Loaded At"
          },
          "last_load_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Load Status"
          },
          "last_load_rows": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Load Rows"
          },
          "load_stopped": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Load Stopped"
          },
          "load_progress": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoadProgressOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "slug",
          "title",
          "connector_key",
          "kind",
          "status",
          "origin",
          "timezone",
          "raw_schema",
          "data_version",
          "last_loaded_at",
          "last_load_status",
          "last_load_rows",
          "created_at",
          "updated_at"
        ],
        "title": "SourceOut"
      },
      "Error": {
        "title": "Error",
        "type": "object",
        "description": "Every error: a stable machine `code`, a human-readable `message`, the first invalid input.",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "field": {
            "type": "string"
          }
        },
        "example": {
          "code": "invalid_input",
          "message": "So'rov ma'lumotlari noto'g'ri",
          "field": "email"
        }
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Access token from POST /api/v1/auth/login or /login/verify; renewed by /auth/refresh."
      }
    },
    "responses": {
      "ForbiddenCapabilityDenied": {
        "description": "Forbidden: `capability_denied` (the caller's role lacks the capability).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "code": "capability_denied",
              "message": "Bu amal uchun ruxsat yo'q"
            }
          }
        }
      },
      "ForbiddenCapabilityDeniedFeatureDisabled": {
        "description": "Forbidden: `capability_denied` (the caller's role lacks the capability) or `feature_disabled` (the workspace plan lacks the feature).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "code": "capability_denied",
              "message": "Bu amal uchun ruxsat yo'q"
            }
          }
        }
      },
      "InvalidToken": {
        "description": "No access token, or it is invalid or expired (`invalid_token`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "code": "invalid_token",
              "message": "Token yaroqsiz yoki muddati tugagan"
            }
          }
        }
      },
      "TrialEnded": {
        "description": "The workspace's free trial has ended (`workspace_trial_ended`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "code": "workspace_trial_ended",
              "message": "Sinov muddati tugadi — workspace to'xtatilgan, ma'lumotlar saqlanadi"
            }
          }
        }
      },
      "ValidationFailed": {
        "description": "Validation Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "code": "invalid_input",
              "message": "So'rov ma'lumotlari noto'g'ri",
              "field": "email"
            }
          }
        }
      },
      "WorkspaceNotFound": {
        "description": "No such workspace, or the caller is not its member (`workspace_not_found`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "code": "workspace_not_found",
              "message": "Workspace topilmadi"
            }
          }
        }
      },
      "WorkspaceStopped": {
        "description": "The workspace is stopped (`workspace_stopped`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "code": "workspace_stopped",
              "message": "Workspace to'xtatilgan, bu amal ishlamaydi"
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://app.databek.com",
      "description": "Production"
    }
  ]
}
