# Databek App API guide

Databek App (app.databek.com) is an AI data analyst for businesses: a workspace connects its data (marketplace
connections, Excel and CSV uploads, databases and APIs), loads it into its own warehouse, and people ask questions in
chat, build dashboards and get reports in Telegram or e-mail. This guide covers the public API a client uses as a
signed-in person.

## At a glance

| Topic | Rule |
|---|---|
| Base URL | `https://app.databek.com/api/v1` |
| Format | JSON in and out (uploads are multipart); timestamps UTC ISO 8601 |
| Auth | `Authorization: Bearer <access token>` from e-mail sign-in (15 minutes); renew with the refresh token (30 days). No API keys |
| Workspace | Almost every path is `/api/v1/workspaces/{workspace_id}/…` (an integer id); access comes from membership |
| Roles | viewer ⊂ builder ⊂ admin ⊂ owner; each operation names the capability it checks |
| Errors | `{"code", "message", "field"?}`; `code` is stable, `message` is for people (Uzbek today) |
| Lists | `{items, next_cursor, total}` with `?cursor=&limit=` (1–200), most also `q`, `sort`, `order` |
| Limits | 120 requests a minute per IP address by default, on every path (429 `rate_limited`, no `Retry-After`); request bodies up to 8 MiB (413 `request_too_large`); one file uploaded to a source or a package up to 47 MiB (`max_file_mb` in the connection answer is the current limit): a larger file answers 413 `upload_too_large`, or `request_too_large` once the whole body passes that limit + 1 MiB, so treat both as "file too large"; a chat document (`POST …/chats/uploads`) up to 15 MiB for a PDF, 10 MiB for Excel, 3 MiB for an image, 2 MiB for CSV/TXT: a larger one answers 413 `document_too_large`, a body over 16 MiB `request_too_large` |
| Request id | `X-Request-ID` accepted (`[A-Za-z0-9._:-]{1,128}`) or generated, returned on every response |

## Flow 1: sign in and pick a workspace

1. `GET /api/v1/auth/captcha` → `{"mode": "off" | "pow" | "turnstile", "challenge", "difficulty", "site_key"}`. A
   human check goes in the `human` field: for `pow` find a decimal `nonce` such that the hex of
   `sha256(challenge + nonce)` starts with `difficulty` zeros and send `{"pow_challenge": challenge, "pow_nonce": nonce}`;
   for `turnstile` send `{"turnstile_token": "<token>"}`. Register and `POST /api/v1/auth/password/forgot` always need
   it unless the mode is `off`; sign-in needs it only after 3 failed attempts for that e-mail within an hour (403
   `human_check_required`; a wrong proof is 403 `human_check_failed`).
2. `POST /api/v1/auth/login`:

```bash
curl -X POST https://app.databek.com/api/v1/auth/login -H "Content-Type: application/json" \
  -d '{"email": "owner@example.com", "password": "…", "remember_device": true}'
```

   The answer is `{"status": "code_required", "challenge": {...}}`: a code is e-mailed; send it with
   `POST /api/v1/auth/login/verify` `{"email", "code"}`, which answers
   `{"access_token", "refresh_token", "expires_at", "refresh_expires_at", "token_type": "bearer"}`. With
   `remember_device` the verify answer also sets an httpOnly `databek_device` cookie (path `/api/v1/auth`, 30 days);
   a later login that sends it back with the same `User-Agent` and `Accept-Language` answers
   `{"status": "authenticated", "tokens": {...}}` without a code. Without that cookie every login e-mails a code, so
   a headless integration signs in once and keeps the refresh token alive. Wrong passwords end in 423
   `account_locked` for a while.
   New accounts: `POST /api/v1/auth/register` `{"email", "password", "full_name", "locale"?, "human"}`.
   Google sign-in (`/api/v1/auth/google/login`) is for the web app only: it ends in session cookies and a redirect,
   never in tokens. An account made with Google sets a password through `POST /api/v1/auth/password/forgot` before
   it can use this flow.
3. Send `Authorization: Bearer <access_token>` on every call. Before `expires_at` (or after a 401 `invalid_token`)
   call `POST /api/v1/auth/refresh` `{"refresh_token"}`; it returns a new pair and a new 30 days (the refresh token
   rotates: keep the new one). 401 `invalid_refresh_token` or `invalid_session` (the session was revoked or the
   account blocked) means sign in again.
4. `GET /api/v1/workspaces` lists the caller's workspaces with `role`, `capabilities` and `ui_mode`.
   `POST /api/v1/workspaces/default` returns the first one (a new person gets one with the trial).

```bash
curl https://app.databek.com/api/v1/workspaces -H "Authorization: Bearer $TOKEN"
```

A workspace the caller is not a member of answers 404 `workspace_not_found`. A stopped workspace answers 409
`workspace_stopped` on every operation that needs `chat.use`, `change.create`, `content.edit` or `source.manage`,
reads such as the chat list included (the index marks them "Refused while the workspace is stopped"). When the
trial has ended, every workspace operation answers 402 `workspace_trial_ended` except the workspace itself, its
settings, plan and billing.

## Flow 2: connect data

- **Marketplace connections** (the simple way): `GET /api/v1/workspaces/{id}/marketplace` lists packages (systems
  such as shop platforms, accounting, Excel templates); `POST …/marketplace/packages/{scope}/{name}/install` with
  `config` opens a `package_install` change request approved by the caller. Then
  `GET …/marketplace/packages/{scope}/{name}/connection` shows state, last test, load progress and templates;
  `POST …/connection/test`, `…/pause`, `…/resume` and `PUT …/connection/refresh` (schedule) manage it.
  `GET …/marketplace/connections` is the table of every connection with its state in plain words.
- **Files**: download a package's Excel template with
  `GET …/marketplace/packages/{scope}/{name}/templates/{table}?locale=uz` (`locale` is required: `uz`, `ru` or `en`),
  fill it and upload with `POST …/marketplace/packages/{scope}/{name}/files` (multipart `file`); a load starts.
- **Secrets** a connection needs: `PUT /api/v1/workspaces/{id}/secrets/{name}` `{"kind", "value"}` (values are sealed
  and never returned; 409 `secret_keys_pending` on a new workspace means retry in a few seconds);
  `GET …/secret-requests` lists what a package asked for.
- **Loads**: `GET …/marketplace/connections` or, in developer mode, `GET …/sources/{slug}/runs` (state, rows, errors)
  and `POST …/sources/{slug}/runs` `{"mode": "manual"}` (or `"backfill"` with `backfill_from`) for a load now (202;
  the work runs in the background).
