# Операции REST API

> Источник: `api/openapi.yaml` (OpenAPI 3.1, версия сервера `/v1`). Полная схема: [/openapi.yaml](https://paybot.kz/openapi.yaml), [/openapi.json](https://paybot.kz/openapi.json).

Всего операций: **298**, групп: **41**. Полные схемы запросов и ответов — в [openapi.yaml](https://paybot.kz/openapi.yaml).

| Колонка | Значение |
| --- | --- |
| Права | Какие права ключа нужны: `read`, `write`, `money`. Пусто — права не нужны. |
| Idempotency-Key | «обязателен» — без него `400 idempotency_key_required`; «можно» — повтор безопасен и так; «нельзя» — ответ содержит одноразовый секрет, заголовок отклоняется. |
| Авторизация | «ключ API или кабинет» — подходит ключ `pb_...`; «только кабинет» — сессия человека, ключ не примут; «без авторизации» — публичный. |

## Группы

- [Access](#access) (8)
- [agent](#agent) (6)
- [AI connections](#ai-connections) (4)
- [API keys](#api-keys) (4)
- [Approvals](#approvals) (6)
- [audit](#audit) (1)
- [auth](#auth) (34)
- [Billing](#billing) (5)
- [Bitrix24](#bitrix24) (10)
- [builder](#builder) (10)
- [Catalog](#catalog) (13)
- [Client errors](#client-errors) (1)
- [contacts](#contacts) (5)
- [Course students](#course-students) (13)
- [Courses](#courses) (25)
- [Dashboard](#dashboard) (4)
- [Devices](#devices) (2)
- [Domains](#domains) (7)
- [Generator](#generator) (6)
- [invites](#invites) (4)
- [Kaspi accounts](#kaspi-accounts) (8)
- [legal-profile](#legal-profile) (4)
- [Live pages](#live-pages) (6)
- [MCP](#mcp) (1)
- [members](#members) (3)
- [merchants](#merchants) (4)
- [Notifications](#notifications) (8)
- [Orders](#orders) (3)
- [Own site](#own-site) (3)
- [Payments](#payments) (14)
- [Plans](#plans) (5)
- [Promo codes](#promo-codes) (3)
- [Public pages](#public-pages) (13)
- [Rules](#rules) (9)
- [Site](#site) (1)
- [Statistics](#statistics) (3)
- [Subscriptions](#subscriptions) (4)
- [Telegram](#telegram) (11)
- [Templates](#templates) (14)
- [Uploads](#uploads) (4)
- [Webhooks](#webhooks) (9)

## Access

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/access/grants` | `access-grant-list` | `read` | — | ключ API или кабинет | List access grants, newest first |
| POST | `/v1/access/grants/{id}/revoke` | `access-grant-revoke` | `write` | можно | ключ API или кабинет | Revoke a grant by hand: remove the subscriber from the channel |
| POST | `/v1/access/products/{id}/comp` | `access-product-comp` | `write` | можно | ключ API или кабинет | Give a known subscriber free access for N days, or extend theirs |
| POST | `/v1/access/products/{id}/remove-subscriber` | `access-product-remove-subscriber` | `write` | можно | ключ API или кабинет | Remove a subscriber: end the subscription and take them out of the channel |
| POST | `/v1/access/products/{id}/start-link/rotate` | `access-product-start-link-rotate` | `write` | нельзя | ключ API или кабинет | Replace the public start link of a deployment for one mode |
| POST | `/v1/access/products/{id}/stop-sales` | `access-product-stop-sales` | `write` | можно | ключ API или кабинет | Stop selling the plan of a channel |
| GET | `/v1/access/products/{id}/subscribers` | `access-product-subscribers` | `read` | — | ключ API или кабинет | List the subscribers of a channel's plan, newest first |
| POST | `/v1/access/start-links` | `access-start-link-create` | `write` | нельзя | ключ API или кабинет | Create a personal start link: works once, for a link sent to one person |

## agent

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| POST | `/v1/agent/actions/{id}/reject` | `agent-action-reject` | `write` | можно | ключ API или кабинет | Reject a proposed action |
| GET | `/v1/agent/events` | `agent-events` | `read` | — | ключ API или кабинет | Stream the agent's events (server-sent events) |
| POST | `/v1/agent/messages` | `agent-message-send` | `write` | можно | ключ API или кабинет | Send the agent a message |
| POST | `/v1/agent/runs/{id}/cancel` | `agent-run-cancel` | `write` | можно | ключ API или кабинет | Stop a running run |
| POST | `/v1/agent/runs/{id}/continue` | `agent-run-continue` | `write` | можно | ключ API или кабинет | Continue an interrupted run |
| GET | `/v1/agent/thread` | `agent-thread-get` | `read` | — | ключ API или кабинет | The business's agent conversation |

## AI connections

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| POST | `/v1/oauth/authorization/decision` | `oauth-authorization-decision` | — | нельзя | только кабинет | Allow or refuse an AI application |
| POST | `/v1/oauth/authorization/preview` | `oauth-authorization-preview` | — | нельзя | только кабинет | What an AI application asks for, and the businesses that can be connected |
| GET | `/v1/oauth/grants` | `oauth-list-grants` | `read` | — | ключ API или кабинет | Connected AI applications |
| DELETE | `/v1/oauth/grants/{id}` | `oauth-disconnect-grant` | `write` | можно | ключ API или кабинет | Disconnect an AI application |

## API keys

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/api-keys` | `list-api-keys` | `read` | — | ключ API или кабинет | List API keys |
| POST | `/v1/api-keys` | `create-api-key` | `write` | нельзя | ключ API или кабинет | Create an API key |
| DELETE | `/v1/api-keys/{id}` | `revoke-api-key` | `write` | можно | ключ API или кабинет | Revoke an API key |
| POST | `/v1/api-keys/{id}/rotate` | `rotate-api-key` | `write` | нельзя | ключ API или кабинет | Rotate an API key |

## Approvals

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/approvals` | `approvals-list` | `read` | — | ключ API или кабинет | List approvals, newest first |
| GET | `/v1/approvals/settings` | `approval-settings-get` | `money` | — | ключ API или кабинет | The merchant's refund limits |
| PUT | `/v1/approvals/settings` | `approval-settings-put` | `money` | можно | ключ API или кабинет | Change the merchant's refund limits |
| GET | `/v1/approvals/{id}` | `approval-get` | `read` | — | ключ API или кабинет | Get an approval |
| POST | `/v1/approvals/{id}/approve` | `approval-approve` | `money` | можно | ключ API или кабинет | Approve and execute |
| POST | `/v1/approvals/{id}/reject` | `approval-reject` | `money` | можно | ключ API или кабинет | Reject |

## audit

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/audit-log` | `list-audit-log` | `read` | — | ключ API или кабинет | The selected merchant's audit log, newest first |

## auth

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/auth/csrf` | `auth-csrf` | — | — | только кабинет | Issue a fresh CSRF token for the current session |
| POST | `/v1/auth/handoff` | `auth-handoff-start` | — | можно | только кабинет | Open the web cabinet without signing in again |
| POST | `/v1/auth/handoff/exchange` | `auth-handoff-exchange` | — | можно | только кабинет | Trade a hand-off token for a cabinet session |
| POST | `/v1/auth/link/phone/request` | `auth-link-phone-request` | — | можно | только кабинет | Send a code to a phone to link it to the signed-in account |
| POST | `/v1/auth/link/phone/verify` | `auth-link-phone-verify` | — | можно | только кабинет | Link a phone to the signed-in account with its code |
| POST | `/v1/auth/link/telegram/callback` | `auth-link-telegram-callback` | — | можно | только кабинет | Finish linking Telegram with the code and state from the redirect |
| POST | `/v1/auth/link/telegram/start` | `auth-link-telegram-start` | — | можно | только кабинет | Start linking a Telegram account to the signed-in account |
| POST | `/v1/auth/link/whatsapp/poll` | `auth-link-whatsapp-poll` | — | можно | только кабинет | Poll a WhatsApp phone link |
| POST | `/v1/auth/link/whatsapp/start` | `auth-link-whatsapp-start` | — | можно | только кабинет | Start linking a phone to the signed-in account by WhatsApp |
| POST | `/v1/auth/logout` | `auth-logout` | — | можно | только кабинет | Revoke the current session |
| POST | `/v1/auth/logout-all` | `auth-logout-all` | — | можно | только кабинет | Sign out everywhere |
| POST | `/v1/auth/otp/request` | `auth-otp-request` | — | можно | без авторизации | Send a sign-in code to a phone |
| POST | `/v1/auth/otp/verify` | `auth-otp-verify` | — | нельзя | без авторизации | Sign in with a phone and code |
| POST | `/v1/auth/reauth/device` | `auth-reauth-device` | — | нельзя | только кабинет | Confirm identity with the device key (after Face ID / passcode on the phone) |
| DELETE | `/v1/auth/reauth/device` | `auth-reauth-device-delete` | — | нельзя | только кабинет | Remove this session's device key |
| POST | `/v1/auth/reauth/request` | `auth-reauth-request` | — | можно | только кабинет | Send a confirmation code to the signed-in user's own phone |
| POST | `/v1/auth/reauth/telegram` | `auth-reauth-telegram` | — | можно | только кабинет | Confirm identity with a fresh Telegram Login payload |
| POST | `/v1/auth/reauth/telegram/oidc/callback` | `auth-reauth-telegram-oidc-callback` | — | можно | только кабинет | Finish confirming identity with the code and state from the Telegram redirect |
| POST | `/v1/auth/reauth/telegram/oidc/start` | `auth-reauth-telegram-oidc-start` | — | можно | только кабинет | Start confirming identity with Log In With Telegram (OpenID Connect) |
| POST | `/v1/auth/reauth/verify` | `auth-reauth-verify` | — | нельзя | только кабинет | Confirm identity with the code; unlocks dangerous actions for 5 minutes |
| GET | `/v1/auth/security-events` | `auth-security-events` | — | — | только кабинет | The account's recent sign-in events |
| GET | `/v1/auth/sessions` | `auth-sessions-list` | — | — | только кабинет | List the caller's signed-in devices and browsers |
| POST | `/v1/auth/sessions/revoke-others` | `auth-sessions-revoke-others` | — | можно | только кабинет | Sign every other session out |
| DELETE | `/v1/auth/sessions/{id}` | `auth-sessions-revoke` | — | можно | только кабинет | Sign one session out |
| POST | `/v1/auth/telegram` | `auth-telegram` | — | нельзя | без авторизации | Sign in with the legacy Telegram Login widget |
| POST | `/v1/auth/telegram/oidc/callback` | `auth-telegram-oidc-callback` | — | нельзя | без авторизации | Finish a Telegram sign-in with the code and state from the redirect |
| POST | `/v1/auth/telegram/oidc/start` | `auth-telegram-oidc-start` | — | нельзя | без авторизации | Start a Telegram sign-in (Log In With Telegram, OpenID Connect) |
| POST | `/v1/auth/whatsapp/poll` | `auth-whatsapp-poll` | — | нельзя | без авторизации | Poll a WhatsApp sign-in; signs in once the button is pressed |
| POST | `/v1/auth/whatsapp/start` | `auth-whatsapp-start` | — | нельзя | без авторизации | Start a WhatsApp sign-in: send a confirmation to the phone |
| GET | `/v1/me` | `get-me` | — | — | только кабинет | The signed-in user and their merchants |
| DELETE | `/v1/me` | `me-delete` | — | обязателен | только кабинет | Delete the caller's account |
| GET | `/v1/me/deletion` | `me-deletion-preview` | — | — | только кабинет | What deleting the account would do |
| GET | `/v1/me/logins` | `me-logins` | — | — | только кабинет | The caller's sign-in history |
| POST | `/v1/me/logins/{id}/not-me` | `me-logins-not-me` | — | обязателен | только кабинет | This sign-in was not me: close its session |

## Billing

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/billing` | `billing-summary` | `read` | — | ключ API или кабинет | The merchant's PayBot plan and usage against its limits |
| POST | `/v1/billing/checkout` | `billing-checkout` | `money` | обязателен | ключ API или кабинет | Buy a PayBot plan |
| GET | `/v1/billing/orders` | `billing-orders` | `read` | — | ключ API или кабинет | The merchant's plan orders, newest first (at most 100) |
| GET | `/v1/billing/orders/{id}` | `billing-order-get` | `read` | — | ключ API или кабинет | One plan order with its payment |
| GET | `/v1/billing/plans` | `billing-plans` | `read` | — | ключ API или кабинет | PayBot plans and their limits |

## Bitrix24

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/integrations/bitrix24` | `bitrix24-status` | `read` | — | ключ API или кабинет | The Bitrix24 connection and the state of the sync |
| POST | `/v1/integrations/bitrix24` | `bitrix24-connect` | `write` | нельзя | ключ API или кабинет | Connect a Bitrix24 portal by its inbound webhook |
| DELETE | `/v1/integrations/bitrix24` | `bitrix24-disconnect` | `write` | можно | ключ API или кабинет | Disconnect Bitrix24: forget the webhook, the links and the sync log |
| POST | `/v1/integrations/bitrix24/inbound-token` | `bitrix24-inbound-token` | `write` | нельзя | ключ API или кабинет | Issue a token for the reverse endpoint (a deal changed stage in Bitrix24) |
| GET | `/v1/integrations/bitrix24/items` | `bitrix24-items` | `read` | — | ключ API или кабинет | The last 100 sync items, newest first |
| POST | `/v1/integrations/bitrix24/items/{id}/retry` | `bitrix24-item-retry` | `write` | обязателен | ключ API или кабинет | Push a failed or dead item again |
| GET | `/v1/integrations/bitrix24/options` | `bitrix24-options` | `read` | — | ключ API или кабинет | The portal's deal pipelines with their stages, and its sources (read live) |
| POST | `/v1/integrations/bitrix24/retry-failed` | `bitrix24-retry-failed` | `write` | обязателен | ключ API или кабинет | Push every failed or dead item again |
| PATCH | `/v1/integrations/bitrix24/settings` | `bitrix24-settings` | `write` | можно | ключ API или кабинет | Change what is synced and where |
| POST | `/v1/integrations/bitrix24/test` | `bitrix24-test` | `write` | можно | ключ API или кабинет | Check the stored connection (who the webhook is, whether it has the CRM right) |

## builder

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/builder/project` | `builder-project-get` | `read` | — | ключ API или кабинет | The business's site project |
| GET | `/v1/builder/project/events` | `builder-events` | `read` | — | ключ API или кабинет | Stream the project's events (server-sent events) |
| POST | `/v1/builder/project/messages` | `builder-message-send` | `write` | можно | ключ API или кабинет | Ask the builder for a change |
| POST | `/v1/builder/project/preview-token` | `builder-preview-token` | `read` | можно | ключ API или кабинет | The URL of the project's live preview |
| POST | `/v1/builder/project/publish` | `builder-project-publish` | `write` | можно | ключ API или кабинет | Publish the current version |
| PATCH | `/v1/builder/project/settings` | `builder-project-settings` | `write` | можно | ключ API или кабинет | Change the site's settings |
| GET | `/v1/builder/project/versions` | `builder-versions-list` | `read` | — | ключ API или кабинет | The project's versions, newest first (at most 50) |
| POST | `/v1/builder/project/versions/{id}/restore` | `builder-version-restore` | `write` | можно | ключ API или кабинет | Go back to an earlier version |
| POST | `/v1/builder/projects` | `builder-project-create` | `write` | можно | ключ API или кабинет | Create the business's site project |
| PUT | `/v1/builder/subdomain` | `builder-set-subdomain` | — | можно | только кабинет | Rename the business subdomain |

## Catalog

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/catalog/delivery-options` | `catalog-delivery-list` | `read` | — | ключ API или кабинет | List delivery options |
| PUT | `/v1/catalog/delivery-options/{code}` | `catalog-delivery-put` | `write` | можно | ключ API или кабинет | Create or replace a delivery option |
| DELETE | `/v1/catalog/delivery-options/{code}` | `catalog-delivery-archive` | `write` | можно | ключ API или кабинет | Archive a delivery option |
| POST | `/v1/catalog/import` | `catalog-import` | `write` | можно | ключ API или кабинет | Import a catalogue CSV (or validate it with dry_run) |
| GET | `/v1/catalog/products` | `catalog-product-list` | `read` | — | ключ API или кабинет | List products, newest first |
| POST | `/v1/catalog/products` | `catalog-product-create` | `write` | обязателен | ключ API или кабинет | Create a product with its variants |
| GET | `/v1/catalog/products/{id}` | `catalog-product-get` | `read` | — | ключ API или кабинет | Get a product |
| PATCH | `/v1/catalog/products/{id}` | `catalog-product-update` | `write` | можно | ключ API или кабинет | Change a product's title or description |
| DELETE | `/v1/catalog/products/{id}` | `catalog-product-archive` | `write` | можно | ключ API или кабинет | Archive a product (take it off sale); orders keep their snapshot |
| POST | `/v1/catalog/products/{id}/variants` | `catalog-variant-create` | `write` | обязателен | ключ API или кабинет | Add a variant to a product |
| PATCH | `/v1/catalog/variants/{id}` | `catalog-variant-update` | `write` | можно | ключ API или кабинет | Change a variant's title or price |
| DELETE | `/v1/catalog/variants/{id}` | `catalog-variant-archive` | `write` | можно | ключ API или кабинет | Archive a variant (take it off sale) |
| POST | `/v1/catalog/variants/{id}/stock` | `catalog-variant-stock-adjust` | `write` | обязателен | ключ API или кабинет | Adjust a variant's stock by a delta |

## Client errors

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| POST | `/v1/client-errors` | `client-errors-report` | — | нельзя | без авторизации | Report a crash of the app |

## contacts

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/contacts` | `contact-list` | `read` | — | ключ API или кабинет | The business's clients |
| GET | `/v1/contacts/{id}` | `contact-get` | `read` | — | ключ API или кабинет | One client with their leads and consents |
| PATCH | `/v1/contacts/{id}` | `contact-patch` | `write` | обязателен | ключ API или кабинет | Edit a client's name, notes and tags |
| POST | `/v1/contacts/{id}/erase` | `contact-erase` | `write` | обязателен | ключ API или кабинет | Erase a client's personal data on their request |
| POST | `/v1/contacts/{id}/merge` | `contact-merge` | `write` | обязателен | ключ API или кабинет | Merge a duplicate client into this one |

## Course students

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| POST | `/v1/public/courses/access` | `course-access-claim` | — | можно | без авторизации | Claim the student key a paid payment bought |
| POST | `/v1/public/courses/learn/exchange` | `course-learn-exchange` | — | можно | без авторизации | Trade the one-time code of the bot's «Учиться» button for the student key |
| POST | `/v1/public/courses/login/start` | `course-login-start` | — | обязателен | без авторизации | Send a sign-in code to the phone a course was bought with |
| POST | `/v1/public/courses/login/verify` | `course-login-verify` | — | обязателен | без авторизации | Trade a correct sign-in code for the student's keys |
| GET | `/v1/public/courses/me` | `course-student-outline` | — | — | без авторизации | The student's course: modules and lessons with their drip state and progress |
| GET | `/v1/public/courses/me/lessons/{lesson_id}` | `course-student-lesson` | — | — | без авторизации | An open lesson's content |
| GET | `/v1/public/courses/me/lessons/{lesson_id}/attachments/{attachment_id}` | `course-student-attachment` | — | — | без авторизации | A short-lived download of a lesson attachment |
| POST | `/v1/public/courses/me/lessons/{lesson_id}/complete` | `course-student-complete` | — | можно | без авторизации | Mark an open lesson done |
| PUT | `/v1/public/courses/me/lessons/{lesson_id}/position` | `course-student-position` | — | обязателен | без авторизации | Remember where the student stopped in a lesson's video |
| POST | `/v1/public/courses/me/phone/confirm` | `course-student-phone-confirm` | — | обязателен | без авторизации | Link the phone to this course with the code it received |
| POST | `/v1/public/courses/me/phone/start` | `course-student-phone-start` | — | обязателен | без авторизации | Send a code to a phone the student wants to sign in with later |
| POST | `/v1/public/courses/me/telegram-link` | `course-student-telegram-link` | — | можно | без авторизации | A one-time Telegram link that brings the student's course into the business's bot |
| GET | `/v1/public/courses/pages/{slug}/preview` | `course-page-preview` | — | — | без авторизации | The free preview lessons of a published course page |

## Courses

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/courses` | `course-list` | `read` | — | ключ API или кабинет | List courses, newest first |
| POST | `/v1/courses` | `course-create` | `write` | обязателен | ключ API или кабинет | Create a draft course |
| GET | `/v1/courses/{course_id}` | `course-get` | `read` | — | ключ API или кабинет | Get a course with its modules and lessons |
| PATCH | `/v1/courses/{course_id}` | `course-update` | `write` | можно | ключ API или кабинет | Change a course's title or description |
| DELETE | `/v1/courses/{course_id}` | `course-delete` | `write` | можно | ключ API или кабинет | Delete a course that has no page and no students |
| GET | `/v1/courses/{course_id}/enrollments` | `course-enrollment-list` | `read` | — | ключ API или кабинет | List a course's enrollments, newest first |
| POST | `/v1/courses/{course_id}/enrollments/{enrollment_id}/extend` | `course-enrollment-extend` | `write` | обязателен | ключ API или кабинет | Extend a student's access by a number of days |
| POST | `/v1/courses/{course_id}/enrollments/{enrollment_id}/reset-phone` | `course-enrollment-reset-phone` | `write` | обязателен | ключ API или кабинет | Clear a student's confirmed phone and end their sign-ins |
| POST | `/v1/courses/{course_id}/enrollments/{enrollment_id}/revoke` | `course-enrollment-revoke` | `write` | можно | ключ API или кабинет | Revoke a student's access; their key stops working at once |
| POST | `/v1/courses/{course_id}/enrollments/{enrollment_id}/token` | `course-enrollment-token` | `write` | нельзя | ключ API или кабинет | Issue a new student key for an enrollment (the old one stops working) |
| POST | `/v1/courses/{course_id}/lessons` | `course-lesson-create` | `write` | обязателен | ключ API или кабинет | Append a lesson to a module |
| PUT | `/v1/courses/{course_id}/lessons/{lesson_id}` | `course-lesson-replace` | `write` | можно | ключ API или кабинет | Replace a lesson's title, content and drip |
| DELETE | `/v1/courses/{course_id}/lessons/{lesson_id}` | `course-lesson-delete` | `write` | можно | ключ API или кабинет | Delete a lesson |
| POST | `/v1/courses/{course_id}/lessons/{lesson_id}/attachments` | `course-lesson-attachment-upload` | `write` | нельзя | ключ API или кабинет | Get a presigned upload URL for a file attached to a lesson |
| DELETE | `/v1/courses/{course_id}/lessons/{lesson_id}/attachments/{attachment_id}` | `course-lesson-attachment-delete` | `write` | можно | ключ API или кабинет | Remove an attachment |
| POST | `/v1/courses/{course_id}/lessons/{lesson_id}/attachments/{attachment_id}/confirm` | `course-lesson-attachment-confirm` | `write` | обязателен | ключ API или кабинет | Confirm an attachment's upload |
| POST | `/v1/courses/{course_id}/lessons/{lesson_id}/upload` | `course-lesson-upload` | `write` | нельзя | ключ API или кабинет | Get a presigned upload URL for a lesson's file; the lesson becomes a file lesson |
| POST | `/v1/courses/{course_id}/lessons/{lesson_id}/upload/confirm` | `course-lesson-upload-confirm` | `write` | обязателен | ключ API или кабинет | Confirm the lesson's uploaded file; the lesson switches to it now |
| PUT | `/v1/courses/{course_id}/module-order` | `course-module-order` | `write` | можно | ключ API или кабинет | Set the order of a course's modules |
| POST | `/v1/courses/{course_id}/modules` | `course-module-create` | `write` | обязателен | ключ API или кабинет | Append a module to a course |
| PATCH | `/v1/courses/{course_id}/modules/{module_id}` | `course-module-update` | `write` | можно | ключ API или кабинет | Rename a module |
| DELETE | `/v1/courses/{course_id}/modules/{module_id}` | `course-module-delete` | `write` | можно | ключ API или кабинет | Delete a module and its lessons |
| PUT | `/v1/courses/{course_id}/modules/{module_id}/lesson-order` | `course-lesson-order` | `write` | можно | ключ API или кабинет | Set the order of a module's lessons |
| POST | `/v1/courses/{course_id}/publish` | `course-publish` | `write` | можно | ключ API или кабинет | Publish a course: a course page may sell it |
| POST | `/v1/courses/{course_id}/unpublish` | `course-unpublish` | `write` | можно | ключ API или кабинет | Stop selling a course (students keep their access) |

## Dashboard

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/dashboard` | `dashboard` | `read` | — | ключ API или кабинет | Revenue, payments, invoice conversion and subscribers over a range of days |
| GET | `/v1/exports/{entity}` | `export` | `read` | — | ключ API или кабинет | Download a list as an Excel file (or CSV) |
| GET | `/v1/stats/overview` | `stats-overview` | `read` | — | ключ API или кабинет | Revenue, payments, average check, new and repeat customers over a period |
| GET | `/v1/stats/sources` | `stats-sources` | `read` | — | ключ API или кабинет | Where visitors, leads and money come from: by source and campaign |

## Devices

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| PUT | `/v1/devices` | `devices-put` | `write` | можно | ключ API или кабинет | Register a device push token |
| DELETE | `/v1/devices/{id}` | `devices-delete` | `write` | можно | ключ API или кабинет | Revoke a device push token |

## Domains

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/domains` | `domain-list` | `read` | — | ключ API или кабинет | List the business's own domains |
| POST | `/v1/domains` | `domain-create` | `write` | обязателен | ключ API или кабинет | Connect a domain |
| GET | `/v1/domains/targets` | `domain-targets` | `read` | — | ключ API или кабинет | What a domain can open: the site and the public pages |
| GET | `/v1/domains/{id}` | `domain-get` | `read` | — | ключ API или кабинет | One domain |
| PATCH | `/v1/domains/{id}` | `domain-update` | `write` | обязателен | ключ API или кабинет | Change what a domain opens, or its www redirect |
| DELETE | `/v1/domains/{id}` | `domain-delete` | `write` | можно | ключ API или кабинет | Remove a domain |
| POST | `/v1/domains/{id}/check` | `domain-check` | `write` | обязателен | ключ API или кабинет | Check the DNS now |

## Generator

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/generator/credits` | `generator-credits` | `read` | — | ключ API или кабинет | Generation credits: balance and latest usage |
| POST | `/v1/generator/images` | `generator-images-create` | `write` | можно | ключ API или кабинет | Generate pictures for a page or a product |
| POST | `/v1/generator/imports` | `generator-import-create` | `write` | можно | ключ API или кабинет | Propose catalogue items from a messy price list |
| GET | `/v1/generator/imports/{id}` | `generator-import-get` | `read` | — | ключ API или кабинет | Read an import proposal |
| POST | `/v1/generator/imports/{id}/apply` | `generator-import-apply` | `write` | можно | ключ API или кабинет | Import the picked items of an import proposal |
| GET | `/v1/generator/requests/{id}` | `generator-request-get` | `read` | — | ключ API или кабинет | Progress of a generator request |

## invites

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/invites` | `list-invites` | `read` | — | ключ API или кабинет | The selected merchant's invites |
| POST | `/v1/invites` | `create-invite` | `write` | нельзя | ключ API или кабинет | Invite a person by phone or email |
| DELETE | `/v1/invites/{id}` | `revoke-invite` | `write` | можно | ключ API или кабинет | Revoke an invite |
| POST | `/v1/invites/{token}/accept` | `accept-invite` | — | можно | только кабинет | Accept an invite and join its merchant |

## Kaspi accounts

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/kaspi/accounts` | `kaspi-accounts-list` | `read` | — | ключ API или кабинет | List connected Kaspi accounts |
| POST | `/v1/kaspi/accounts/login` | `kaspi-account-login-start` | `write` | обязателен | ключ API или кабинет | Start connecting a Kaspi cashier account (sends an SMS code) |
| GET | `/v1/kaspi/accounts/{id}` | `kaspi-account-get` | `read` | — | ключ API или кабинет | Get a Kaspi account |
| DELETE | `/v1/kaspi/accounts/{id}` | `kaspi-account-delete` | `write` | обязателен | ключ API или кабинет | Disconnect a Kaspi account and erase its keys |
| POST | `/v1/kaspi/accounts/{id}/check` | `kaspi-account-check` | `write` | обязателен | ключ API или кабинет | Check the account's Kaspi session now |
| POST | `/v1/kaspi/accounts/{id}/default` | `kaspi-account-set-default` | `write` | обязателен | ключ API или кабинет | Use this account for new payments |
| POST | `/v1/kaspi/accounts/{id}/disable` | `kaspi-account-disable` | `write` | обязателен | ключ API или кабинет | Stop using this account |
| POST | `/v1/kaspi/accounts/{id}/verify` | `kaspi-account-login-verify` | `write` | обязателен | ключ API или кабинет | Finish connecting a Kaspi account with the SMS code |

## legal-profile

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/merchants/{id}/legal-profile` | `legal-profile-get` | `read` | — | ключ API или кабинет | The seller's legal profile |
| PUT | `/v1/merchants/{id}/legal-profile` | `legal-profile-put` | `write` | можно | ключ API или кабинет | Create or replace the seller's legal profile |
| POST | `/v1/merchants/{id}/legal-profile/documents` | `legal-profile-documents` | `read` | обязателен | ключ API или кабинет | Draft the offer and the privacy policy from the profile |
| GET | `/v1/public/{slug}/terms` | `public-terms-get` | — | — | без авторизации | The seller's details and offer for buyers |

## Live pages

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/live/pages/{page_id}` | `live-page-get` | `read` | — | ключ API или кабинет | A live page with its lots |
| PUT | `/v1/live/pages/{page_id}/current` | `live-current-set` | `write` | можно | ключ API или кабинет | Put a lot on air |
| POST | `/v1/live/pages/{page_id}/lots` | `live-lot-create` | `write` | обязателен | ключ API или кабинет | Add a lot to a live page |
| PATCH | `/v1/live/pages/{page_id}/lots/{lot_id}` | `live-lot-update` | `write` | можно | ключ API или кабинет | Change an open lot |
| DELETE | `/v1/live/pages/{page_id}/lots/{lot_id}` | `live-lot-delete` | `write` | можно | ключ API или кабинет | Delete a lot nobody checked out |
| POST | `/v1/live/pages/{page_id}/lots/{lot_id}/close` | `live-lot-close` | `write` | можно | ключ API или кабинет | Stop selling a lot |

## MCP

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/mcp/connection` | `mcp-connection` | `read` | — | ключ API или кабинет | How to connect the merchant's own AI (MCP address, tool list) |

## members

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/members` | `list-members` | `read` | — | ключ API или кабинет | The people of the selected merchant |
| PATCH | `/v1/members/{user_id}` | `change-member-role` | `write` | можно | ключ API или кабинет | Change a member's role |
| DELETE | `/v1/members/{user_id}` | `remove-member` | `read` | можно | ключ API или кабинет | Remove a member (or leave the merchant) |

## merchants

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/merchants` | `list-merchants` | — | — | только кабинет | The caller's merchants |
| POST | `/v1/merchants` | `create-merchant` | — | обязателен | только кабинет | Register a merchant; the caller becomes its owner |
| GET | `/v1/merchants/{id}` | `get-merchant` | — | — | только кабинет | A merchant the caller is a member of |
| PATCH | `/v1/merchants/{id}` | `update-merchant` | — | можно | только кабинет | Rename a merchant, change its timezone or set its logo |

## Notifications

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/notifications/feed` | `notifications-feed-get` | `read` | — | ключ API или кабинет | The business's recent events, with what the caller has not seen |
| POST | `/v1/notifications/feed/seen` | `notifications-feed-seen` | `write` | обязателен | ключ API или кабинет | Mark the feed as seen |
| GET | `/v1/notifications/preferences` | `notifications-preferences-get` | `read` | — | ключ API или кабинет | Get what the caller is told about, and where |
| PUT | `/v1/notifications/preferences` | `notifications-preferences-put` | `write` | можно | ключ API или кабинет | Change what the caller is told about, and where |
| POST | `/v1/notifications/push/test` | `notifications-push-test` | `write` | обязателен | ключ API или кабинет | Send a test push to the caller's phones |
| GET | `/v1/notifications/settings` | `notifications-settings-get` | `read` | — | ключ API или кабинет | Get notification settings |
| PUT | `/v1/notifications/settings` | `notifications-settings-put` | `write` | можно | ключ API или кабинет | Replace notification settings |
| POST | `/v1/notifications/telegram/link` | `notifications-telegram-link` | `write` | обязателен | ключ API или кабинет | Link Telegram for notifications |

## Orders

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/orders` | `order-list` | `read` | — | ключ API или кабинет | List orders, newest first |
| GET | `/v1/orders/{id}` | `order-get` | `read` | — | ключ API или кабинет | Get an order with its history and the buyer's phone |
| POST | `/v1/orders/{id}/transition` | `order-transition` | `write` | можно | ключ API или кабинет | Move an order to another status |

## Own site

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| POST | `/v1/site/upload` | `site-upload` | `write` | можно | ключ API или кабинет | Upload a static site (zip, tar or tar.gz) as the raw request body |
| GET | `/v1/site/versions` | `site-versions` | `read` | — | ключ API или кабинет | List the uploaded versions of the site |
| POST | `/v1/site/versions/{id}/publish` | `site-version-publish` | `write` | можно | ключ API или кабинет | Put an uploaded version live (also a rollback to an earlier one) |

## Payments

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/pay/health` | `pay-health` | `read` | — | ключ API или кабинет | Can buyers pay right now? The Kaspi status for the cabinet header and the app |
| GET | `/v1/pay/problems` | `pay-problems-list` | `read` | — | ключ API или кабинет | The problems to look at on Today |
| POST | `/v1/pay/problems/refused/resolve` | `pay-problems-resolve-refused` | `write` | обязателен | ключ API или кабинет | Mark all refused checkouts as dealt with |
| POST | `/v1/pay/problems/{id}/resolve` | `pay-problem-resolve` | `write` | обязателен | ключ API или кабинет | Mark a problem done |
| POST | `/v1/pay/reconcile` | `pay-reconcile` | `write` | обязателен | ключ API или кабинет | Check the payments against the Kaspi history now |
| GET | `/v1/payments` | `payments-list` | `read` | — | ключ API или кабинет | List payments, newest first |
| POST | `/v1/payments/invoices` | `payment-invoice-create` | `write` | обязателен | ключ API или кабинет | Send a Kaspi invoice to a payer's phone |
| POST | `/v1/payments/qr` | `payment-qr-create` | `write` | обязателен | ключ API или кабинет | Create a Kaspi QR payment |
| GET | `/v1/payments/{id}` | `payment-get` | `read` | — | ключ API или кабинет | Get a payment |
| POST | `/v1/payments/{id}/cancel` | `payment-cancel` | `write` | можно | ключ API или кабинет | Stop waiting for a pending payment |
| GET | `/v1/payments/{id}/events` | `payment-events` | `read` | — | ключ API или кабинет | Stream a payment's status (server-sent events) |
| GET | `/v1/payments/{id}/history` | `payment-history` | `read` | — | ключ API или кабинет | Status history of a payment, oldest first |
| POST | `/v1/payments/{id}/refund` | `payment-refund-request` | `money` | обязателен | ключ API или кабинет | Ask for a refund (creates an approval) |
| GET | `/v1/payments/{id}/refunds` | `payment-refunds` | `read` | — | ключ API или кабинет | Refund requests of a payment and where each one stands |

## Plans

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/plans` | `plan-list` | `read` | — | ключ API или кабинет | List plans, newest first |
| POST | `/v1/plans` | `plan-create` | `write` | обязателен | ключ API или кабинет | Create a subscription plan |
| GET | `/v1/plans/{id}` | `plan-get` | `read` | — | ключ API или кабинет | Get a plan |
| PATCH | `/v1/plans/{id}` | `plan-update` | `write` | можно | ключ API или кабинет | Change a plan; a running period keeps the terms it started with |
| POST | `/v1/plans/{id}/archive` | `plan-archive` | `write` | можно | ключ API или кабинет | Archive a plan: it takes no new subscribers; existing subscribers keep renewing on their terms |

## Promo codes

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/promo-codes` | `promo-list` | `read` | — | ключ API или кабинет | List promo codes, newest first |
| POST | `/v1/promo-codes` | `promo-create` | `write` | обязателен | ключ API или кабинет | Create a promo code |
| PATCH | `/v1/promo-codes/{id}` | `promo-set-active` | `write` | обязателен | ключ API или кабинет | Switch a promo code on or off |

## Public pages

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/public/live/{slug}/events` | `public-live-events` | — | — | без авторизации | Stream a live page's state (server-sent events) |
| GET | `/v1/public/live/{slug}/overlay` | `public-live-overlay` | — | — | без авторизации | A live page's state as compact JSON, for an OBS overlay |
| GET | `/v1/public/orders/{token}` | `public-order-get` | — | — | без авторизации | A buyer's order page |
| GET | `/v1/public/payments/receipts/{token}` | `public-payment-receipt` | — | — | без авторизации | The buyer's payment confirmation |
| GET | `/v1/public/{slug}` | `public-page-get` | — | — | без авторизации | A published page, as JSON |
| POST | `/v1/public/{slug}/checkout` | `public-page-checkout` | — | можно | без авторизации | Start a payment for one item of a page |
| POST | `/v1/public/{slug}/leads` | `public-store-lead` | — | можно | без авторизации | Leave a lead (a contact request) with a business |
| POST | `/v1/public/{slug}/notify-payable` | `public-notify-payable` | — | можно | без авторизации | Ask the seller to tell me when I can pay |
| GET | `/v1/public/{slug}/offers` | `public-store-offers` | — | — | без авторизации | What a business sells: store products, published courses and channel plans |
| POST | `/v1/public/{slug}/orders` | `public-store-order` | — | можно | без авторизации | Place a store order (a cart) and start its payment |
| GET | `/v1/public/{slug}/payments/{payment_id}` | `public-page-payment-status` | — | — | без авторизации | The status of a payment started on a page |
| POST | `/v1/public/{slug}/promo-preview` | `public-page-promo-preview` | — | обязателен | без авторизации | What a promo code would take off, before paying |
| POST | `/v1/public/{slug}/seen` | `public-page-seen` | — | можно | без авторизации | Count the opening of a product on a page |

## Rules

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/rules` | `rule-list` | `read` | — | ключ API или кабинет | List rules |
| POST | `/v1/rules` | `rule-create` | `write` | обязателен | ключ API или кабинет | Create a rule |
| GET | `/v1/rules/catalog` | `rule-catalog` | `read` | — | ключ API или кабинет | Describe the triggers, condition fields, operators and actions a rule can use |
| GET | `/v1/rules/{id}` | `rule-get` | `read` | — | ключ API или кабинет | Get a rule |
| PATCH | `/v1/rules/{id}` | `rule-update` | `write` | можно | ключ API или кабинет | Change a rule's name, trigger, conditions, actions or stop_on_failure |
| DELETE | `/v1/rules/{id}` | `rule-delete` | `write` | можно | ключ API или кабинет | Delete a rule, its runs and its queued actions |
| POST | `/v1/rules/{id}/disable` | `rule-disable` | `write` | можно | ключ API или кабинет | Switch a rule off (actions already queued still run) |
| POST | `/v1/rules/{id}/enable` | `rule-enable` | `write` | можно | ключ API или кабинет | Switch a rule on |
| GET | `/v1/rules/{id}/runs` | `rule-runs` | `read` | — | ключ API или кабинет | List a rule's runs and the state of their actions, newest first |

## Site

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| POST | `/v1/public/leads` | `public-leads-create` | — | нельзя | без авторизации | Leave a request on the PayBot site |

## Statistics

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/contacts/{id}/activity` | `contact-activity` | `read` | — | ключ API или кабинет | What a client did: bot start, lead, orders, consents, channel access |
| GET | `/v1/stats/objects` | `stats-objects` | `read` | — | ключ API или кабинет | The business's objects with their numbers for a period |
| GET | `/v1/stats/objects/{kind}/{id}` | `stats-object` | `read` | — | ключ API или кабинет | The statistics of one store, course, channel or bot |

## Subscriptions

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/subscriptions` | `subscription-list` | `read` | — | ключ API или кабинет | List subscriptions, newest first |
| POST | `/v1/subscriptions` | `subscription-create` | `write` | можно | ключ API или кабинет | Start or renew a subscription: returns the subscription and the payment for its next period |
| GET | `/v1/subscriptions/{id}` | `subscription-get` | `read` | — | ключ API или кабинет | Get a subscription |
| POST | `/v1/subscriptions/{id}/cancel` | `subscription-cancel` | `write` | можно | ключ API или кабинет | Cancel a subscription at the end of its period (no refund) |

## Telegram

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/telegram/bots` | `telegram-bot-list` | `read` | — | ключ API или кабинет | List Telegram bots |
| POST | `/v1/telegram/bots` | `telegram-bot-connect` | `write` | нельзя | ключ API или кабинет | Connect a Telegram bot |
| GET | `/v1/telegram/bots/{id}` | `telegram-bot-get` | `read` | — | ключ API или кабинет | Get a Telegram bot |
| DELETE | `/v1/telegram/bots/{id}` | `telegram-bot-disconnect` | `write` | можно | ключ API или кабинет | Disconnect a Telegram bot |
| POST | `/v1/telegram/bots/{id}/channel-session` | `telegram-bot-channel-session` | `write` | можно | ключ API или кабинет | Start a short connect session for adding the bot to a channel |
| GET | `/v1/telegram/bots/{id}/channels` | `telegram-channel-list` | `read` | — | ключ API или кабинет | List a bot's channels |
| POST | `/v1/telegram/bots/{id}/channels` | `telegram-channel-add` | `write` | можно | ключ API или кабинет | Add a channel the bot grants access to |
| DELETE | `/v1/telegram/channels/{id}` | `telegram-channel-remove` | `write` | можно | ключ API или кабинет | Remove a channel |
| POST | `/v1/telegram/channels/{id}/check` | `telegram-channel-check` | `write` | можно | ключ API или кабинет | Check the bot's rights in a channel again |
| POST | `/v1/telegram/channels/{id}/confirm` | `telegram-channel-confirm` | `write` | можно | ключ API или кабинет | Confirm a pending channel: the merchant recognises it and wants to use it |
| POST | `/v1/telegram/channels/{id}/reject` | `telegram-channel-reject` | `write` | можно | ключ API или кабинет | Reject a pending channel: discard it and make the bot leave the chat |

## Templates

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/deployments` | `deployments-list` | `read` | — | ключ API или кабинет | List the merchant's deployments, most recently changed first |
| GET | `/v1/deployments/{template}/{subject}/stats` | `deployment-stats` | `read` | — | ключ API или кабинет | Payments and figures of one page |
| GET | `/v1/slugs/check` | `slug-check` | `read` | — | ключ API или кабинет | Is an address free for a public page? |
| GET | `/v1/templates` | `template-list` | `read` | — | ключ API или кабинет | List the templates that can be deployed |
| POST | `/v1/templates/access_channel/deploy` | `template-access-channel-deploy` | `write` | нельзя | ключ API или кабинет | Deploy the access_channel template: one plan, one closed channel, the messages around them |
| GET | `/v1/templates/{id}` | `template-get` | `read` | — | ключ API или кабинет | Describe a template: configuration schema, UI schema and deploy plan |
| POST | `/v1/templates/{id}/deployments` | `template-deployment-create` | `write` | нельзя | ключ API или кабинет | Deploy a template: create a deployment |
| POST | `/v1/templates/{id}/deployments/{subject}/archive` | `template-deployment-archive` | `write` | нельзя | ключ API или кабинет | Archive a deployment for good |
| POST | `/v1/templates/{id}/deployments/{subject}/deploy` | `template-deployment-deploy` | `write` | нельзя | ключ API или кабинет | Deploy a new configuration of an existing deployment |
| POST | `/v1/templates/{id}/deployments/{subject}/preview/rotate` | `template-deployment-preview-rotate` | `write` | нельзя | ключ API или кабинет | Replace a deployment's preview token |
| POST | `/v1/templates/{id}/deployments/{subject}/publish` | `template-deployment-publish` | `write` | нельзя | ключ API или кабинет | Publish a draft or paused deployment |
| POST | `/v1/templates/{id}/deployments/{subject}/rollback` | `template-deployment-rollback` | `write` | нельзя | ключ API или кабинет | Roll a deployment back to an earlier configuration version |
| POST | `/v1/templates/{id}/deployments/{subject}/unpublish` | `template-deployment-unpublish` | `write` | нельзя | ключ API или кабинет | Take a deployment's page down (pause) |
| GET | `/v1/templates/{id}/deployments/{subject}/versions` | `template-deployment-versions` | `read` | — | ключ API или кабинет | List the configuration versions of a deployment, oldest first |

## Uploads

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/public/files/{id}` | `public-file` | — | — | без авторизации | A ready uploaded file: a redirect to storage |
| POST | `/v1/uploads` | `upload-create` | `write` | нельзя | ключ API или кабинет | Request an upload: a presigned PUT for one image or document |
| GET | `/v1/uploads/{id}` | `upload-get` | `read` | — | ключ API или кабинет | Get an upload |
| POST | `/v1/uploads/{id}/confirm` | `upload-confirm` | `write` | можно | ключ API или кабинет | Confirm an upload once the file is in storage |

## Webhooks

| Метод | Путь | operationId | Права | Idempotency-Key | Авторизация | Что делает |
| --- | --- | --- | --- | --- | --- | --- |
| GET | `/v1/webhooks` | `webhook-list` | `read` | — | ключ API или кабинет | List webhook endpoints |
| POST | `/v1/webhooks` | `webhook-create` | `write` | нельзя | ключ API или кабинет | Register a webhook endpoint |
| POST | `/v1/webhooks/deliveries/{id}/replay` | `webhook-delivery-replay` | `write` | обязателен | ключ API или кабинет | Send a delivery again |
| GET | `/v1/webhooks/{id}` | `webhook-get` | `read` | — | ключ API или кабинет | Get a webhook endpoint |
| PATCH | `/v1/webhooks/{id}` | `webhook-update` | `write` | можно | ключ API или кабинет | Change a webhook endpoint's URL, event filter, description or active flag |
| DELETE | `/v1/webhooks/{id}` | `webhook-delete` | `write` | можно | ключ API или кабинет | Delete a webhook endpoint and its delivery log |
| GET | `/v1/webhooks/{id}/deliveries` | `webhook-deliveries` | `read` | — | ключ API или кабинет | List an endpoint's deliveries, newest first |
| POST | `/v1/webhooks/{id}/rotate-secret` | `webhook-rotate-secret` | `write` | нельзя | ключ API или кабинет | Replace the signing secret |
| POST | `/v1/webhooks/{id}/test` | `webhook-test` | `write` | обязателен | ключ API или кабинет | Send a test event now |