- **Limits**: `GET …/quota` (this month's rows and GB, 80 % / 100 % levels) and `GET …/billing/limits`. When the
  monthly limit is reached loads stop until the next month or a plan change.

## Flow 3: ask a question in chat

1. `POST /api/v1/workspaces/{id}/chats` `{"title"?: "Sales", "model_id"?}` → `{"id", …}`. Chat ids are UUIDs.
2. `POST …/chats/{chat_id}/messages` `{"text": "How did revenue change in the last 7 days?"}` → 202
   `{"run_id", "chat_id", "message_id", "state", "last_event_id"}`. Optional: `skill` (from `GET …/chats/skills`),
   `documents` (`[{"document_id"}]` from `POST …/chats/uploads`, multipart `file` and `chat_id`), `attachments`
   (`[{"upload_id"}]`: the `id` from `POST …/sources/uploads/files`, Builder or higher; a Viewer gets 403
   `chat_attachment_forbidden`), `input_mode` and `voice_seconds` for voice. While a run of the chat is queued or
   running another message answers 409 `chat_run_active`; one person may have 3 questions running across all
   workspaces (429 `chat_turns_limit`).
3. Read the answer as Server-Sent Events: `GET …/chats/{chat_id}/runs/{run_id}/events`. Events: `start`, `progress`,
   `text` (answer text in pieces), `tool_call`, `tool_result`, `element` (a chart, a table or a question),
   `status`, `retry`, `final` (done), `error`, `speech`. The stream closes when the run ends or stops to ask, and
   after at most 10 minutes: reconnect with `Last-Event-ID` (or `?after=<event id>`) while the run is still going.

```bash
curl -N https://app.databek.com/api/v1/workspaces/12/chats/3fa85f64-5717-4562-b3fc-2c963f66afa6/runs/678/events \
  -H "Authorization: Bearer $TOKEN"
```

4. A run may stop and ask with an element that offers options: answer with another `POST …/messages` carrying
   `{"choice": {"option_id", "input_id"}}` from that element, and the same run continues. Text that names one of
   the options counts as that choice; other text, while only such options are waiting, starts a new run instead.
   `POST …/runs/{run_id}/cancel` stops a run.
5. History: `GET …/chats` and `GET …/chats/{chat_id}/messages?before=&limit=`. Rate an answer with
   `PUT …/messages/{message_id}/feedback` `{"value": "up" | "down", "reason"?, "note"?}`.

Without connected data the chat gives no numbers. Every turn costs AI spend, charged in so'm to the workspace
balance within its monthly budget (`GET …/billing`: `ai_uzs`, `budget`; Admin and Owner); `GET …/ai-usage` shows
the credits by day, model and purpose.

## Flow 4: dashboards and reports

- `POST /api/v1/workspaces/{id}/dashboards` `{"title"}` → a dashboard; `POST …/dashboards/{slug}/charts`
  `{"message_id", "block_index"}` saves a chart from a chat answer.
- `GET …/dashboards/{slug}` gives tiles and filters; each tile's numbers come from
  `POST …/dashboards/{slug}/charts/{chart}/data` `{"filters"?: {...}, "locale"?: "en"}`, computed in the request:
  `status` is `ok`, `recreate` (the chart must be made again) or `error`, the rows are in `sql_result`, and
  `poll_seconds` is set only in live mode: ask again after that many seconds.
- Edits send `expected_version` (409 `dashboard_version_conflict` means reload first). `PUT …/refresh-settings` and
  `POST …/refresh` control freshness.
- Deliveries: `PUT …/dashboards/{slug}/deliveries/{key}` with `schedule`, `channel` (`telegram` or `email`),
  `recipients` (`{"roles", "groups", "users"}`) and `"enabled": true`. A delivery is off by default, and with empty
  `recipients` only people who subscribed themselves (`PUT …/deliveries/{key}/subscription`) get it. E-mail needs
  the `email_delivery` plan feature. `POST …/deliveries/{key}/test` sends one now, to the caller only. Link Telegram
  first with `POST /api/v1/me/telegram/link-codes` (a 15-minute `t.me/<bot>?start=` link).
- PDF: `POST …/dashboards/{slug}/pdf` `{"filters"?, "locale"?}` → 202 with `id` and `status: "queued"`; poll
  `GET …/pdf-exports/{id}` until `status` is `ready` (or `failed`), then `GET …/pdf-exports/{id}/file`. Asking for the
  file earlier answers 409 `pdf_export_not_ready`; after `expires_at` the export is `expired`.

## Endpoint groups

- **auth**: sign-up, sign-in with an e-mailed code, Telegram Mini App sign-in, refresh, sessions, password reset, the
  caller's profile and language.
- **workspace, access, plans, capacity, billing**: workspaces, members and invites (`POST …/invites`, accepted with
  `POST /api/v1/invites/accept`), groups and member attributes for row-level access, branding and AI settings, plan,
  capacity, balance, budget and payment requests (Admin and Owner).
- **marketplace, packages, sources, secrets, dataplane**: connections and their loads, package installs and upgrades
  (each a change request), sources and egress approval (developer mode), sealed secrets, the warehouse and its quota.
- **chats, voice, documents, explore**: chat with the AI analyst, voice in and spoken answers, uploaded documents and
  photos read into rows, read-only SQL exploration in developer mode (`POST …/explore/queries` `{"sql", "limit"}`).
- **dashboards, delivery, home, findings, menu, onboarding**: dashboards and tiles, scheduled reports and PDFs, the
  home screen's today card, daily findings, pinned menu items, onboarding steps.
- **repo, changes, deployments, runs, git-sync** (developer mode, `dev_mode` capability): the workspace repository,
  change requests with checks and approvals, versions and rollback, pipeline runs with live logs, Git sync with
  GitHub or GitLab.
- **cards**: product cards for marketplaces (photos, variants, AI design, export as zip).
- **ai, monitoring, audit, logs, notifications**: AI spend per call, chat runs, SQL trail, audit trail, the activity
  log and in-app notifications.
- **industries**: the industry list for a new workspace.

## Errors

```json
{"code": "invalid_input", "message": "So'rov ma'lumotlari noto'g'ri", "field": "email"}
```

| Status | Codes | Meaning |
|---|---|---|
| 401 | `invalid_token`, `invalid_session`, `invalid_refresh_token`, `invalid_credentials`, `invalid_login_code`, `login_code_expired` | Access token missing or expired: refresh once. Session revoked, refresh token bad: sign in again. Wrong password or code |
| 402 | `workspace_trial_ended` | The trial has ended: choose a plan |
| 403 | `capability_denied`, `feature_disabled`, `human_check_required`, `human_check_failed`, `account_blocked` | The role or plan lacks it, a human check is due, or the account is blocked |
| 404 | `workspace_not_found`, `chat_not_found`, `dashboard_not_found`, `not_found` | Not a member, no such object, or a feature the plan hides (voice, documents, cards answer plain `not_found`) |
| 409 | `workspace_stopped`, `chat_run_active`, `dashboard_version_conflict`, `pdf_export_not_ready`, `secret_keys_pending` | Workspace stopped; wait for the run; reload and retry; poll the export; retry in a few seconds |
| 410 | `invite_expired`, `invite_revoked`, `invite_used` | The invite no longer works |
| 413 | `request_too_large`, `upload_too_large`, `document_too_large` | Body over 8 MiB (chat documents: over 16 MiB; source and package uploads: over the file limit + 1 MiB); a source or package file over 47 MiB (see `max_file_mb`); a chat document over its type's limit |
| 422 | `invalid_input`, `model_unavailable` | See `field` |
| 423 | `account_locked` | Too many wrong passwords: wait |
| 429 | `rate_limited`, `chat_turns_limit`, `ai_busy` | The per-IP limit, 3 running questions per person, or the AI is busy: wait and retry |

## Webhooks

App sends no outbound HTTP webhooks: reports go to Telegram and e-mail (deliveries), and live progress comes over
Server-Sent Events (chat runs, run logs). Incoming: `POST /api/v1/workspaces/{id}/git-sync/webhook` takes a GitHub
(`X-Hub-Signature-256`, `X-GitHub-Event: push`) or GitLab (`X-Gitlab-Token`, `X-Gitlab-Event: Push Hook`) push for a
linked repository; other events are ignored. The secret is returned once, by `PUT …/git-sync` (connect).
`POST …/git-sync/webhook-secret` rotates it: the old secret stops working at once, so put the new one in the
repository's webhook settings, or every push answers 401 `webhook_signature_invalid`. Bodies are capped at 1 MB; an
unsigned call answers 401, an unlinked workspace 404.
Git sync needs the `git_sync` plan feature.

<!-- endpoint-index:start (generated from openapi.json) -->

## Endpoint index

Every operation of `openapi.json` (234), grouped by tag: method and path, who may call it, query parameters, body fields (`*` = required) and the top-level fields of the answer. Schemas, types and examples are in `openapi.json`.

### auth

- `GET /api/v1/auth/captcha` Captcha · Public: no token · answers 200: `mode`, `challenge`, `difficulty`, `site_key`, `expires_at`
- `POST /api/v1/auth/register` Register · Public: no token · body (JSON): `email*`, `password*`, `full_name*`, `locale`, `telegram_init_data`, `human` · answers 201: `id`, `email`, `full_name`, `locale`
- `POST /api/v1/auth/login` Login · Public: no token · body (JSON): `email*`, `password*`, `remember_device`, `telegram_init_data`, `human` · answers 200: `status`, `challenge`, `tokens`
- `POST /api/v1/auth/login/verify` Verify · Public: no token · body (JSON): `email*`, `code*` · answers 200: `access_token`, `refresh_token`, `expires_at`, `refresh_expires_at`, `token_type`
- `POST /api/v1/auth/telegram` Telegram Login · Public: no token · body (JSON): `init_data*` · answers 200: `access_token`, `refresh_token`, `expires_at`, `refresh_expires_at`, `token_type`
- `POST /api/v1/auth/telegram/google` Telegram Google Start · Public: no token · body (JSON): `init_data*` · answers 201: `nonce`, `url`, `expires_at`
- `POST /api/v1/auth/telegram/google/view` Telegram Google View · Bearer access token of any signed-in user · body (JSON): `nonce*` · answers 200: `telegram`, `account`, `confirmed`
- `POST /api/v1/auth/telegram/google/confirm` Telegram Google Confirm · Bearer access token of any signed-in user · body (JSON): `nonce*` · answers 204, no body
- `POST /api/v1/auth/telegram/google/claim` Telegram Google Claim · Public: no token · body (JSON): `nonce*`, `init_data*` · answers 200: `status`, `tokens`
- `POST /api/v1/auth/refresh` Refresh · Public: no token · body (JSON): `refresh_token*` · answers 200: `access_token`, `refresh_token`, `expires_at`, `refresh_expires_at`, `token_type`
- `GET /api/v1/auth/me` Me · Bearer access token of any signed-in user · answers 200: `id`, `email`, `full_name`, `locale`
- `PATCH /api/v1/auth/me` Update Me · Bearer access token of any signed-in user · body (JSON): `locale*` · answers 200: `id`, `email`, `full_name`, `locale`
- `GET /api/v1/auth/sessions` Sessions · Bearer access token of any signed-in user · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`
- `DELETE /api/v1/auth/sessions` Revoke Other Sessions · Bearer access token of any signed-in user · answers 200: `revoked`
- `POST /api/v1/auth/logout` Logout · Bearer access token of any signed-in user · answers 204, no body
- `DELETE /api/v1/auth/sessions/{session_id}` Revoke Session · Bearer access token of any signed-in user · answers 204, no body
- `POST /api/v1/auth/password/forgot` Forgot Password · Public: no token · body (JSON): `email*`, `human` · answers 204, no body
- `POST /api/v1/auth/password/reset` Reset Password · Public: no token · body (JSON): `token*`, `password*` · answers 204, no body
- `GET /api/v1/auth/google/login` Google Login Start · Public: no token · query: `next`
- `GET /api/v1/auth/google/callback` Google Callback · Public: no token · query: `code`, `state`, `error`

### workspace

- `GET /api/v1/workspaces` List Workspaces · Bearer access token of any signed-in user · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces` Create Workspace · Bearer access token of any signed-in user · body (JSON): `name`, `title`, `timezone`, `industry` · answers 201: `id`, `name`, `title`, `display_name`, `timezone`, `industry`, `is_active`, `stop_reason`, `created_at`, `role`, `capabilities`, `ui_mode`, `access`, `plan` and 2 more
- `POST /api/v1/workspaces/default` Open Default Workspace · Bearer access token of any signed-in user · answers 200: `id`, `name`, `title`, `display_name`, `timezone`, `industry`, `is_active`, `stop_reason`, `created_at`, `role`, `capabilities`, `ui_mode`, `access`, `plan` and 2 more
- `GET /api/v1/workspaces/{workspace_id}` Get Workspace · Bearer access token of a member of the workspace (any role) · answers 200: `id`, `name`, `title`, `display_name`, `timezone`, `industry`, `is_active`, `stop_reason`, `created_at`, `role`, `capabilities`, `ui_mode`, `access`, `plan` and 2 more
- `PATCH /api/v1/workspaces/{workspace_id}` Update Workspace · Bearer access token; workspace capability `branding.manage`: admin, owner · body (JSON): `name`, `title`, `industry` · answers 200: `id`, `name`, `title`, `display_name`, `timezone`, `industry`, `is_active`, `stop_reason`, `created_at`, `role`, `capabilities`, `ui_mode`, `access`, `plan` and 2 more
- `POST /api/v1/workspaces/{workspace_id}/stop` Stop Workspace · Bearer access token; workspace capability `workspace.stop`: owner · answers 200: `id`, `name`, `title`, `display_name`, `timezone`, `industry`, `is_active`, `stop_reason`, `created_at`, `role`, `capabilities`, `ui_mode`, `access`, `plan` and 2 more
- `POST /api/v1/workspaces/{workspace_id}/start` Start Workspace · Bearer access token; workspace capability `workspace.stop`: owner · answers 200: `id`, `name`, `title`, `display_name`, `timezone`, `industry`, `is_active`, `stop_reason`, `created_at`, `role`, `capabilities`, `ui_mode`, `access`, `plan` and 2 more
- `GET /api/v1/workspaces/{workspace_id}/members` List Members · Bearer access token; workspace capability `member.manage`: admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/workspaces/{workspace_id}/invites` List Invites · Bearer access token; workspace capability `member.manage`: admin, owner · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/invites` Create Invite · Bearer access token; workspace capability `member.manage`: admin, owner · body (JSON): `email`, `role*` · answers 201: `status`, `link`, `expires_at`
- `POST /api/v1/workspaces/{workspace_id}/invites/{invite_id}/resend` Resend Invite · Bearer access token; workspace capability `member.manage`: admin, owner · answers 204, no body
- `POST /api/v1/workspaces/{workspace_id}/invites/{invite_id}/link` Share Invite · Bearer access token; workspace capability `member.manage`: admin, owner · answers 200: `link`, `expires_at`
- `DELETE /api/v1/workspaces/{workspace_id}/invites/{invite_id}` Revoke Invite · Bearer access token; workspace capability `member.manage`: admin, owner · answers 204, no body
- `DELETE /api/v1/workspaces/{workspace_id}/members/{user_id}` Remove Member · Bearer access token; workspace capability `member.manage`: admin, owner · answers 204, no body
- `PATCH /api/v1/workspaces/{workspace_id}/members/{user_id}` Change Member Role · Bearer access token; workspace capability `role.change`: admin, owner · body (JSON): `role*` · answers 200: `user_id`, `email`, `full_name`, `role`, `created_at`
- `PUT /api/v1/workspaces/{workspace_id}/me/preferences` Update Preferences · Bearer access token of a member of the workspace (any role) · body (JSON): `ui_mode*` · answers 200: `ui_mode`
- `GET /api/v1/workspaces/{workspace_id}/settings` Get Settings · Bearer access token of a member of the workspace (any role) · answers 200: `chat_token_budget`, `chat_max_rounds`, `chat_limits`, `theme`, `accent_color`, `logo_url`, `ai_data_access`
- `PATCH /api/v1/workspaces/{workspace_id}/settings/branding` Update Branding · Bearer access token; workspace capability `branding.manage`: admin, owner · body (JSON): `theme`, `accent_color`, `logo_url` · answers 200: `chat_token_budget`, `chat_max_rounds`, `chat_limits`, `theme`, `accent_color`, `logo_url`, `ai_data_access`
- `PATCH /api/v1/workspaces/{workspace_id}/settings/ai` Update Ai Settings · Bearer access token; workspace capability `ai.model.manage`: owner · body (JSON): `chat_token_budget`, `chat_max_rounds` · answers 200: `chat_token_budget`, `chat_max_rounds`, `chat_limits`, `theme`, `accent_color`, `logo_url`, `ai_data_access`
- `PUT /api/v1/workspaces/{workspace_id}/settings/ai-data-access` Update Ai Data Access · Bearer access token; workspace capability `change.approve_owner`: owner · body (JSON): `ai_data_access*` · answers 200: `chat_token_budget`, `chat_max_rounds`, `chat_limits`, `theme`, `accent_color`, `logo_url`, `ai_data_access`
- `GET /api/v1/workspaces/{workspace_id}/settings/instructions` Get Company Instructions · Bearer access token; workspace capability `ai.instructions.manage`: admin, owner · answers 200: `text`, `length`, `max_length`
- `PUT /api/v1/workspaces/{workspace_id}/settings/instructions` Update Company Instructions · Bearer access token; workspace capability `ai.instructions.manage`: admin, owner · answers 200: `text`, `length`, `max_length`
- `POST /api/v1/invites/preview` Preview Invite · Public: no token · body (JSON): `token*` · answers 200: `workspace_name`, `inviter_name`, `role`, `state`, `expires_at`
- `POST /api/v1/invites/accept` Accept Invite · Bearer access token of any signed-in user · body (JSON): `token*` · answers 200: `workspace_id`, `role`, `already_member`

### plans

- `GET /api/v1/workspaces/{workspace_id}/plan` Get Plan · Bearer access token; workspace capability `capacity.view`: admin, owner · answers 200: `key`, `features`, `included`, `coming_soon`, `skus`, `builder_seats`, `sku`, `capacity`, `limits`, `trial`

### capacity

- `GET /api/v1/workspaces/{workspace_id}/capacity` Read Capacity · Bearer access token; workspace capability `capacity.view`: admin, owner · answers 200: `timezone`, `sku`, `capacity`, `formula`, `state`, `today`, `month`, `storage`, `ingest`, `recommendation`
- `GET /api/v1/workspaces/{workspace_id}/capacity/usage` Read Capacity Usage · Bearer access token; workspace capability `capacity.view`: admin, owner · query: `period` · answers 200: `period`, `bucket`, `timezone`, `since`, `until`, `capacity_dcu`, `items`, `totals`

### access

- `GET /api/v1/workspaces/{workspace_id}/groups` List Groups · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `groups` must be on · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/groups` Create Group · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `groups` must be on · body (JSON): `slug*`, `name*`, `description` · answers 201: `slug`, `name`, `description`, `member_ids`, `created_at`, `updated_at`
- `DELETE /api/v1/workspaces/{workspace_id}/groups/{slug}` Delete Group · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `groups` must be on · answers 204, no body
- `PATCH /api/v1/workspaces/{workspace_id}/groups/{slug}` Update Group · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `groups` must be on · body (JSON): `name`, `description` · answers 200: `slug`, `name`, `description`, `member_ids`, `created_at`, `updated_at`
- `PUT /api/v1/workspaces/{workspace_id}/groups/{slug}/members` Set Group Members · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `groups` must be on · body (JSON): `user_ids*` · answers 200: `slug`, `name`, `description`, `member_ids`, `created_at`, `updated_at`
- `GET /api/v1/workspaces/{workspace_id}/members/{user_id}/attributes` Get Attributes · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `row_filters` must be on · answers 200: `user_id`, `attributes`
- `PUT /api/v1/workspaces/{workspace_id}/members/{user_id}/attributes` Set Attributes · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `row_filters` must be on · body (JSON): `attributes*` · answers 200: `user_id`, `attributes`

### audit

- `GET /api/v1/workspaces/{workspace_id}/audit` List Audit Log · Bearer access token; workspace capability `audit.view`: admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`

### logs

- `GET /api/v1/workspaces/{workspace_id}/logs` List Logs · Bearer access token; workspace capability `monitoring.view`: admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort`, `level`, `code`, `resource_kind`, `resource_id`, `request_id`, `origin`, `since`, `until` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/workspaces/{workspace_id}/logs/{ref}` Read Log · Bearer access token; workspace capability `monitoring.view`: admin, owner · answers 200: `ref`, `origin`, `workspace_id`, `created_at`, `level`, `code`, `title`, `resource_kind`, `resource_id`, `request_id`, `message`, `actor_email`, `workspace_name`, `actor_id` and 2 more

### ai

- `GET /api/v1/workspaces/{workspace_id}/ai-usage` Read Ai Usage · Bearer access token; workspace capability `ai_usage.view`: admin, owner · query: `days` · answers 200: `days`, `since`, `totals`, `by_day`, `by_model`, `by_purpose`
- `GET /api/v1/workspaces/{workspace_id}/ai-events` List Ai Events · Bearer access token; workspace capability `ai_usage.view`: admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`

### monitoring

- `GET /api/v1/workspaces/{workspace_id}/monitoring/runs` List Runs · Bearer access token; workspace capability `monitoring.view`: admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/workspaces/{workspace_id}/monitoring/queries` List Queries · Bearer access token; workspace capability `monitoring.view`: admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/workspaces/{workspace_id}/monitoring/jobs` List Jobs · Bearer access token; workspace capability `monitoring.view`: admin, owner · answers 200: `items`, `next_cursor`, `total`, `scheduler`, `stale_runs`
- `GET /api/v1/workspaces/{workspace_id}/monitoring/usage` Read Usage · Bearer access token; workspace capability `monitoring.view`: admin, owner · query: `days` · answers 200: `since`, `total`, `by_day`, `by_kind`

### billing

- `GET /api/v1/workspaces/{workspace_id}/billing` Read Billing · Bearer access token; workspace capability `billing.view`: admin, owner · answers 200: `budget`, `balance_uzs`, `monthly_uzs`, `next_charge_on`, `budget_default_uzs`, `budget_custom`, `tier`, `ai_uzs`, `overdue_since`, `grace_until`, `blocked_at`, `blocked_by_hand`, `reopen_uzs`, `trial_ends_at` and 7 more
- `GET /api/v1/workspaces/{workspace_id}/billing/entries` List Entries · Bearer access token; workspace capability `billing.view`: admin, owner · query: `cursor`, `limit`, `q`, `order` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/workspaces/{workspace_id}/billing/limits` Read Limits · Bearer access token; workspace capability `billing.view`: admin, owner · answers 200: `plan`, `rows_month`, `storage_bytes`, `voice_minutes`, `connections`, `sync_minutes`, `resets_on`
- `PUT /api/v1/workspaces/{workspace_id}/billing/budget` Set Budget · Bearer access token; workspace capability `billing.manage`: owner · body (JSON): `budget_uzs*` · answers 200: `budget`, `balance_uzs`, `monthly_uzs`, `next_charge_on`, `budget_default_uzs`, `budget_custom`, `tier`, `ai_uzs`, `overdue_since`, `grace_until`, `blocked_at`, `blocked_by_hand`, `reopen_uzs`, `trial_ends_at` and 7 more
- `PUT /api/v1/workspaces/{workspace_id}/billing/pin` Pin Tier · Bearer access token; workspace capability `billing.manage`: owner · body (JSON): `pinned*` · answers 200: `budget`, `balance_uzs`, `monthly_uzs`, `next_charge_on`, `budget_default_uzs`, `budget_custom`, `tier`, `ai_uzs`, `overdue_since`, `grace_until`, `blocked_at`, `blocked_by_hand`, `reopen_uzs`, `trial_ends_at` and 7 more
- `PUT /api/v1/workspaces/{workspace_id}/billing/plan` Choose Plan · Bearer access token; workspace capability `billing.manage`: owner · body (JSON): `plan*` · answers 200: `budget`, `balance_uzs`, `monthly_uzs`, `next_charge_on`, `budget_default_uzs`, `budget_custom`, `tier`, `ai_uzs`, `overdue_since`, `grace_until`, `blocked_at`, `blocked_by_hand`, `reopen_uzs`, `trial_ends_at` and 7 more
- `POST /api/v1/workspaces/{workspace_id}/billing/requests` Request Contact · Bearer access token; workspace capability `billing.view`: admin, owner · body (JSON): `topic*`, `plan`, `phone` · answers 202: `sent_at`

### notifications

- `GET /api/v1/workspaces/{workspace_id}/notifications` List Notifications · Bearer access token of a member of the workspace (any role) · query: `cursor`, `limit`, `q`, `order`, `sort`, `unread` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/notifications/{notification_id}/read` Mark Notification Read · Bearer access token of a member of the workspace (any role) · answers 200: `id`, `kind`, `payload`, `link`, `read_at`, `created_at`

### findings

- `GET /api/v1/workspaces/{workspace_id}/findings` List Findings · Bearer access token of a member of the workspace (any role) · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/findings/{finding_id}/done` Mark Finding Done · Bearer access token of a member of the workspace (any role) · answers 200: `id`, `done`, `muted_until`
- `POST /api/v1/workspaces/{workspace_id}/findings/{finding_id}/mute` Mute Finding · Bearer access token of a member of the workspace (any role) · answers 200: `id`, `done`, `muted_until`

### industries

- `GET /api/v1/industries` List Industries · Bearer access token of any signed-in user · answers 200: `items`, `next_cursor`, `total`

### repo

- `GET /api/v1/workspaces/{workspace_id}/repo/tree` Read Tree · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · query: `ref`, `cursor`, `limit` · answers 200: `items`, `next_cursor`, `total`, `ref`, `commit_oid`
- `GET /api/v1/workspaces/{workspace_id}/repo/file` Read File · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · query: `ref`, `path` · answers 200: `ref`, `commit_oid`, `path`, `oid`, `size`, `kind`, `managed`, `content`
- `PUT /api/v1/workspaces/{workspace_id}/repo/file` Write File · Bearer access token; workspace capability `change.create`: builder, admin, owner. Refused while the workspace is stopped · headers: `if-match`, `if-none-match` · body (JSON): `ref*`, `path*`, `content*`, `message` · answers 200: `ref`, `commit_oid`, `path`, `oid`, `size`, `committed`, `change_number`

### changes

- `GET /api/v1/workspaces/{workspace_id}/changes` List Changes · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort`, `status` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/changes` Create Change · Bearer access token; workspace capability `change.create`: builder, admin, owner. Refused while the workspace is stopped · body (JSON): `title*`, `ref*`, `summary` · answers 201: `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` and 10 more
- `GET /api/v1/workspaces/{workspace_id}/changes/{number}` Get Change · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · answers 200: `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` and 10 more
- `GET /api/v1/workspaces/{workspace_id}/changes/{number}/diff` Change Diff · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · query: `cursor`, `limit` · answers 200: `items`, `next_cursor`, `total`, `number`, `base_oid`, `head_oid`
- `POST /api/v1/workspaces/{workspace_id}/changes/{number}/checks/rerun` Rerun Checks · Bearer access token; workspace capability `change.create`: builder, admin, owner. Refused while the workspace is stopped · answers 202: `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` and 10 more
- `POST /api/v1/workspaces/{workspace_id}/changes/{number}/approve` Approve Change · Bearer access token; workspace capability `change.approve`: builder, admin, owner · body (JSON): `head_oid*`, `note` · answers 200: `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` and 10 more
- `POST /api/v1/workspaces/{workspace_id}/changes/{number}/confirm` Confirm Change · Bearer access token; workspace capability `change.approve`: builder, admin, owner · body (JSON): `head_oid*`, `note` · answers 200: `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` and 10 more
- `POST /api/v1/workspaces/{workspace_id}/changes/{number}/reject` Reject Change · Bearer access token; workspace capability `change.approve`: builder, admin, owner · body (JSON): `note` · answers 200: `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` and 10 more

### deployments

- `GET /api/v1/workspaces/{workspace_id}/deployments` List Deployments · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/workspaces/{workspace_id}/deployments/{version}` Get Deployment · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · answers 200: `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`, `change_number`, `is_current`
- `POST /api/v1/workspaces/{workspace_id}/deployments/{version}/rollback` Rollback · Bearer access token; workspace capability `deploy.rollback`: builder, admin, owner · body (JSON): `note` · answers 202: `target_version`, `change_number`, `job_id`

### runs

- `GET /api/v1/workspaces/{workspace_id}/runs` List Runs · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort`, `kind`, `status`, `source_id`, `change_request_id` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/workspaces/{workspace_id}/runs/{run_id}` Get Run · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · answers 200: `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` and 17 more
- `GET /api/v1/workspaces/{workspace_id}/runs/{run_id}/logs` Run Logs · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · query: `cursor`, `limit` · answers 200: `items`, `next_cursor`, `total`, `run_status`
- `GET /api/v1/workspaces/{workspace_id}/runs/{run_id}/logs/stream` Stream Logs · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · query: `after` · headers: `last-event-id` · answers 200: text/event-stream
- `POST /api/v1/workspaces/{workspace_id}/runs/{run_id}/cancel` Cancel Run · Bearer access token; workspace capability `source.manage`: builder, admin, owner. Refused while the workspace is stopped · answers 200: `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` and 16 more

### secrets

- `GET /api/v1/workspaces/{workspace_id}/secrets` List Secrets · Bearer access token; workspace capability `secret.manage`: builder, admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`
- `PUT /api/v1/workspaces/{workspace_id}/secrets/{name}` Put Secret · Bearer access token; workspace capability `secret.manage`: builder, admin, owner · body (JSON): `kind*`, `value*` · answers 200: `name`, `kind`, `is_set`, `updated_at`
- `DELETE /api/v1/workspaces/{workspace_id}/secrets/{name}` Delete Secret · Bearer access token; workspace capability `secret.manage`: builder, admin, owner · answers 204, no body
- `GET /api/v1/workspaces/{workspace_id}/secret-requests` List Secret Requests · Bearer access token; workspace capability `secret.manage`: builder, admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort`, `status` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/secret-requests/{request_id}/dismiss` Dismiss Secret Request · Bearer access token; workspace capability `secret.manage`: builder, admin, owner · answers 200: `id`, `name`, `kind`, `label`, `help`, `source_slug`, `requested_by_kind`, `status`, `is_set`, `chat_id`, `change_request_id`, `created_at`, `expires_at`, `fulfilled_at`

### dataplane

- `GET /api/v1/workspaces/{workspace_id}/data-plane` Get Data Plane · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · answers 200: `status`, `cell`, `database`, `ddl_version`, `latest_ddl_version`, `ingest_state`, `storage`, `ingest`, `error_code`, `updated_at`
- `GET /api/v1/workspaces/{workspace_id}/data-plane/tables` List Tables · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · answers 200: `status`, `collected_at`, `refreshing`, `truncated`, `items`, `next_cursor`, `total`
- `GET /api/v1/workspaces/{workspace_id}/quota` Get Quota · Bearer access token; workspace capability `capacity.view`: admin, owner · answers 200: `level`, `stop_code`, `resets_on`, `period_start`, `storage_state`, `waiting_loads`, `meters`

### sources

- `GET /api/v1/workspaces/{workspace_id}/sources` List Sources · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort`, `status`, `origin` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/sources` Create Source · Bearer access token; workspace capability `source.manage`: builder, admin, owner. Refused while the workspace is stopped · body (JSON): `version`, `connector*`, `package`, `title`, `config`, `secrets`, `resources`, `schedule`, `egress`, `rate_limit`, `schema_contract`, `rest_api`, `browser`, `slug*` · answers 201: `id`, `slug`, `title`, `connector_key`, `kind`, `status`, `origin`, `timezone`, `raw_schema`, `data_version`, `last_loaded_at`, `last_load_status`, `last_load_rows`, `load_stopped` and 4 more
- `POST /api/v1/workspaces/{workspace_id}/sources/uploads/files` Upload File · Bearer access token; workspace capability `source.manage`: builder, admin, owner. Refused while the workspace is stopped · body (multipart/form-data): `file*`, `source` · answers 201: `id`, `file_name`, `content_type`, `size_bytes`, `sha256`, `source_slug`, `sheets`, `created_at`
- `GET /api/v1/workspaces/{workspace_id}/sources/{slug}` Get Source · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · answers 200: `id`, `slug`, `title`, `connector_key`, `kind`, `status`, `origin`, `timezone`, `raw_schema`, `data_version`, `last_loaded_at`, `last_load_status`, `last_load_rows`, `load_stopped` and 8 more
- `GET /api/v1/workspaces/{workspace_id}/sources/{slug}/runs` List Runs · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/sources/{slug}/runs` Start Run · Bearer access token; workspace capability `source.manage`: builder, admin, owner. Refused while the workspace is stopped · body (JSON): `mode`, `backfill_from` · answers 202: `id`, `kind`, `trigger`, `status`, `rows_loaded`, `error_code`, `error_message`, `created_at`, `started_at`, `finished_at`, `duration_ms`
- `GET /api/v1/workspaces/{workspace_id}/sources/{slug}/files` List Files · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`, `max_file_mb`, `pending`, `pending_bytes`
- `DELETE /api/v1/workspaces/{workspace_id}/sources/{slug}/files/{file_id}` Remove File · Bearer access token; workspace capability `source.manage`: builder, admin, owner. Refused while the workspace is stopped · answers 200: `id`, `file_name`, `state`, `load_table`, `kept`
- `POST /api/v1/workspaces/{workspace_id}/sources/{slug}/inspect` Inspect Source · Bearer access token; workspace capability `source.manage`: builder, admin, owner. Refused while the workspace is stopped · answers 202: `id`, `kind`, `trigger`, `status`, `rows_loaded`, `error_code`, `error_message`, `created_at`, `started_at`, `finished_at`, `duration_ms`
- `GET /api/v1/workspaces/{workspace_id}/sources/{slug}/egress` List Egress · Bearer access token; workspace capability `dev_mode`: builder, admin, owner · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/sources/{slug}/egress/{rule_id}/approve` Approve Egress · Bearer access token; workspace capability `change.approve_access`: admin, owner · answers 200: `id`, `host`, `port`, `protocol`, `purpose`, `status`, `requested_by_kind`, `approved_by`, `approved_at`, `created_at`

### packages

- `GET /api/v1/workspaces/{workspace_id}/packages` List Packages · Bearer access token; workspace capability `package.manage`: builder, admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/workspaces/{workspace_id}/package-installs` List Installs · Bearer access token; workspace capability `package.manage`: builder, admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/package-installs` Install Package · Bearer access token; workspace capability `change.create`, `package.manage`: builder, admin, owner. Refused while the workspace is stopped · body (JSON): `package*`, `version`, `config`, `source_slug` · answers 201: `install`, `change_number`
- `GET /api/v1/workspaces/{workspace_id}/package-installs/{install_id}` Get Install · Bearer access token; workspace capability `package.manage`: builder, admin, owner · answers 200: `id`, `package`, `title`, `version`, `status`, `target_version`, `change_number`, `source_slug`, `managed_paths`, `seeded_paths`, `ejected_paths`, `installed_commit_oid`, `installed_by`, `created_at` and 1 more
- `POST /api/v1/workspaces/{workspace_id}/package-installs/{install_id}/upgrade` Upgrade Package · Bearer access token; workspace capability `change.create`, `package.manage`: builder, admin, owner. Refused while the workspace is stopped · body (JSON): `version` · answers 200: `install`, `change_number`
- `POST /api/v1/workspaces/{workspace_id}/package-installs/{install_id}/eject` Eject File · Bearer access token; workspace capability `change.create`, `package.manage`: builder, admin, owner. Refused while the workspace is stopped · body (JSON): `path*` · answers 200: `install`, `change_number`, `path`, `ejected_to`
- `GET /api/v1/workspaces/{workspace_id}/package-installs/{install_id}/uninstall-preview` Uninstall Preview · Bearer access token; workspace capability `access.manage`, `change.create`: admin, owner. Refused while the workspace is stopped · answers 200: `dashboards`, `deliveries`, `blockers`, `removable`
- `POST /api/v1/workspaces/{workspace_id}/package-installs/{install_id}/uninstall` Uninstall Package · Bearer access token; workspace capability `access.manage`, `change.create`: admin, owner. Refused while the workspace is stopped · body (JSON): `force` · answers 200: `package`, `change_number`, `approval`, `broken_charts`, `broken_dashboards`, `removal`

### marketplace

- `GET /api/v1/workspaces/{workspace_id}/marketplace` List Cards · Bearer access token; workspace capability `package.manage`: builder, admin, owner · query: `cursor`, `limit`, `q`, `order`, `sort`, `category`, `provides`, `publisher`, `verified`, `installed` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/workspaces/{workspace_id}/marketplace/connections` Connections · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}` Package Detail · Bearer access token; workspace capability `package.manage`: builder, admin, owner · answers 200: `key`, `title`, `description`, `kind`, `category`, `provides`, `publisher`, `verified`, `featured_rank`, `is_fragile`, `is_beta`, `latest_version`, `license`, `tags` and 16 more
- `POST /api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/install` Install · Bearer access token; workspace capability `change.create`, `package.manage`: builder, admin, owner. Refused while the workspace is stopped · body (JSON): `version`, `config`, `source_slug` · answers 201: `install`, `change_number`
- `GET /api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/connection` Connection · Bearer access token; workspace capability `package.manage`: builder, admin, owner · answers 200: `install_status`, `source_slug`, `ready`, `test`, `load`, `max_file_mb`, `templates`, `config`, `recent_loads`, `paused`, `refresh`, `progress`, `estimate`, `removal`
- `POST /api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/connection/test` Test Connection · Bearer access token; workspace capability `package.manage`, `source.manage`: builder, admin, owner. Refused while the workspace is stopped · answers 202: `install_status`, `source_slug`, `ready`, `test`, `load`, `max_file_mb`, `templates`, `config`, `recent_loads`, `paused`, `refresh`, `progress`, `estimate`, `removal`
- `POST /api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/connection/pause` Pause Connection · Bearer access token; workspace capability `package.manage`, `source.manage`: builder, admin, owner. Refused while the workspace is stopped · answers 200: `install_status`, `source_slug`, `ready`, `test`, `load`, `max_file_mb`, `templates`, `config`, `recent_loads`, `paused`, `refresh`, `progress`, `estimate`, `removal`
- `POST /api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/connection/resume` Resume Connection · Bearer access token; workspace capability `package.manage`, `source.manage`: builder, admin, owner. Refused while the workspace is stopped · answers 200: `install_status`, `source_slug`, `ready`, `test`, `load`, `max_file_mb`, `templates`, `config`, `recent_loads`, `paused`, `refresh`, `progress`, `estimate`, `removal`
- `PUT /api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/connection/refresh` Set Refresh · Bearer access token; workspace capability `package.manage`, `source.manage`: builder, admin, owner. Refused while the workspace is stopped · body (JSON): `refresh_minutes`, `refresh_plan` · answers 200: `install_status`, `source_slug`, `ready`, `test`, `load`, `max_file_mb`, `templates`, `config`, `recent_loads`, `paused`, `refresh`, `progress`, `estimate`, `removal`
- `POST /api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/files` Upload File · Bearer access token; workspace capability `package.manage`, `source.manage`: builder, admin, owner. Refused while the workspace is stopped · body (multipart/form-data): `file*` · answers 201: `install_status`, `source_slug`, `ready`, `test`, `load`, `max_file_mb`, `templates`, `config`, `recent_loads`, `paused`, `refresh`, `progress`, `estimate`, `removal`
- `GET /api/v1/workspaces/{workspace_id}/marketplace/packages/{scope}/{name}/templates/{table}` Download Template · Bearer access token; workspace capability `package.manage`: builder, admin, owner · query: `locale` · answers 200: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

### explore

- `POST /api/v1/workspaces/{workspace_id}/explore/queries` Run Explore Query · Bearer access token; workspace capability `explore.sql`: builder, admin, owner. Plan feature `semantic_layers` must be on · body (JSON): `sql*`, `limit` · answers 200: `columns`, `rows`, `row_count`, `truncated`, `limit`, `duration_ms`

### dashboards

- `GET /api/v1/workspaces/{workspace_id}/dashboards` List Dashboards · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on · query: `cursor`, `limit`, `q` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/dashboards` Create Dashboard · Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on · body (JSON): `title*`, `description`, `slug` · answers 201: `slug`, `path`, `title`, `description`, `is_starter`, `version`, `filters`, `tiles`, `refresh`, `can_edit`, `access`, `pending_change`, `updated_at`
- `GET /api/v1/workspaces/{workspace_id}/dashboards/{slug}` Get Dashboard · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on · answers 200: `slug`, `path`, `title`, `description`, `is_starter`, `version`, `filters`, `tiles`, `refresh`, `can_edit`, `access`, `pending_change`, `updated_at`
- `DELETE /api/v1/workspaces/{workspace_id}/dashboards/{slug}` Delete Dashboard · Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on · answers 204, no body
- `PATCH /api/v1/workspaces/{workspace_id}/dashboards/{slug}` Update Dashboard · Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on · body (JSON): `expected_version*`, `title`, `description`, `filters`, `layout`, `access` · answers 200: `slug`, `path`, `title`, `description`, `is_starter`, `version`, `filters`, `tiles`, `refresh`, `can_edit`, `access`, `pending_change`, `updated_at`
- `POST /api/v1/workspaces/{workspace_id}/dashboards/{slug}/charts` Add Chart · Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on · body (JSON): `message_id`, `block_index`, `chart`, `title` · answers 201: `dashboard`, `chart`, `slug`, `added`, `version`, `pending_change`
- `DELETE /api/v1/workspaces/{workspace_id}/dashboards/{slug}/charts/{chart}` Remove Chart · Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on · query: `expected_version` · answers 200: `slug`, `path`, `title`, `description`, `is_starter`, `version`, `filters`, `tiles`, `refresh`, `can_edit`, `access`, `pending_change`, `updated_at`
- `PATCH /api/v1/workspaces/{workspace_id}/dashboards/{slug}/charts/{chart}` Update Chart · Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on · body (JSON): `expected_version*`, `title`, `visual`, `position` · answers 200: `slug`, `path`, `title`, `description`, `is_starter`, `version`, `filters`, `tiles`, `refresh`, `can_edit`, `access`, `pending_change`, `updated_at`
- `POST /api/v1/workspaces/{workspace_id}/dashboards/{slug}/charts/{chart}/data` Tile Data · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on · body (JSON): `filters`, `locale` · answers 200: `dashboard`, `chart`, `status`, `code`, `message`, `title`, `visual`, `sql_result`, `filters`, `poll_seconds`
- `GET /api/v1/workspaces/{workspace_id}/dashboards/{slug}/filters/{filter_id}/values` Filter Values · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on · query: `q`, `limit`, `locale` · answers 200: `filter`, `kind`, `member`, `items`, `restricted`, `truncated`
- `PUT /api/v1/workspaces/{workspace_id}/dashboards/{slug}/refresh-settings` Refresh Settings · Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on · body (JSON): `mode`, `schedule`, `live`, `live_interval_minutes` · answers 200: `mode`, `schedule`, `live`, `live_interval_minutes`, `min_interval_minutes`, `refreshed_at`, `next_refresh_at`
- `POST /api/v1/workspaces/{workspace_id}/dashboards/{slug}/refresh` Refresh Now · Bearer access token; workspace capability `content.edit`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `dashboards` must be on · answers 200: `mode`, `schedule`, `live`, `live_interval_minutes`, `min_interval_minutes`, `refreshed_at`, `next_refresh_at`

### chats

- `GET /api/v1/workspaces/{workspace_id}/chats` List Chats · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · query: `cursor`, `limit`, `q`, `order`, `sort` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/chats` Create Chat · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `title`, `model_id` · answers 201: `id`, `title`, `model_id`, `created_at`, `updated_at`, `active_run`, `shared`, `read_only`
- `GET /api/v1/workspaces/{workspace_id}/chats/models` List Models · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: `default_model_id`, `default_tier`, `items`, `tiers`, `attachments`, `documents`
- `GET /api/v1/workspaces/{workspace_id}/chats/skills` List Skills · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/workspaces/{workspace_id}/chats/preferences` Chat Preferences · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: `answer_details`
- `PUT /api/v1/workspaces/{workspace_id}/chats/preferences` Save Chat Preferences · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `answer_details*` · answers 200: `answer_details`
- `GET /api/v1/workspaces/{workspace_id}/chats/{chat_id}` Get Chat · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · query: `limit`, `locale` · answers 200: `id`, `title`, `model_id`, `created_at`, `updated_at`, `active_run`, `shared`, `read_only`, `messages`, `has_more`, `before`
- `DELETE /api/v1/workspaces/{workspace_id}/chats/{chat_id}` Delete Chat · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 204, no body
- `PATCH /api/v1/workspaces/{workspace_id}/chats/{chat_id}` Update Chat · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `title`, `model_id` · answers 200: `id`, `title`, `model_id`, `created_at`, `updated_at`, `active_run`, `shared`, `read_only`
- `GET /api/v1/workspaces/{workspace_id}/chats/{chat_id}/messages` List Messages · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · query: `before`, `limit`, `locale` · answers 200: `items`, `has_more`, `before`
- `POST /api/v1/workspaces/{workspace_id}/chats/{chat_id}/messages` Post Message · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `text`, `choice`, `attachments`, `input_mode`, `voice_seconds`, `documents`, `skill`, `skill_hint` · answers 202: `run_id`, `chat_id`, `message_id`, `state`, `last_event_id`
- `GET /api/v1/workspaces/{workspace_id}/chats/{chat_id}/messages/{message_id}/details` Answer Details · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: `message_id`, `run_id`, `model`, `model_label`, `rounds`, `duration_ms`, `queue_ms`, `tokens`, `cost_uzs`, `steps`, `escalation`
- `POST /api/v1/workspaces/{workspace_id}/chats/{chat_id}/share` Share Chat · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: `id`, `title`, `model_id`, `created_at`, `updated_at`, `active_run`, `shared`, `read_only`
- `DELETE /api/v1/workspaces/{workspace_id}/chats/{chat_id}/share` Unshare Chat · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: `id`, `title`, `model_id`, `created_at`, `updated_at`, `active_run`, `shared`, `read_only`
- `GET /api/v1/workspaces/{workspace_id}/chats/{chat_id}/runs/{run_id}/events` Run Events · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · query: `after` · headers: `last-event-id` · answers 200: text/event-stream
- `POST /api/v1/workspaces/{workspace_id}/chats/{chat_id}/runs/{run_id}/cancel` Cancel Run · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 202: `run_id`, `state`
- `POST /api/v1/workspaces/{workspace_id}/chats/notes` Save Note · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `text*` · answers 201: `id`, `created_at`
- `PUT /api/v1/workspaces/{workspace_id}/chats/{chat_id}/messages/{message_id}/feedback` Save Feedback · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `value*`, `reason`, `note`, `shared` · answers 200: `value`, `reason`, `note`, `shared`, `updated_at`
- `DELETE /api/v1/workspaces/{workspace_id}/chats/{chat_id}/messages/{message_id}/feedback` Clear Feedback · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 204, no body

### voice

- `POST /api/v1/workspaces/{workspace_id}/chats/voice` Transcribe New · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (multipart/form-data): `audio*`, `language` · answers 200: `text`, `language`, `seconds`
- `POST /api/v1/workspaces/{workspace_id}/chats/{chat_id}/voice` Transcribe · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (multipart/form-data): `audio*`, `language` · answers 200: `text`, `language`, `seconds`
- `POST /api/v1/workspaces/{workspace_id}/chats/{chat_id}/messages/{message_id}/speech` Speak · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: `message_id`, `status`, `voice`, `seconds`
- `GET /api/v1/workspaces/{workspace_id}/chats/{chat_id}/messages/{message_id}/speech/audio` Speech Audio · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: audio/wav
- `GET /api/v1/workspaces/{workspace_id}/settings/voice` Voice Settings · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: `enabled`, `stt_provider`, `tts_provider`, `voice`, `daily_minutes`, `plan_minutes`, `minutes_left`, `tts_providers`, `voices`, `spoken_answers`
- `PATCH /api/v1/workspaces/{workspace_id}/settings/voice` Update Voice Settings · Bearer access token; workspace capability `ai.instructions.manage`: admin, owner · body (JSON): `enabled`, `stt_provider`, `tts_provider`, `voice`, `daily_minutes`, `clear_daily_minutes` · answers 200: `enabled`, `stt_provider`, `tts_provider`, `voice`, `daily_minutes`, `plan_minutes`, `minutes_left`, `tts_providers`, `voices`, `spoken_answers`
- `POST /api/v1/workspaces/{workspace_id}/settings/voice/samples` Voice Sample · Bearer access token; workspace capability `ai.instructions.manage`: admin, owner · body (JSON): `tts_provider*`, `voice*`, `language` · answers 200: audio/wav

### documents

- `POST /api/v1/workspaces/{workspace_id}/chats/uploads` Add Document · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (multipart/form-data): `file*`, `chat_id*` · answers 201: `document_id`, `chat_id`, `name`, `size`, `content_type`, `pages`
- `GET /api/v1/workspaces/{workspace_id}/chats/documents/{document_id}` Get Document · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: `document_id`, `chat_id`, `name`, `content_type`, `size`, `pages`, `status`, `kind`, `supplier`, `currency`, `total`, `method`, `rows`, `unsure_rows` and 1 more
- `GET /api/v1/workspaces/{workspace_id}/chats/documents/{document_id}/image` Document Image · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: image/*
- `PATCH /api/v1/workspaces/{workspace_id}/chats/documents/{document_id}/rows/{line}` Fix Row · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `name`, `sku`, `barcode`, `quantity`, `unit`, `price`, `amount` · answers 200: `document_id`, `chat_id`, `name`, `content_type`, `size`, `pages`, `status`, `kind`, `supplier`, `currency`, `total`, `method`, `rows`, `unsure_rows` and 1 more

### delivery

- `POST /api/v1/me/telegram/link-codes` Create Link Code · Bearer access token of any signed-in user · answers 201: `link`, `expires_at`
- `GET /api/v1/me/telegram` Telegram Status · Bearer access token of any signed-in user · answers 200: `configured`, `bot_username`, `links`
- `DELETE /api/v1/me/telegram/{link_id}` Unlink Telegram · Bearer access token of any signed-in user · answers 204, no body
- `GET /api/v1/workspaces/{workspace_id}/dashboards/{slug}/deliveries` List Deliveries · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. One of the plan features `email_delivery`, `telegram_delivery` must be on · answers 200: `items`, `next_cursor`, `total`
- `PUT /api/v1/workspaces/{workspace_id}/dashboards/{slug}/deliveries/{key}` Put Delivery · 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 · body (JSON): `key`, `channel`, `schedule*`, `recipients`, `format`, `freshness`, `enabled` · answers 200: `version`, `change_number`, `delivery`
- `DELETE /api/v1/workspaces/{workspace_id}/dashboards/{slug}/deliveries/{key}` Delete Delivery · 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 · answers 200: `version`, `change_number`, `delivery`
- `POST /api/v1/workspaces/{workspace_id}/dashboards/{slug}/deliveries/{key}/test` Test Delivery · 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 · answers 202: `delivery_run_id`, `status`
- `PUT /api/v1/workspaces/{workspace_id}/dashboards/{slug}/deliveries/{key}/subscription` Put Subscription · Bearer access token; workspace capability `delivery.subscribe_self`: viewer, builder, admin, owner. One of the plan features `email_delivery`, `telegram_delivery` must be on · body (JSON): `subscribed*` · answers 200: `key`, `subscribed`, `subscription`
- `POST /api/v1/workspaces/{workspace_id}/daily-cards` Daily Card · 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 · body (JSON): `message_id*`, `block_index*`, `hour` · answers 201: `dashboard`, `chart`, `at`, `linked`, `pending_change`
- `GET /api/v1/workspaces/{workspace_id}/delivery-runs` List Delivery Runs · 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 · query: `cursor`, `limit`, `q`, `order`, `sort`, `dashboard`, `delivery`, `status` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/dashboards/{slug}/pdf` Request Pdf · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on · body (JSON): `filters`, `locale` · answers 202: `id`, `status`, `size_bytes`, `pages`, `error_code`, `expires_at`, `created_at`
- `GET /api/v1/workspaces/{workspace_id}/pdf-exports/{export_id}` Pdf Status · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on · answers 200: `id`, `status`, `size_bytes`, `pages`, `error_code`, `expires_at`, `created_at`
- `GET /api/v1/workspaces/{workspace_id}/pdf-exports/{export_id}/file` Pdf File · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner. Plan feature `dashboards` must be on · answers 200: application/pdf
- `GET /api/v1/email/unsubscribe/{token}` Describe Unsubscribe · Public: no token · query: `locale` · answers 200: `dashboard`, `workspace`, `unsubscribed`
- `POST /api/v1/email/unsubscribe/{token}` Unsubscribe · Public: no token · answers 200: `dashboard`, `workspace`, `unsubscribed`

### git-sync

- `GET /api/v1/workspaces/{workspace_id}/git-sync` Git Sync Status · Bearer access token; workspace capability `dev_mode`: builder, admin, owner. Plan feature `git_sync` must be on · answers 200: `remote`, `webhook_url`, `app_available`
- `PUT /api/v1/workspaces/{workspace_id}/git-sync` Connect Git Sync · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `git_sync` must be on · body (JSON): `provider*`, `repository*`, `base_url`, `auth*`, `export_branch`, `import_branch` · answers 202: `remote`, `webhook_url`, `app_available`, `webhook_secret`
- `DELETE /api/v1/workspaces/{workspace_id}/git-sync` Disconnect Git Sync · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `git_sync` must be on · answers 204, no body
- `POST /api/v1/workspaces/{workspace_id}/git-sync/sync` Sync Now · Bearer access token; workspace capability `change.create`: builder, admin, owner. Refused while the workspace is stopped. Plan feature `git_sync` must be on · answers 202: `remote`, `webhook_url`, `app_available`
- `POST /api/v1/workspaces/{workspace_id}/git-sync/resolve` Resolve Divergence · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `git_sync` must be on · body (JSON): `action*` · answers 202: `remote`, `webhook_url`, `app_available`
- `POST /api/v1/workspaces/{workspace_id}/git-sync/webhook-secret` Rotate Webhook Secret · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `git_sync` must be on · answers 200: `webhook_url`, `webhook_secret`
- `POST /api/v1/workspaces/{workspace_id}/git-sync/webhook` Receive Webhook · Public: no token · answers 200: `queued`
- `POST /api/v1/workspaces/{workspace_id}/git-sync/github/install` Github Install · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `git_sync` must be on · answers 200: `url`
- `POST /api/v1/workspaces/{workspace_id}/git-sync/github/repositories` Github Repositories · Bearer access token; workspace capability `access.manage`: admin, owner. Plan feature `git_sync` must be on · body (JSON): `grant*` · answers 200: `installation_id`, `account`, `repositories`, `total`
- `POST /api/v1/git-sync/github/setup` Github Setup · 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 · body (JSON): `installation_id`, `setup_action`, `state*` · answers 200: `workspace_id`, `status`, `authorize_url`
- `POST /api/v1/git-sync/github/callback` Github Callback · 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 · body (JSON): `code*`, `state*` · answers 200: `workspace_id`, `grant`

### onboarding

- `GET /api/v1/workspaces/{workspace_id}/onboarding` Onboarding · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner · answers 200: `steps`, `done`, `total`, `dashboard`

### cards

- `GET /api/v1/workspaces/{workspace_id}/cards/profiles` List Profiles · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: `items`
- `GET /api/v1/workspaces/{workspace_id}/cards/settings` Read Settings · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: `level`, `levels`, `can_edit`, `last_style`, `last_language`
- `PUT /api/v1/workspaces/{workspace_id}/cards/settings` Save Settings · Bearer access token; workspace capability `ai.params.manage`, `chat.use`: owner. Refused while the workspace is stopped · body (JSON): `level*` · answers 200: `level`, `levels`, `can_edit`, `last_style`, `last_language`
- `GET /api/v1/workspaces/{workspace_id}/cards` List Cards · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · query: `cursor`, `limit`, `q`, `order` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/workspaces/{workspace_id}/cards` Create Card · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `profile` · answers 201: `id`, `profile`, `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level`, `status`, `research`, `ask`, `error` and 17 more
- `GET /api/v1/workspaces/{workspace_id}/cards/{card_id}` Read Card · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: `id`, `profile`, `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level`, `status`, `research`, `ask`, `error` and 17 more
- `DELETE /api/v1/workspaces/{workspace_id}/cards/{card_id}` Delete Card · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 204, no body
- `PATCH /api/v1/workspaces/{workspace_id}/cards/{card_id}` Update Card · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `level`, `texts`, `callouts`, `code`, `code_state`, `order`, `status` · answers 200: `id`, `profile`, `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level`, `status`, `research`, `ask`, `error` and 17 more
- `POST /api/v1/workspaces/{workspace_id}/cards/{card_id}/variants` Add Variant · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `name`, `names` · answers 201: `id`, `name`, `names`, `barcode`, `sku`, `package`, `price_uzs`, `discount_uzs`, `photos`, `images`
- `DELETE /api/v1/workspaces/{workspace_id}/cards/{card_id}/variants/{variant_id}` Delete Variant · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 204, no body
- `PATCH /api/v1/workspaces/{workspace_id}/cards/{card_id}/variants/{variant_id}` Update Variant · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `name`, `names`, `barcode`, `sku`, `package`, `price_uzs`, `discount_uzs`, `position` · answers 200: `id`, `profile`, `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level`, `status`, `research`, `ask`, `error` and 17 more
- `POST /api/v1/workspaces/{workspace_id}/cards/{card_id}/photos` Upload Photo · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · query: `variant` · body (multipart/form-data): `file*` · answers 201: `id`, `main`, `width`, `height`, `small`, `uncut`
- `DELETE /api/v1/workspaces/{workspace_id}/cards/{card_id}/photos/{image_id}` Delete Photo · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 204, no body
- `PATCH /api/v1/workspaces/{workspace_id}/cards/{card_id}/photos/{image_id}` Update Photo · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `main`, `chosen` · answers 200: `id`, `profile`, `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level`, `status`, `research`, `ask`, `error` and 17 more
- `GET /api/v1/workspaces/{workspace_id}/cards/{card_id}/codes` Search Codes · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · query: `q` · answers 200: `items`
- `POST /api/v1/workspaces/{workspace_id}/cards/{card_id}/design` Design Card · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `style*`, `level`, `slots`, `note`, `variant` · answers 202: `id`, `profile`, `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level`, `status`, `research`, `ask`, `error` and 17 more
- `POST /api/v1/workspaces/{workspace_id}/cards/{card_id}/run` Run Card · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level` · answers 202: `id`, `profile`, `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level`, `status`, `research`, `ask`, `error` and 17 more
- `POST /api/v1/workspaces/{workspace_id}/cards/{card_id}/search` Search Card · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 202: `id`, `profile`, `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level`, `status`, `research`, `ask`, `error` and 17 more
- `POST /api/v1/workspaces/{workspace_id}/cards/{card_id}/compose` Compose Card · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 202: `id`, `profile`, `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level`, `status`, `research`, `ask`, `error` and 17 more
- `POST /api/v1/workspaces/{workspace_id}/cards/{card_id}/stop` Stop Card · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 202: `id`, `profile`, `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level`, `status`, `research`, `ask`, `error` and 17 more
- `POST /api/v1/workspaces/{workspace_id}/cards/{card_id}/retry` Retry Card · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 202: `id`, `profile`, `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level`, `status`, `research`, `ask`, `error` and 17 more
- `PUT /api/v1/workspaces/{workspace_id}/cards/{card_id}/images/{slot}/source` Swap Image · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · body (JSON): `image_id*`, `original`, `variant` · answers 202: `id`, `profile`, `product`, `barcode`, `link`, `notes`, `style`, `instruction`, `language`, `level`, `status`, `research`, `ask`, `error` and 17 more
- `DELETE /api/v1/workspaces/{workspace_id}/cards/{card_id}/images/{slot}` Remove Image · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 204, no body
- `GET /api/v1/workspaces/{workspace_id}/cards/{card_id}/images/{image_id}` Read Image · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · query: `size` · answers 200: image/jpeg
- `GET /api/v1/workspaces/{workspace_id}/cards/{card_id}/images/{image_id}/download` Download Image · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: image/jpeg
- `GET /api/v1/workspaces/{workspace_id}/cards/{card_id}/export.zip` Export Card · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · answers 200: application/zip

### home

- `GET /api/v1/workspaces/{workspace_id}/home/today` Today · Bearer access token; workspace capability `chat.use`: viewer, builder, admin, owner. Refused while the workspace is stopped · query: `locale` · answers 200: `today`, `lines`, `tip`

### menu

- `GET /api/v1/workspaces/{workspace_id}/menu-pins` List Pins · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner · answers 200: `items`, `next_cursor`, `total`
- `PUT /api/v1/workspaces/{workspace_id}/menu-pins/order` Reorder Pins · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner · body (JSON): `items*` · answers 200: `items`, `next_cursor`, `total`
- `PUT /api/v1/workspaces/{workspace_id}/menu-pins/{kind}/{target}` Pin · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner · answers 200: `items`, `next_cursor`, `total`
- `DELETE /api/v1/workspaces/{workspace_id}/menu-pins/{kind}/{target}` Unpin · Bearer access token; workspace capability `dashboard.view`: viewer, builder, admin, owner · answers 200: `items`, `next_cursor`, `total`

<!-- endpoint-index:end -->
