{"openapi":"3.1.0","info":{"title":"ProForms API","version":"1.0.0","description":"API ProForms для сторонніх сервісів: ботів, CRM, Make/n8n і власних скриптів школи.\n\n**Авторизація.** Є три різні способи, і кожен шлях каже, який у нього:\n\n- *Ключ агента* — заголовок `Authorization: Bearer pf_…`. Видається в профілі ProForms. Ним працюють контакти, інструменти (`/api/v1/tools/…`) і `/mcp`.\n- *Ключ в адресі* — 32 символи в самому шляху (`/api/funnel-event/{key}`). Уміє лише записати подію чи оплату.\n- *Без ключа* — шляхи віджета форми: форму впізнають за її токеном.\n\n**Помилки.** Форма помилки в різних шляхів різна, вона описана в кожному окремо. Шляхи `/api/…` відповідають\n`{\"ok\": false, \"error\": \"<код>\", \"message\": \"<текст>\"}`; код сталий і годиться для перевірки в коді, текст — для людини.\n\n**Інструменти.** Розділи «Інструменти: …» — це все, що вміє AI-агент ProForms, звичайними запитами:\n`POST /api/v1/tools/<назва>` з аргументами в тілі. Відповідь — `{\"ok\": true, \"result\": {…}}`. Зміни потребують ключа\nз правом «Читання й зміни»; остаточно видалити через API не можна нічого.\n\n**Гроші** передаються рядками (`\"990.00\"`), час — ISO 8601."},"servers":[{"url":"https://app.proonline.com.ua"}],"tags":[{"name":"Контакти","description":"Пошук людей і картка людини. Ключ агента, лише читання."},{"name":"Події воронки","description":"Сторонній сервіс (бот у SendPulse, CRM, Make) повідомляє про подію чи оплату. Адресу з ключем видає екран «Воронки → Події»."},{"name":"CRM","description":"Сторонній сервіс кладе людину угодою у воронку продажів. Адреса з ключем — у налаштуваннях воронки, рядок «Вхідний вебхук»."},{"name":"Боти","description":"Зовнішня подія запускає ланцюжок бота з тригером «Зовнішня подія»."},{"name":"Віджет форми","description":"Те, чим користується скрипт форми (w.js) на сайті школи. Відкрито з будь-якого домену."},{"name":"AI-агент","description":"MCP-сервер для Claude Code і Claude Desktop."},{"name":"Вебхуки","description":"Запити, які ProForms сам надсилає на адресу школи: інтеграція «Вебхук», прив'язана до форми чи посилання на оплату."},{"name":"Службове"},{"name":"Інструменти: Проєкти й загальне"},{"name":"Інструменти: Форми й стилі"},{"name":"Інструменти: Оплати"},{"name":"Інструменти: Статистика"},{"name":"Інструменти: Транзакції"},{"name":"Інструменти: Заявки"},{"name":"Інструменти: Контакти"},{"name":"Інструменти: Інтеграції й платіжки"},{"name":"Інструменти: Чат-боти й чати"},{"name":"Інструменти: Вебінари"},{"name":"Інструменти: Сайти"},{"name":"Інструменти: Файли"},{"name":"Інструменти: Борди"},{"name":"Інструменти: Фоторедактор"},{"name":"Інструменти: Презентації"},{"name":"Інструменти: Студія"},{"name":"Інструменти: Реклама"},{"name":"Інструменти: База знань"},{"name":"Інструменти: Воронки"},{"name":"Інструменти: CRM: угоди й воронки продажів"}],"paths":{"/api/v1/contacts":{"get":{"tags":["Контакти"],"operationId":"contactsList","summary":"Пошук і список контактів","description":"Люди, а не окремі заявки: заявки й оплати однієї людини зібрані в одну картку. Найновіші за активністю зверху, по 50 на сторінку.\n\n`q` шукає одразу за всім: ім'я й пошта — частковим збігом; телефон — за цифрами, у будь-якому написанні (від п'яти цифр); Telegram ID, нік чи id людини в боті (Telegram, Instagram, Facebook, TikTok) — цілком. Додаткові пошти й телефони людини теж перевіряються.\n\nЗлиті дублікати в список не потрапляють.","security":[{"ApiKey":[]}],"parameters":[{"name":"project","in":"query","schema":{"type":"string"},"description":"Слаг проєкту (школи). Для ключа, прив'язаного до одного проєкту, можна не вказувати. Якщо ключ бачить кілька проєктів, без нього буде 422.","example":"my-school"},{"name":"q","in":"query","schema":{"type":"string","maxLength":200},"description":"Пошуковий рядок.","example":"380671234567"},{"name":"tag","in":"query","schema":{"type":"string","maxLength":40},"description":"Точна назва тегу."},{"name":"source","in":"query","schema":{"type":"string","maxLength":80},"description":"utm_source першого контакту, точно."},{"name":"kind","in":"query","schema":{"type":"string","enum":["clients","leads","review"]},"description":"clients — хоч раз платили; leads — ще ні; review — можливі дублікати."},{"name":"period","in":"query","schema":{"type":"string","enum":["7","30","all"],"default":"all"},"description":"За останньою активністю: 7 чи 30 останніх днів або весь час."},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000,"default":1},"description":"Сторінка, з 1."}],"responses":{"200":{"description":"Контакти під фільтром.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactList"}}}},"404":{"description":"Проєкту з таким слагом немає.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"not_found","message":"Проєкту «x» немає."}}}},"422":{"description":"Значення поза переліком (kind, period) або не вказано project, а ключ бачить кілька проєктів.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"invalid","message":"«kind» має бути одним із: clients, leads, review."}}}},"401":{"description":"Ключа немає або він недійсний.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"unauthorized","message":"invalid or missing API key"}}}},"403":{"description":"Ключ не має доступу: інший проєкт, розділ «Контакти» власникові ключа не відкрили, або запит прийшов із браузера (заголовок Origin).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"forbidden","message":"Цей ключ дає доступ лише до проєкту «Школа» (my-school)."}}}},"429":{"description":"Понад 120 викликів на хвилину на ключ (спільно з /mcp). Заголовок Retry-After каже, скільки чекати.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"rate_limited","message":"rate limit: 120 calls per minute"}}}}}}},"/api/v1/contacts/{id}":{"get":{"tags":["Контакти"],"operationId":"contactGet","summary":"Картка контакту","description":"Людина з усією історією: заявки, оплати, покупки із залишком до сплати, чати в ботах, відвідані вебінари й зміни самої картки (останні 50).","security":[{"ApiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"id контакту зі списку."},{"name":"project","in":"query","schema":{"type":"string"},"description":"Слаг проєкту (школи). Для ключа, прив'язаного до одного проєкту, можна не вказувати. Якщо ключ бачить кілька проєктів, без нього буде 422.","example":"my-school"}],"responses":{"200":{"description":"Картка контакту.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCard"}}}},"404":{"description":"Контакту в цьому проєкті немає. Якщо його злито з іншим — у відповіді є merged_into: id картки, у якій він тепер.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError"},{"type":"object","properties":{"merged_into":{"type":"integer"}}}]},"example":{"ok":false,"error":"not_found","message":"Контакт злито з #128 — відкрийте його.","merged_into":128}}}},"422":{"description":"Не вказано project, а ключ бачить кілька проєктів.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"invalid","message":"Вкажіть project — слаг проєкту. Доступні: school-a, school-b."}}}},"401":{"description":"Ключа немає або він недійсний.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"unauthorized","message":"invalid or missing API key"}}}},"403":{"description":"Ключ не має доступу: інший проєкт, розділ «Контакти» власникові ключа не відкрили, або запит прийшов із браузера (заголовок Origin).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"forbidden","message":"Цей ключ дає доступ лише до проєкту «Школа» (my-school)."}}}},"429":{"description":"Понад 120 викликів на хвилину на ключ (спільно з /mcp). Заголовок Retry-After каже, скільки чекати.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"rate_limited","message":"rate limit: 120 calls per minute"}}}}}}},"/api/funnel-event/{key}":{"post":{"tags":["Події воронки"],"operationId":"funnelEvent","summary":"Зарахувати подію воронки","description":"«З людиною X сталося Y»: крок воронки «Своя подія» зараховується. Подію заводять на екрані «Воронки → Події», там само береться адреса з ключем.\n\nЛюдину впізнаємо за `lead` (номер заявки, найточніше), далі `contact`, `telegram_id`, `phone`, `email`. Нових людей виклик не заводить, доки в тілі немає `\"create\": true`: з ним невідома людина стає контактом за `telegram_id`, `phone` чи `email`.\n\n**Повтори.** Із заголовком `Idempotency-Key` (або полем `idempotency_key`) той самий запит ніколи не стане другою подією. Без нього та сама подія тієї самої людини протягом 5 хвилин рахується один раз. У відповіді `duplicate: true`.\n\nТіло — JSON або form-encoded.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{32}$"},"description":"Ключ з адреси."},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":80},"description":"Ключ повтору: запит із тим самим значенням не створить другу подію."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelEvent"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/FunnelEvent"}}}},"responses":{"200":{"description":"Подію записано (або знайдено записану раніше).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelEventResult"}}}},"422":{"description":"Подію чи людину не розібрано. Коди: `event_required`, `event_unknown`, `event_disabled`, `person_required`, `person_not_found`, `bad_at`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"person_not_found","message":"Людину не впізнано: такої заявки, Telegram ID, телефону чи пошти в проєкті немає, а create не передано."}}}},"400":{"description":"Тіло порожнє або не розібралось.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"bad_body","message":"Тіло запиту — JSON або form-encoded з полями event і lead."}}}},"404":{"description":"Невідомий ключ адреси.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"unknown_key","message":"Невідомий ключ адреси."}}}},"429":{"description":"Понад 600 запитів на хвилину на проєкт або забагато спроб із невідомим ключем.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"rate_limited","message":"Забагато запитів. Спробуйте за хвилину."}}}}}}},"/api/funnel-payment/{key}":{"post":{"tags":["Події воронки"],"operationId":"funnelPayment","summary":"Повідомити про оплату, що пройшла в іншому сервісі","description":"Гроші прийняла не сторінка оплати ProForms, а, наприклад, кнопка оплати в боті SendPulse. Оплата стає звичайною транзакцією: потрапляє у воронку, «Статистику» й продукти.\n\nКлюч той самий, що й у `/api/funnel-event/{key}`.\n\n`paylink` каже, що саме купили (посилання може бути вимкнене); сума береться із запиту. Оплату без упізнаної людини теж записуємо.\n\n**Повтори.** Запит із тим самим `order_ref` не стане другою оплатою; відмова й подальший успіх з одним `order_ref` лягають в одну історію.\n\nТіло — JSON або form-encoded.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{32}$"},"description":"Ключ з адреси."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelPayment"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/FunnelPayment"}}}},"responses":{"200":{"description":"Оплату записано (або вона вже була).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelPaymentResult"}}}},"409":{"description":"Такий order_ref уже належить іншому замовленню.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"order_ref_taken","message":"Такий order_ref уже належить іншому замовленню."}}}},"422":{"description":"Коди: `bad_status`, `order_ref_required`, `paylink_unknown`, `bad_amount`, `bad_currency`, `bad_at`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"paylink_unknown","message":"paylink — слаг або id посилання на оплату цього проєкту: воно каже, що саме купили."}}}},"400":{"description":"Тіло порожнє або не розібралось.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"bad_body","message":"Тіло запиту — JSON або form-encoded з полями event і lead."}}}},"404":{"description":"Невідомий ключ адреси.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"unknown_key","message":"Невідомий ключ адреси."}}}},"429":{"description":"Понад 600 запитів на хвилину на проєкт або забагато спроб із невідомим ключем.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"rate_limited","message":"Забагато запитів. Спробуйте за хвилину."}}}}}}},"/api/crm-hook/{key}":{"post":{"tags":["CRM"],"operationId":"crmHook","summary":"Покласти людину угодою у воронку","description":"Бот у SendPulse чи інший сервіс кладе людину угодою у воронку, якій належить ключ (наприклад, за три дні до кінця підписки).\n\nЛюдину знаходимо за `lead`, `telegram_id`, `phone`, `email`; немає такої — заводимо. Без жодного з них запит відхиляється.\n\n**Повтори.** У людини одна відкрита угода у воронці: повторний запит не заводить другої, а лише дописує порожні поля. Нова угода — коли попередню закрито.\n\nПідходить і рідний вебхук SendPulse (`[{contact: {telegram_id, name, variables}}]`): змінні з ключем чи назвою поля угоди лягають у ці поля.\n\nТіло — JSON або form-encoded.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{32}$"},"description":"Ключ з адреси."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmHook"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CrmHook"}}}},"responses":{"200":{"description":"Угоду створено або дописано у відкриту.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmHookResult"}}}},"422":{"description":"Коди: `person_required` — немає за чим знайти людину; `not_created` — воронка не прийняла угоду.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"person_required","message":"Передайте telegram_id, phone, email або lead — за ними знаходимо людину."}}}},"400":{"description":"Тіло порожнє або не розібралось.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"bad_body","message":"Тіло запиту — JSON або form-encoded з полями event і lead."}}}},"404":{"description":"Невідомий ключ адреси.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"unknown_key","message":"Невідомий ключ адреси."}}}},"429":{"description":"Понад 600 запитів на хвилину на проєкт або забагато спроб із невідомим ключем.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"rate_limited","message":"Забагато запитів. Спробуйте за хвилину."}}}}}}},"/api/bot-event/{key}":{"post":{"tags":["Боти"],"operationId":"botEvent","summary":"Запустити ланцюжок бота зовнішньою подією","description":"CRM, сайт чи Make кажуть «з підписником X сталося Y», і ланцюжки з тригером «Зовнішня подія» з назвою Y запускаються, отримавши `vars` у змінні.\n\nАдреса з ключем — у редакторі ланцюжка; ключ свій у кожного бота.\n\nПідписника впізнаємо за `subscriber_id`, інакше `telegram_id`, інакше `phone` чи `email` контакту. Тіло — JSON або form-encoded.\n\nПомилка тут має простішу форму, ніж в інших `/api/…`: `{\"ok\": false, \"error\": \"<текст>\"}`.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{32}$"},"description":"Ключ з адреси."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotEvent"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/BotEvent"}}}},"responses":{"200":{"description":"Скільки ланцюжків запущено і в скількох підписників.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotEventResult"}}}},"404":{"description":"Невідомий ключ або підписника не знайдено.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlainError"},"example":{"ok":false,"error":"subscriber not found: pass telegram_id, subscriber_id, phone or email"}}}},"422":{"description":"Не передано event.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlainError"},"example":{"ok":false,"error":"event is required"}}}}}}},"/cfg":{"get":{"tags":["Віджет форми"],"operationId":"formConfig","summary":"Конфіг форми для показу","description":"Блоки, поля й оформлення форми. Кешується на 60 секунд; із заголовком `If-None-Match` повертає 304 без тіла.","parameters":[{"name":"w","in":"query","required":true,"schema":{"type":"string","pattern":"^w[0-9a-f]{12}$"},"description":"Токен форми з коду вставки.","example":"w0a1b2c3d4e5f"},{"name":"p","in":"query","schema":{"type":"string","pattern":"^[a-z0-9_\\-]{0,24}$"},"description":"Код розміщення (кнопка, попап). Без нього — форма без розміщення."}],"responses":{"200":{"description":"Конфіг форми.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormConfig"}}}},"304":{"description":"Не змінилось від часу ETag."},"404":{"description":"Форми з таким токеном немає.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlainError"},"example":{"ok":false,"error":"not found"}}}},"410":{"description":"Форму вимкнено.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlainError"},"example":{"ok":false,"error":"gone"}}}}}}},"/key":{"get":{"tags":["Віджет форми"],"operationId":"submitKey","summary":"Ключ відправки","description":"Підписаний ключ, який форма додає до заявки (поле `k` у `/submit`). Діє дві години, не одноразовий. Існування форми тут не перевіряється.","parameters":[{"name":"w","in":"query","required":true,"schema":{"type":"string","pattern":"^w[0-9a-f]{12}$"},"description":"Токен форми з коду вставки.","example":"w0a1b2c3d4e5f"},{"name":"p","in":"query","schema":{"type":"string","pattern":"^[a-z0-9_\\-]{0,24}$"},"description":"Код розміщення (кнопка, попап). Той самий, що буде в /submit."}],"responses":{"200":{"description":"Ключ і час, до якого він діє.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitKey"}}}},"400":{"description":"Токен чи код розміщення не того формату.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlainError"},"example":{"ok":false,"error":"bad request"}}}}}}},"/submit":{"post":{"tags":["Віджет форми"],"operationId":"formSubmit","summary":"Надіслати заявку","description":"Зберігає заявку й ставить у чергу доставки в інтеграції. Якщо форма веде на оплату, у відповіді `redirect_url` — адреса сторінки оплати.\n\n**Ключ відправки.** Сервер перевіряє `k` у режимі, заданому налаштуванням `SUBMIT_KEY_MODE`: `log` (типово) — заявка без ключа приймається й лише позначається; `enforce` — 403 із заголовком `X-PF-Key`. Надсилайте `k` завжди.\n\n**Повтори.** Той самий набір полів протягом 15 секунд (подвійний клік) повертає ту саму відповідь, другої заявки не буде.\n\nЛіміт — 300 заявок на годину з однієї адреси.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Submit"}}}},"responses":{"200":{"description":"Заявку прийнято.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitResult"}}}},"403":{"description":"Ключ відправки відсутній, чужий або прострочений (лише в режимі enforce). Заголовок X-PF-Key називає причину: missing, malformed, bad_sig, expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldErrors"},"example":{"ok":false,"errors":{"_":"Термін дії форми вичерпано. Оновіть сторінку і спробуйте ще раз."}}}}},"410":{"description":"Форми немає або її вимкнено.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldErrors"},"example":{"ok":false,"errors":{"_":"Форма більше не приймає заявки."}}}}},"422":{"description":"Помилки полів: ключ — ключ поля форми.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldErrors"},"example":{"ok":false,"errors":{"phone":"Вкажіть номер телефону."}}}}},"429":{"description":"Забагато заявок з однієї адреси.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldErrors"},"example":{"ok":false,"errors":{"_":"Схоже, з вашої мережі вже надіслали багато заявок. Спробуйте за кілька хвилин."}}}}}}}},"/event":{"post":{"tags":["Віджет форми"],"operationId":"formEvent","summary":"Показ або відкриття форми","description":"Лічильник для статистики форми. Завжди відповідає 204, навіть на невідому форму.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormEvent"}}}},"responses":{"204":{"description":"Прийнято."}}}},"/mcp":{"post":{"tags":["AI-агент"],"operationId":"mcp","summary":"MCP-сервер (JSON-RPC 2.0)","description":"Вхід для AI-агента за протоколом MCP (Streamable HTTP без стану). Методи: `initialize`, `ping`, `tools/list`, `tools/call`. Пакети повідомлень і потік подій (GET) не підтримуються.\n\nПідключення в Claude Code: `claude mcp add --transport http proforms <адреса>/mcp --header \"Authorization: Bearer pf_…\"`.\n\nСхему аргументів кожного інструмента віддає `tools/list`. Інструменти з позначкою «зміни» потребують ключа з правом «Читання й зміни». Остаточно видалити агент не може нічого.\n\nЗапит із заголовком `Origin` відхиляється, тому кнопка «Try it out» на цій сторінці для `/mcp` не спрацює: користуйтеся curl чи агентом.\n\n**Інструменти (250):**\n- **Проєкти й загальне:** `projects_list`, `project_create` (зміни)\n- **Форми й стилі:** `forms_list`, `form_get`, `form_schema`, `folders_list`, `styles_list`, `form_create` (зміни), `form_update` (зміни), `form_set_active` (зміни), `form_duplicate` (зміни), `form_archive` (зміни), `form_restore` (зміни), `folder_create` (зміни), `folder_rename` (зміни), `folder_move` (зміни)\n- **Оплати:** `products_list`, `product_save` (зміни), `product_tariff_save` (зміни), `paylink_role_set` (зміни), `paylinks_list`, `paylink_get`, `merchants_list`, `paylink_create` (зміни), `paylink_update` (зміни), `paylink_set_active` (зміни), `paylink_duplicate` (зміни), `paylink_sales_debts`, `paylink_sale_update` (зміни), `transaction_pay_kind_set` (зміни)\n- **Статистика:** `stats`, `report`, `plans_list`, `plan_save` (зміни), `dashboard_schema`, `dashboard_sources`, `dashboards_list`, `dashboard_get`, `dashboard_create` (зміни), `dashboard_update` (зміни), `dashboard_metric_save` (зміни), `dashboard_widget_save` (зміни), `dashboard_layout` (зміни), `dashboard_values_set` (зміни), `dashboard_share` (зміни), `dashboard_archive` (зміни)\n- **Транзакції:** `report_buyers`, `transactions_list`, `transaction_get`\n- **Заявки:** `leads_list`, `lead_get`\n- **Контакти:** `contacts_list`, `contact_get`, `contact_alt` (зміни), `contact_fields_list`, `contact_field_save` (зміни), `contact_update` (зміни), `calls_list`, `calls_report`, `call_get`, `call_start` (зміни), `call_outcome_set` (зміни)\n- **Інтеграції й платіжки:** `integrations_list`, `integration_social`, `integration_get`, `vars_list`, `integration_create` (зміни), `integration_update` (зміни), `integration_set_active` (зміни), `integration_duplicate` (зміни), `telegram_chats`, `telegram_test` (зміни), `sheets_probe`, `deliveries_list`, `delivery_retry` (зміни)\n- **Чат-боти й чати:** `bots_list`, `bot_replies_list`, `bot_reply_save` (зміни), `bot_flows_list`, `bot_vars_list`, `bot_var_upsert` (зміни), `bot_flow_schema`, `bot_flow_get`, `bot_flow_validate`, `bot_flow_create` (зміни), `bot_flow_update` (зміни), `bot_flow_patch` (зміни), `bot_flow_publish` (зміни), `bot_webinars_list`, `bot_webinar_upsert` (зміни), `bot_subscribers_import` (зміни), `bot_subscribers_find`, `bot_subscriber_runs`, `bot_run_stop` (зміни), `bot_broadcasts_list`, `bot_broadcast_create` (зміни), `bot_broadcast_update` (зміни), `bot_broadcast_test` (зміни), `bot_broadcast_launch` (зміни), `bot_broadcast_control` (зміни), `bot_broadcast_stats`\n- **Вебінари:** `webinars`, `webinar_session`, `webinar_visitors`, `webinar_visitor`, `webinar_comments`, `webinar_report_get`, `webinar_report_update` (зміни)\n- **Сайти:** `sites_list`, `site_schema`, `site_get`, `site_page_get`, `site_media_list`, `site_media_from_library` (зміни), `site_create` (зміни), `site_page_create` (зміни), `site_page_update` (зміни), `site_globals_update` (зміни), `site_settings_update` (зміни), `site_stats`, `site_check`, `site_publish` (зміни), `site_speed`, `site_fx_list`, `site_fx_get`, `site_fx_create` (зміни), `site_fx_update` (зміни), `site_fx_set_active` (зміни), `site_speed_check` (зміни), `cms_collections_list`, `cms_collection_create` (зміни), `cms_items_list`, `cms_item_create` (зміни), `cms_item_update` (зміни)\n- **Файли:** `media_list`, `media_folders`, `media_get`, `media_import_url` (зміни), `media_upload` (зміни), `media_update` (зміни)\n- **Борди:** `boards_list`, `board_get`, `board_duplicate` (зміни), `board_items_copy` (зміни), `board_create` (зміни), `board_items_add` (зміни), `board_items_update` (зміни), `board_mindmap_from_outline` (зміни), `board_flowchart` (зміни)\n- **Фоторедактор:** `photo_designs_list`, `photo_design_get`, `photo_templates_list`, `photo_design_from_template` (зміни), `photo_design_create` (зміни), `photo_design_update` (зміни), `photo_brand_get`, `photo_cutout` (зміни), `photo_job_get`\n- **Презентації:** `decks_list`, `deck_get`, `deck_layouts_list`, `deck_assets_search`, `deck_create` (зміни), `deck_from_outline` (зміни), `deck_slide_add` (зміни), `deck_slide_update` (зміни), `deck_theme_set` (зміни)\n- **Студія:** `studios_list`, `studio_broadcasts`, `studio_schema`, `studio_get`, `studio_scene_create` (зміни), `studio_scene_update` (зміни), `studio_update` (зміни), `studio_scene_copy` (зміни), `studio_templates_list`, `studio_template_save` (зміни)\n- **Реклама:** `ads_overview`, `ads_campaigns`, `ads_creatives`, `ads_creative_get`, `ads_draft_create` (зміни), `ads_link_options`, `ads_pause` (зміни)\n- **База знань:** `kb_overview`, `kb_search`, `kb_list`, `kb_read`, `kb_create` (зміни), `kb_append` (зміни), `kb_patch` (зміни), `kb_import` (зміни), `kb_type_get`, `kb_refs_find`, `kb_query`, `kb_tasks`, `kb_task_done` (зміни), `kb_capture` (зміни), `kb_share` (зміни), `kb_merge` (зміни), `kb_supersede` (зміни), `kb_sources_list`, `kb_source_read`, `kb_source_add` (зміни), `kb_type_create` (зміни), `kb_type_update` (зміни)\n- **Воронки:** `funnels_list`, `funnel_get`, `funnel_stats`, `funnel_step_from`, `funnel_runs`, `funnel_run`, `funnel_run_data_set` (зміни), `funnel_step_mark` (зміни), `funnel_step_unmark` (зміни), `funnel_events`, `funnel_systems_list`, `funnel_system_stats`, `funnel_journey`, `funnel_system_save` (зміни), `funnel_spend_save` (зміни), `funnel_reports_list`, `funnel_report_save` (зміни), `funnel_export_run` (зміни), `funnel_create` (зміни), `funnel_update` (зміни), `funnel_set_active` (зміни), `funnel_merge` (зміни), `funnel_event_create` (зміни), `funnel_event_update` (зміни)\n- **CRM: угоди й воронки продажів:** `crm_report`, `crm_pipelines_list`, `crm_deals_list`, `crm_deal_get`, `crm_deal_create` (зміни), `crm_deal_update` (зміни), `crm_deal_move` (зміни), `crm_deal_note` (зміни), `crm_task_add` (зміни), `crm_task_update` (зміни), `crm_pipeline_create` (зміни), `crm_stages_save` (зміни), `crm_field_save` (зміни), `crm_fields_order` (зміни), `crm_pipeline_settings` (зміни), `crm_rules_list`, `crm_rules_save` (зміни), `crm_views_list`, `crm_view_save` (зміни), `crm_marks_save` (зміни)","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"},"examples":{"tools/list":{"value":{"jsonrpc":"2.0","id":1,"method":"tools/list"}},"tools/call":{"value":{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"contacts_list","arguments":{"project":"my-school","q":"380671234567"}}}}}}}},"responses":{"200":{"description":"Відповідь JSON-RPC. Відмова інструмента — це теж 200: результат із `isError: true` і текстом, що виправити.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}}}},"202":{"description":"Сповіщення (запит без id) прийнято, тіла немає."},"400":{"description":"Тіло не JSON: помилка JSON-RPC -32700."},"401":{"description":"Ключа немає або він недійсний.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}},"example":{"error":"invalid or missing API key"}}}},"403":{"description":"Запит із браузера (заголовок Origin).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}},"example":{"error":"browser requests are not allowed"}}}},"405":{"description":"Не POST.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}},"example":{"error":"method not allowed"}}}},"429":{"description":"Понад 120 викликів на хвилину на ключ.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}},"example":{"error":"rate limit: 120 calls per minute"}}}}}}},"/health":{"get":{"tags":["Службове"],"operationId":"health","summary":"Стан системи","description":"Перевіряє базу даних. Redis необов'язковий і статус не змінює.","responses":{"200":{"description":"Усе працює.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"503":{"description":"База недоступна.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/api/v1/tools/projects_list":{"post":{"tags":["Інструменти: Проєкти й загальне"],"operationId":"tool_projects_list","summary":"Проєкти","description":"Список проєктів (шкіл), доступних цьому ключу. Слаг звідси передається як project у всі інші інструменти.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","description":"Слаг — його передають як project."},"name":{"type":"string"},"archived":{"type":"boolean"}},"required":["slug","name","archived"]}}},"required":["projects"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/forms_list":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_forms_list","summary":"Форми","description":"Форми проєкту з лічильниками за весь час: покази, заявки, оплати. Без archived — лише робочі; archived=true — лише архів.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"folder":{"type":["integer","string"],"description":"id папки з folders_list."},"archived":{"type":"boolean","description":"Показати архів замість робочих."},"q":{"description":"Пошук за назвою чи слагом.","type":"string"}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"forms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"archived":{"type":"boolean"},"folder":{"oneOf":[{"type":"string","description":"Назва папки."},{"type":"null"}]},"placements_active":{"type":"integer","description":"Скільки розміщень увімкнено."},"modes":{"type":"array","items":{"type":"string"},"description":"Режими розміщень: inline, popup, click, float."},"views":{"type":"integer","description":"Покази за весь час."},"leads":{"type":"integer","description":"Заявки за весь час."},"paid":{"type":"integer","description":"Оплати за весь час."},"page_url":{"type":"string","description":"Адреса окремої сторінки форми."},"updated_at":{"type":"string","description":"Час."},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","slug","name","active","archived","folder","placements_active","modes","views","leads","paid","page_url","updated_at"]}}},"required":["forms"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/form_get":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_form_get","summary":"Форма","description":"Форма цілком: блоки й поля (config), дизайн, дії після відправки й інтеграції (actions), розміщення з готовим кодом вставки на сайт (placements[].embed) і адреса окремої сторінки.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"form":{"type":"string","description":"Слаг або id форми."}},"required":["form"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"archived":{"type":"boolean"},"folder":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","name"]},{"type":"null"}]},"style_id":{"oneOf":[{"type":"integer","description":"Спільний стиль зі styles_list."},{"type":"null"}]},"page_url":{"type":"string"},"config":{"type":"object","additionalProperties":true,"description":"Блоки, поля й дизайн. Формат — у form_schema."},"actions":{"type":"object","additionalProperties":true,"description":"Що форма робить після відправки: подяка, оплата, інтеграції."},"placements":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"title":{"type":"string"},"mode":{"type":"string"},"config":{"type":"object","additionalProperties":true},"active":{"type":"boolean"},"click_class":{"type":"string","description":"Клас для своєї кнопки на сайті."},"embed":{"type":"string","description":"Готовий код вставки; порожній, якщо розміщення вимкнено."}},"required":["code","title","mode","config","active","click_class","embed"]}},"updated_at":{"type":"string","description":"Час."},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","slug","name","active","archived","folder","style_id","page_url","config","actions","placements","updated_at"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/form_schema":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_form_schema","summary":"Схема форми","description":"Довідник: з яких блоків складається форма, які бувають поля, ключі дизайну, дії після відправки й режими розміщення. Брати перед тим, як читати чи складати config форми.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/folders_list":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_folders_list","summary":"Папки","description":"Папки проєкту: kind=form — для форм, pay — посилань на оплату, photo — креативів, deck — презентацій, board — бордів.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"kind":{"type":"string","enum":["form","pay","photo","deck","board"]}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"folders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","description":"form або pay."},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","name","kind"]}}},"required":["folders"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/styles_list":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_styles_list","summary":"Стилі","description":"Спільні стилі форм проєкту: дизайн, який форма успадковує через style_id.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/products_list":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_products_list","summary":"Продукти","description":"Продукти проєкту: назва, тарифи (tariffs: назва й повна ціна) і посилання на оплату. У кожного посилання — tariff_id і kind (full повна, booking бронь, part частина, rest доплата, upgrade перехід на тариф); порожні — посилання ще не розкладене, і залишку за ним не видно. У звітах продукт стоїть одним рядком, а кілька оплат однієї людини за нього — один продаж. unassigned — посилання без продукту: у звітах кожне окремим рядком.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"archived":{"type":"boolean","description":"Показати й архівні."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/product_save":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_product_save","summary":"Створити або змінити продукт (зміни)","description":"Без id — новий продукт; з id — часткова правка. paylinks — id посилань на оплату, список ЦІЛКОМ: посилання, якого в ньому немає, з продукту виходить. Посилання належить лише одному продукту. archive: true прибирає продукт в архів (не видаляє) — його посилання у звітах знову окремо.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]},"name":{"type":"string"},"paylinks":{"type":"array","items":{"type":"integer"}},"archive":{"type":"boolean"}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/product_tariff_save":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_product_tariff_save","summary":"Створити або змінити тариф продукту (зміни)","description":"Тариф — повна ціна продукту («Стандарт» 10000, «VIP» 15000): від неї рахується, скільки людина ще має доплатити після броні чи часткової оплати. Без id — новий тариф продукту product; з id — часткова правка. price — рядком («10000.00»), currency — UAH, USD або EUR. Зміна ціни одразу перераховує залишки в продажах, де ціну не задано вручну. archive: true прибирає тариф в архів: його посилання лишаються в продукті без тарифу й виду оплати.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"product":{"type":["integer","string"],"description":"id продукту"},"id":{"type":["integer","string"]},"name":{"type":"string"},"price":{"type":"string"},"currency":{"type":"string","enum":["UAH","USD","EUR"]},"archive":{"type":"boolean"}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/paylink_role_set":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_paylink_role_set","summary":"Що це за оплата: тариф і вид (зміни)","description":"Каже, чим є посилання на оплату paylink: до якого продукту й тарифу належить і який це вид оплати. kind: full — повна оплата тарифу, booking — бронювання, part — частина, rest — доплата залишку (через нього ж іде особисте посилання «сплатити залишок»), upgrade — перехід на цей тариф з іншого. tariff і kind задаються разом. Без product — посилання стає саме по собі. Суму це не міняє: вона лишається в ціні посилання. Зміна одразу перераховує продажі продукту, зокрема за минулими оплатами.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"paylink":{"type":["integer","string"]},"product":{"type":["integer","string"]},"tariff":{"type":["integer","string"]},"kind":{"type":"string","enum":["full","booking","part","rest","upgrade"]}},"required":["paylink"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/paylinks_list":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_paylinks_list","summary":"Посилання на оплату","description":"Посилання на оплату проєкту: ціна, валюта, платіжка, публічна адреса й оплати за 30 днів (у базовій валюті мерчанта; paid_currency = null, якщо валют кілька).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"folder":{"type":["integer","string"],"description":"id папки посилань на оплату (kind=pay)."},"merchant":{"type":["integer","string"],"description":"id платіжки."},"q":{"description":"Пошук за назвою чи слагом.","type":"string"}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"paylinks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"price":{"type":"string","description":"Ціна.","example":"990.00"},"currency":{"type":"string"},"active":{"type":"boolean"},"merchant":{"type":"string","description":"Назва платіжки."},"pay_url":{"type":"string","description":"Публічна адреса оплати."},"paid_30d":{"type":"integer","description":"Оплат за 30 днів."},"paid_sum_30d":{"type":"string","description":"Сума оплат за 30 днів у базовій валюті.","example":"990.00"},"paid_currency":{"oneOf":[{"type":"string","description":"null — валют кілька, суму складати не можна."},{"type":"null"}]},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","slug","name","price","currency","active","merchant","pay_url","paid_30d","paid_sum_30d","paid_currency"]}}},"required":["paylinks"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/paylink_get":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_paylink_get","summary":"Посилання на оплату","description":"Одне посилання цілком: ціна, платіжка, адреси після оплати, інтеграції й форми, що ведуть на нього.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"paylink":{"type":"string","description":"Слаг або id посилання."}},"required":["paylink"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"price":{"type":"string","description":"Ціна.","example":"990.00"},"currency":{"type":"string"},"active":{"type":"boolean"},"merchant":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","title"]},"folder":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","name"]},{"type":"null"}]},"pay_url":{"type":"string"},"success_url":{"type":"string","description":"Куди вести після оплати."},"declined_url":{"type":"string","description":"Куди вести після відмови."},"integrations":{"type":"object","additionalProperties":true,"description":"Прив'язані інтеграції."},"used_by_forms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","slug","name","active"]},"description":"Форми, що ведуть на це посилання."},"updated_at":{"type":"string","description":"Час."},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","slug","name","price","currency","active","merchant","folder","pay_url","success_url","declined_url","integrations","used_by_forms","updated_at"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/merchants_list":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_merchants_list","summary":"Платіжки","description":"Платіжки WayForPay проєкту: назва, акаунт, чи за замовчуванням і чи збережено ключ. Ключів і секретів тут немає й не буде — підключають їх лише в адмінці.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/stats":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_stats","summary":"Статистика","description":"Воронка показ → відкриття → заявка → оплата за період, виручка (нетто, мінус повернення, у базовій валюті), кількість «заповнили, але не заплатили», топ-20 джерел за utm_source. Якщо вказано form — ще й розбивка по розміщеннях форми. Без form — увесь проєкт.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"form":{"type":"string","description":"Слаг або id форми; без нього — усі форми."},"period":{"type":"string","enum":["7","30","all"],"description":"Період: 7 чи 30 останніх днів або весь час. За замовчуванням 30."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"period":{"type":"string","description":"7, 30 або all."},"form_id":{"oneOf":[{"type":"integer"},{"type":"null"}]},"funnel":{"type":"array","items":{"type":"object","properties":{"step":{"type":"string","description":"Крок: показ, відкриття, заявка, оплата."},"n":{"type":"integer"},"pct_of_prev":{"oneOf":[{"type":"number","description":"Частка від попереднього кроку, %."},{"type":"null"}]}},"required":["step","n","pct_of_prev"]}},"revenue_net":{"type":"string","description":"Виручка нетто в базовій валюті.","example":"990.00"},"unpaid_leads":{"type":"integer","description":"Заповнили, але не заплатили."},"sources":{"type":"array","items":{"type":"object","properties":{"utm_source":{"type":"string"},"leads":{"type":"integer"},"paid":{"type":"integer"},"conversion_pct":{"oneOf":[{"type":"number"},{"type":"null"}]},"revenue_net":{"type":"string","description":"Сума рядком.","example":"990.00"}},"required":["utm_source","leads","paid","conversion_pct","revenue_net"]},"description":"Топ-20 джерел за utm_source."},"placements":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"title":{"type":"string"},"mode":{"type":"string"},"active":{"type":"boolean"},"views":{"type":"integer"},"opens":{"type":"integer"},"leads":{"type":"integer"},"conversion_from_view_pct":{"oneOf":[{"type":"number"},{"type":"null"}]}},"required":["code","title","mode","active","views","opens","leads","conversion_from_view_pct"]},"description":"Розбивка по розміщеннях; заповнена, лише коли вказано form."}},"required":["period","form_id","funnel","revenue_net","unpaid_leads","sources","placements"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/report":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_report","summary":"Зведений звіт школи","description":"Звіт керівника по проєкту за період: виручка (нетто, за датою платежу — з оплатами без заявки й повторними), витрати (Meta + ручні), маржа, середній чек, чек на покупця, ліди, конверсія, ціна ліда й продажу; когорта людей, що вперше з'явились у періоді: ROMI1 / LTV1 — їхні перші оплати, ROMI2 / LTV2 — усі оплати дотепер; LTV за весь час. Плюс розкладки на вибір: daily, funnels, products, traffic (джерело → кампанія), traffic_daily, ladder (сходинки продуктів), cohorts, ltv_products (LTV покупця кожного продукту, за весь час), time_to_buy (від входу у воронку до першої оплати: медіана, середнє й розподіл по воронках). repeat_buyers — купили два й більше ПРОДУКТІВ (бронь і доплата — одна покупка); repeat_payers — платили двічі й більше. Гроші — у базовій валюті; mixed = true означає, що платили в різних валютах і суми складати не можна.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"period":{"type":"string","enum":["today","yesterday","7","30","90","month","prev","all"],"description":"Період: сьогодні, вчора, дні, цей місяць (month), минулий (prev), увесь час. Типово 30."},"from":{"type":"string","description":"Свої дати: початок, РРРР-ММ-ДД (разом із to)."},"to":{"type":"string","description":"Свої дати: кінець включно, РРРР-ММ-ДД."},"plan":{"type":["integer","string"],"description":"id запуску (плану): звіт у його межах — дати запуску, гроші лише за його продуктами, ліди й витрати — його воронок. outside — оплати за ті самі дні поза запуском. ladder і cohorts лишаються по всій школі."},"parts":{"type":"array","items":{"type":"string","enum":["daily","funnels","products","traffic","traffic_daily","ladder","cohorts","ltv_products","time_to_buy"]},"description":"Які розкладки додати. Без них — лише зведення."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/report_buyers":{"post":{"tags":["Інструменти: Транзакції"],"operationId":"tool_report_buyers","summary":"Хто купив","description":"Список людей за числом зі зведеного звіту школи: хто саме купив. who: all — усі покупці з контактом; repeat — купили два й більше продуктів; ltv:<продукт> — купили продукт (за весь час); more:<продукт> — купили його і ще щось; first:<продукт> / second:<продукт> / third:<продукт> — почали з продукту в періоді / і купили другий / третій; cohort:<РРРР-ММ> — перша оплата цього місяця; product:<продукт> — платили за продукт у періоді (тут є й оплати без контакту); funnel:<id> — зайшли у воронку в періоді й заплатили. <продукт> — id рядка з products, ladder чи ltv_products («p12» або «l34»). У рядку: людина, контакти, продукти з датами й сумами, усі оплати разом, to_buy_s — секунд від входу у воронку до першої оплати.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"who":{"type":"string","description":"Який список: all, repeat, ltv:p12, first:l34, cohort:2026-09, funnel:1 …"},"period":{"type":"string","enum":["today","yesterday","7","30","90","month","prev","all"],"description":"Період для first / second / third / product / funnel. Типово — увесь час."},"from":{"type":"string","description":"Свої дати: початок, РРРР-ММ-ДД (разом із to)."},"to":{"type":"string","description":"Свої дати: кінець включно, РРРР-ММ-ДД."},"limit":{"type":"integer","minimum":1,"maximum":500,"description":"Скільки рядків, типово 100."}},"required":["who"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/plans_list":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_plans_list","summary":"Плани й факт","description":"Плани й запуски з фактом на сьогодні: для кожної цілі (revenue, sales, leads) — факт, відсоток, залишок, pace (де мали б бути сьогодні за рівномірного руху), ahead і forecast (куди прийдемо тим самим темпом). План без products і funnels — уся школа. Запуск: гроші — за його products, ліди — за входами в його funnels; outside — оплати за ті самі дні поза запуском (постійні продукти).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"funnel":{"type":["integer","string"],"description":"Лише запуски, куди входить ця воронка. Без параметра — усі."},"archived":{"type":"boolean","description":"Показати й архівні."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/plan_save":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_plan_save","summary":"Створити або змінити план (зміни)","description":"План або запуск на довільний період. Без id — новий; з id — часткова правка. Хоч одна ціль обовʼязкова: revenue (виручка в гривні), units (продано продуктів: людина × продукт, бронь і доплата — один продаж), sales (кількість оплат, тобто платежів), leads. У відповіді: sold — продано, з них оплачено повністю й чекають доплати; expected — доплати, яких ще чекаємо за продажами плану (у валюті expected_currency), expected_base — вони ж у гривні за курсом уже отриманих оплат; potential — виручка, якщо всі доплатять. Запуск — план із products і/або funnels: гроші рахуються лише за його продуктами (усі оплати за них у ці дні), ліди — за входами в його воронки; решта оплат за ті самі дні — outside («поза запуском»). Без них — план усієї школи. archive: true прибирає в архів (не видаляє).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]},"name":{"type":"string","description":"Назва: «Запуск жовтень»."},"from":{"type":"string","description":"РРРР-ММ-ДД"},"to":{"type":"string","description":"РРРР-ММ-ДД включно"},"funnel":{"type":["integer","string"],"description":"Скорочення для однієї воронки запуску."},"funnels":{"type":"array","items":{"type":["integer","string"]},"description":"id воронок запуску, список цілком: ліди — входи в них."},"products":{"type":"array","items":{"type":["integer","string"]},"description":"id продуктів запуску, список цілком: виручка й продажі — лише за них."},"revenue":{"type":"string","description":"Ціль виручки, гривня: «250000.00»."},"units":{"type":"integer","description":"Ціль у проданих продуктах."},"sales":{"type":"integer","description":"Ціль у кількості оплат (платежів)."},"leads":{"type":"integer"},"archive":{"type":"boolean"}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/leads_list":{"post":{"tags":["Інструменти: Заявки"],"operationId":"tool_leads_list","summary":"Заявки","description":"Заявки проєкту, найновіші зверху, по 50 на сторінку, з підсумками під тим самим фільтром. status: paid — оплачені, unpaid — заповнили й не заплатили, refunded — з поверненням, stuck — доставка в інтеграцію не вдалася. q шукає по значеннях полів і id заявки.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"form":{"type":"string","description":"Слаг або id форми."},"period":{"type":"string","enum":["7","30","all"],"description":"Період: 7 чи 30 останніх днів або весь час. За замовчуванням 30."},"status":{"type":"string","enum":["paid","unpaid","refunded","stuck"]},"source":{"type":"string","description":"Точне значення utm_source."},"q":{"type":"string","description":"Пошуковий рядок."},"page":{"type":["integer","string"],"minimum":1,"description":"Сторінка, з 1."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"summary":{"type":"object","properties":{"total":{"type":"integer"},"paid":{"type":"integer"},"refunded":{"type":"integer"},"revenue_net":{"type":"string","description":"Виручка нетто під цим фільтром.","example":"990.00"}},"required":["total","paid","refunded","revenue_net"]},"page":{"type":"integer"},"has_more":{"type":"boolean","description":"Чи є наступна сторінка."},"leads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Номер заявки: L_…"},"created_at":{"type":"string","description":"Час."},"form":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"]},"placement":{"oneOf":[{"type":"string","description":"Назва розміщення."},{"type":"null"}]},"fields":{"type":"object","additionalProperties":true,"description":"Значення полів: ключ поля → значення."},"utm":{"type":"object","additionalProperties":true,"description":"Мітки."},"page":{"type":"string","description":"Сторінка з формою."},"paid_at":{"oneOf":[{"type":"string","description":"Час."},{"type":"null"}]},"paid_amount":{"oneOf":[{"type":"string","description":"Сума рядком.","example":"990.00"},{"type":"null"}]},"refunded_at":{"oneOf":[{"type":"string","description":"Час."},{"type":"null"}]},"order_ref":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact_id":{"oneOf":[{"type":"integer"},{"type":"null"}]},"failed_deliveries":{"type":"integer","description":"Скільки доставок в інтеграції не вдалося."},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","created_at","form","placement","fields","utm","page","paid_at","paid_amount","refunded_at","order_ref","contact_id","failed_deliveries"]}}},"required":["summary","page","has_more","leads"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/lead_get":{"post":{"tags":["Інструменти: Заявки"],"operationId":"tool_lead_get","summary":"Заявка","description":"Одна заявка: усі поля, мітки, оплата й історія доставок в інтеграції.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":"string","description":"id заявки виду L_…"}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"id":{"type":"string","description":"Номер заявки: L_…"},"created_at":{"type":"string","description":"Час."},"form":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"]},"placement":{"oneOf":[{"type":"string","description":"Назва розміщення."},{"type":"null"}]},"fields":{"type":"object","additionalProperties":true,"description":"Значення полів: ключ поля → значення."},"utm":{"type":"object","additionalProperties":true,"description":"Мітки."},"page":{"type":"string","description":"Сторінка з формою."},"paid_at":{"oneOf":[{"type":"string","description":"Час."},{"type":"null"}]},"paid_amount":{"oneOf":[{"type":"string","description":"Сума рядком.","example":"990.00"},{"type":"null"}]},"refunded_at":{"oneOf":[{"type":"string","description":"Час."},{"type":"null"}]},"order_ref":{"oneOf":[{"type":"string"},{"type":"null"}]},"contact_id":{"oneOf":[{"type":"integer"},{"type":"null"}]},"failed_deliveries":{"type":"integer","description":"Скільки доставок в інтеграції не вдалося."},"order":{"oneOf":[{"type":"object","properties":{"order_ref":{"type":"string"},"status":{"type":"string"},"amount":{"type":"string","description":"Сума рядком.","example":"990.00"},"currency":{"type":"string"},"product":{"type":"string"},"paid_at":{"oneOf":[{"type":"string","description":"Час."},{"type":"null"}]}},"required":["order_ref","status","amount","currency","product","paid_at"]},{"type":"null"}]},"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"integration_id":{"oneOf":[{"type":"integer"},{"type":"null"}]},"kind":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer"},"delivered_at":{"oneOf":[{"type":"string","description":"Час."},{"type":"null"}]},"next_at":{"oneOf":[{"type":"string","description":"Коли наступна спроба."},{"type":"null"}]},"last_error":{"type":"string"},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","integration_id","kind","status","attempts","delivered_at","next_at","last_error"]},"description":"Доставки в інтеграції."},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","created_at","form","placement","fields","utm","page","paid_at","paid_amount","refunded_at","order_ref","contact_id","failed_deliveries","order","deliveries"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/transactions_list":{"post":{"tags":["Інструменти: Транзакції"],"operationId":"tool_transactions_list","summary":"Транзакції","description":"Оплати, повернення й відхилені спроби — кожна окремим рядком, найновіші зверху, з підсумками (нетто в базовій валюті мерчанта; currency = null, якщо валют кілька). Повернення відʼємні.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"merchant":{"type":["integer","string"],"description":"id платіжки."},"paylink":{"type":["integer","string"],"description":"id посилання на оплату."},"period":{"type":"string","enum":["7","30","all"],"description":"Період: 7 чи 30 останніх днів або весь час. За замовчуванням 30."},"kind":{"type":"string","enum":["payment","pending","refund","declined","expired"]},"pay_kind":{"type":"string","enum":["full","booking","part","rest","upgrade","none"],"description":"Вид оплати: full — повна, booking — бронь, part — частина, rest — доплата, upgrade — перехід на тариф, none — без виду."},"q":{"description":"Пошук: номер замовлення, маска картки, клієнт, продукт, id заявки.","type":"string"},"page":{"type":["integer","string"],"minimum":1,"description":"Сторінка, з 1."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"summary":{"type":"object","properties":{"net":{"type":"string","description":"Нетто в базовій валюті.","example":"990.00"},"paid":{"type":"string","description":"Сума рядком.","example":"990.00"},"refunded":{"type":"string","description":"Сума рядком.","example":"990.00"},"currency":{"oneOf":[{"type":"string","description":"null — валют кілька."},{"type":"null"}]},"payments":{"type":"integer"},"refunds":{"type":"integer"},"declined":{"type":"integer"}},"required":["net","paid","refunded","currency","payments","refunds","declined"]},"page":{"type":"integer"},"has_more":{"type":"boolean"},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"at":{"type":"string","description":"Час."},"kind":{"type":"string","enum":["payment","pending","refund","declined","expired"]},"amount":{"type":"string","description":"Повернення — відʼємне.","example":"990.00"},"currency":{"type":"string"},"base_amount":{"oneOf":[{"type":"string","description":"У базовій валюті мерчанта.","example":"990.00"},{"type":"null"}]},"base_currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"fee":{"oneOf":[{"type":"string","description":"Комісія.","example":"990.00"},{"type":"null"}]},"order_ref":{"type":"string"},"product":{"type":"string"},"paylink":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","name"]},"merchant":{"type":"string","description":"Назва платіжки."},"lead_id":{"oneOf":[{"type":"string","description":"Номер заявки."},{"type":"null"}]},"client":{"type":"object","additionalProperties":true,"description":"Дані людини із заявки."},"utm":{"type":"object","additionalProperties":true,"description":"Мітки."},"card_pan":{"oneOf":[{"type":"string","description":"Маска картки."},{"type":"null"}]},"wfp_status":{"type":"string"},"reason":{"type":"string"},"source":{"type":"string","description":"wfp — наша сторінка оплати; api — оплата пройшла в іншому сервісі."},"pay_kind":{"oneOf":[{"type":"string","description":"Вид оплати: full, booking, part, rest, upgrade; null — без позначки."},{"type":"null"}]},"tariff":{"oneOf":[{"type":"string","description":"Тариф продукту."},{"type":"null"}]},"sale_id":{"oneOf":[{"type":"integer","description":"Продаж, до якого належить оплата."},{"type":"null"}]},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","at","kind","amount","currency","base_amount","base_currency","fee","order_ref","product","paylink","merchant","lead_id","client","utm","card_pan","wfp_status","reason","source","pay_kind","tariff","sale_id"]}}},"required":["summary","page","has_more","transactions"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/transaction_get":{"post":{"tags":["Інструменти: Транзакції"],"operationId":"tool_transaction_get","summary":"Транзакція","description":"Одна транзакція з замовленням, посиланням, заявкою й усією історією цього замовлення. Для зовнішньої оплати (source = api) external — усе, що прислав сервіс: номер у ньому, Telegram, деталі замовлення.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id транзакції."}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"id":{"type":"string"},"at":{"type":"string","description":"Час."},"kind":{"type":"string","enum":["payment","pending","refund","declined","expired"]},"amount":{"type":"string","description":"Повернення — відʼємне.","example":"990.00"},"currency":{"type":"string"},"base_amount":{"oneOf":[{"type":"string","description":"У базовій валюті мерчанта.","example":"990.00"},{"type":"null"}]},"base_currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"fee":{"oneOf":[{"type":"string","description":"Комісія.","example":"990.00"},{"type":"null"}]},"order_ref":{"type":"string"},"product":{"type":"string"},"paylink":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","name"]},"merchant":{"type":"string","description":"Назва платіжки."},"lead_id":{"oneOf":[{"type":"string","description":"Номер заявки."},{"type":"null"}]},"client":{"type":"object","additionalProperties":true,"description":"Дані людини із заявки."},"utm":{"type":"object","additionalProperties":true,"description":"Мітки."},"card_pan":{"oneOf":[{"type":"string","description":"Маска картки."},{"type":"null"}]},"wfp_status":{"type":"string"},"reason":{"type":"string"},"source":{"type":"string","description":"wfp — наша сторінка оплати; api — оплата пройшла в іншому сервісі."},"pay_kind":{"oneOf":[{"type":"string","description":"Вид оплати: full, booking, part, rest, upgrade; null — без позначки."},{"type":"null"}]},"tariff":{"oneOf":[{"type":"string","description":"Тариф продукту."},{"type":"null"}]},"sale_id":{"oneOf":[{"type":"integer","description":"Продаж, до якого належить оплата."},{"type":"null"}]},"order_status":{"type":"string"},"order_amount":{"type":"string","description":"Сума рядком.","example":"990.00"},"refunded_amount":{"type":"string","description":"Сума рядком.","example":"990.00"},"telegram_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"external":{"oneOf":[{"type":"object","additionalProperties":true,"description":"Для зовнішньої оплати — усе, що прислав сервіс."},{"type":"null"}]},"form":{"oneOf":[{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"]},{"type":"null"}]},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"at":{"type":"string","description":"Час."},"kind":{"type":"string"},"amount":{"type":"string","description":"Сума рядком.","example":"990.00"},"currency":{"type":"string"},"wfp_status":{"type":"string"},"reason":{"type":"string"},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","at","kind","amount","currency","wfp_status","reason"]},"description":"Уся історія цього замовлення."},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","at","kind","amount","currency","base_amount","base_currency","fee","order_ref","product","paylink","merchant","lead_id","client","utm","card_pan","wfp_status","reason","source","pay_kind","tariff","sale_id","order_status","order_amount","refunded_amount","telegram_id","external","form","history"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/contacts_list":{"post":{"tags":["Інструменти: Контакти"],"operationId":"tool_contacts_list","summary":"Контакти","description":"Люди, а не окремі заявки: заявки й оплати однієї людини зібрані в одну картку. kind: clients — хоч раз платили, leads — ще ні, review — можливі дублікати. q шукає імʼя, пошту, телефон.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"q":{"type":"string","description":"Пошуковий рядок."},"tag":{"type":"string"},"source":{"type":"string","description":"utm_source першого контакту."},"kind":{"type":"string","enum":["clients","leads","review"]},"period":{"description":"За останньою активністю. За замовчуванням — весь час.","type":"string","enum":["7","30","all"]},"page":{"type":["integer","string"],"minimum":1,"description":"Сторінка, з 1."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"summary":{"type":"object","properties":{"total":{"type":"integer","description":"Усього контактів у проєкті."},"clients":{"type":"integer","description":"З них хоч раз платили."},"sum":{"type":"string","description":"Сплачено всіма.","example":"990.00"},"fresh":{"type":"integer","description":"Нових за 30 днів."},"review":{"type":"integer","description":"Можливих дублікатів."}},"required":["total","clients","sum","fresh","review"],"description":"Лічильники всього проєкту, не під фільтром."},"page":{"type":"integer"},"has_more":{"type":"boolean","description":"Чи є наступна сторінка."},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"alt_phones":{"type":"array","items":{"type":"string"},"description":"Інші телефони тієї самої людини: з оплати, з другої заявки."},"alt_emails":{"type":"array","items":{"type":"string"},"description":"Інші пошти тієї самої людини."},"telegram_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"alt_telegram_ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"vars":{"type":"object","additionalProperties":true,"description":"Змінні контакту."},"leads_count":{"type":"integer","description":"Скільки заявок."},"paid_count":{"type":"integer","description":"Скільки оплат."},"paid_total":{"type":"string","description":"Сплачено всього.","example":"990.00"},"first_seen_at":{"type":"string","description":"Перша активність."},"last_seen_at":{"type":"string","description":"Остання активність."},"first_utm":{"type":"object","additionalProperties":true,"description":"Мітки першого контакту."},"last_utm":{"type":"object","additionalProperties":true,"description":"Мітки останнього контакту."},"possible_duplicate_of":{"oneOf":[{"type":"integer","description":"id контакту, з яким цей, можливо, одна людина."},{"type":"null"}]},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","name","phone","email","alt_phones","alt_emails","telegram_id","alt_telegram_ids","tags","vars","leads_count","paid_count","paid_total","first_seen_at","last_seen_at","first_utm","last_utm","possible_duplicate_of"]}}},"required":["summary","page","has_more","contacts"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/contact_get":{"post":{"tags":["Інструменти: Контакти"],"operationId":"tool_contact_get","summary":"Контакт","description":"Картка людини з історією: усі її заявки й оплати, а також chats — чати з нею в ботах (Telegram, Instagram, Facebook, TikTok).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"alt_phones":{"type":"array","items":{"type":"string"},"description":"Інші телефони тієї самої людини: з оплати, з другої заявки."},"alt_emails":{"type":"array","items":{"type":"string"},"description":"Інші пошти тієї самої людини."},"telegram_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"alt_telegram_ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"vars":{"type":"object","additionalProperties":true,"description":"Змінні контакту."},"leads_count":{"type":"integer","description":"Скільки заявок."},"paid_count":{"type":"integer","description":"Скільки оплат."},"paid_total":{"type":"string","description":"Сплачено всього.","example":"990.00"},"first_seen_at":{"type":"string","description":"Перша активність."},"last_seen_at":{"type":"string","description":"Остання активність."},"first_utm":{"type":"object","additionalProperties":true,"description":"Мітки першого контакту."},"last_utm":{"type":"object","additionalProperties":true,"description":"Мітки останнього контакту."},"possible_duplicate_of":{"oneOf":[{"type":"integer","description":"id контакту, з яким цей, можливо, одна людина."},{"type":"null"}]},"sales":{"type":"array","items":{"type":"object","additionalProperties":true,"description":"Покупка: продукт, тариф, скільки сплачено й скільки лишилось (left). status: booked, partial, paid, cancelled, refunded, unpriced. rest_url — особисте посилання на доплату."}},"chats":{"type":"array","items":{"type":"object","properties":{"subscriber_id":{"type":"string"},"bot_id":{"type":"string"},"bot":{"type":"string","description":"Назва бота."},"channel":{"type":"string","description":"Мережа: telegram, instagram, facebook, tiktok."},"username":{"oneOf":[{"type":"string"},{"type":"null"}]},"user_id":{"type":"string","description":"id людини саме в цьому боті."},"status":{"type":"string"},"last_at":{"oneOf":[{"type":"string","description":"Час."},{"type":"null"}]}},"required":["subscriber_id","bot_id","bot","channel","username","user_id","status","last_at"]},"description":"У яких ботах і мережах є чат із людиною."},"history":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","description":"Час."},"what":{"type":"string","description":"Що змінилось, текстом."},"kind":{"type":"string"},"by":{"type":"string","description":"Хто змінив."}},"required":["at","what","kind","by"]},"description":"Зміни картки, найновіші 50."},"leads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Номер заявки."},"created_at":{"type":"string","description":"Час."},"form":{"type":"string","description":"Назва форми."},"paid_at":{"oneOf":[{"type":"string","description":"Час."},{"type":"null"}]},"utm":{"type":"object","additionalProperties":true,"description":"Мітки заявки."},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","created_at","form","paid_at","utm"]}},"orders":{"type":"array","items":{"type":"object","properties":{"order_ref":{"type":"string"},"created_at":{"type":"string","description":"Час."},"paid_at":{"oneOf":[{"type":"string","description":"Час."},{"type":"null"}]},"product":{"type":"string"},"amount":{"type":"string","description":"Сума рядком.","example":"990.00"},"currency":{"type":"string"},"status":{"type":"string"},"net":{"type":"string","description":"Нетто в базовій валюті мерчанта.","example":"990.00"},"base_currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"lead":{"oneOf":[{"type":"string","description":"Номер заявки, з якої прийшла оплата."},{"type":"null"}]},"form":{"oneOf":[{"type":"string"},{"type":"null"}]},"placement":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["order_ref","created_at","paid_at","product","amount","currency","status","net","base_currency","lead","form","placement"]}},"webinars":{"type":"array","items":{"type":"object","properties":{"session_id":{"type":"string"},"visitor_id":{"type":"string"},"webinar":{"type":"string"},"date_start":{"type":"string","description":"Час."},"watched_min":{"type":"integer"},"watched_pct":{"type":"integer"},"entries":{"type":"integer"},"comments":{"type":"integer"},"clicked":{"type":"boolean"},"engagement":{"type":"number"},"matched_by":{"type":"string","description":"phone або lead."}},"required":["session_id","visitor_id","webinar","date_start","watched_min","watched_pct","entries","comments","clicked","engagement","matched_by"]}},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","name","phone","email","alt_phones","alt_emails","telegram_id","alt_telegram_ids","tags","vars","leads_count","paid_count","paid_total","first_seen_at","last_seen_at","first_utm","last_utm","possible_duplicate_of","sales","chats","history","leads","orders","webinars"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/integrations_list":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_integrations_list","summary":"Інтеграції","description":"Підключення проєкту за видами: contacts (база контактів), crm (угоди у воронках продажів — є, коли в проєкті є воронка; у прив'язці вказують pipeline і stage), webhook, telegram, sheets (Google Таблиці), capi (Meta Conversions API). ready=false означає, що бракує ключа чи бота — така інтеграція нічого не доставить. id підключення вказується в actions.integrations форми чи integrations посилання.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"kind":{"type":"string","enum":["contacts","crm","webhook","telegram","sheets","capi"]}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/integration_social":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_integration_social","summary":"Соцакаунти (Zernio)","description":"Instagram, TikTok та інші соцакаунти проєкту, підключені через Zernio: мережа, @нік, чи живий доступ, чи можна на акаунті завести бота (bot=true — мережа з особистими повідомленнями) і чи бот уже є (bot_id). connected=false — Zernio до проєкту не підключено: ключ вставляється лише в адмінці, «Інтеграції → Zernio». webhook=false — вхідні повідомлення до ProForms не доходять.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/integration_get":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_integration_get","summary":"Інтеграція","description":"Одне підключення з налаштуваннями.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/vars_list":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_vars_list","summary":"Змінні для інтеграцій","description":"Довідник для привʼязки інтеграції у формі (actions.integrations) чи в посиланні на оплату (integrations): які змінні є в події, як вони називаються й групуються, які формати колонки таблиці до них застосовні і які ключі має привʼязка кожного виду. event=lead — заявка з форми (з form — ще її справжні поля), event=order — оплата, повернення, відмова. У тексті Telegram і тілі вебхука змінну пишуть як {{var}}; у колонці таблиці — map: [{col, var, fmt}].\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"event":{"type":"string","enum":["lead","order"]},"form":{"type":"string","description":"Слаг або id форми — лише для event=lead."}},"required":["event"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/project_create":{"post":{"tags":["Інструменти: Проєкти й загальне"],"operationId":"tool_project_create","summary":"Створити проєкт (зміни)","description":"Новий проєкт (школа). Слаг складається з назви й більше не змінюється — його повертає відповідь, це значення параметра project. Проєкт порожній: база контактів є одразу, а платіжку WayForPay та інтеграції підключає людина в адмінці (admin_url). Ключу, прив'язаному до одного проєкту, недоступно.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Назва проєкту, до 80 символів. Унікальна."}},"required":["name"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/form_create":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_form_create","summary":"Створити форму (зміни)","description":"Нова форма. Без config створюється стандартна: заголовок, імʼя, телефон, кнопка, одне попап-розміщення, база контактів увімкнена. Можна одразу передати config/actions/placements — тоді форма створиться вже з ними, а якщо в них помилка, не створиться зовсім. Форма одразу ввімкнена. Повертає форму цілком із кодом вставки.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"name":{"type":"string","description":"Назва форми (до 120 символів), видно лише в адмінці."},"slug":{"type":"string","description":"Адреса окремої сторінки /f/<slug>. Порожній — з назви."},"folder":{"type":["integer","string"],"description":"id папки форм (вид form); 0 — без папки."},"style_id":{"type":["integer","string"],"description":"id стилю; 0 — без стилю."},"config":{"type":"object","description":"Зміст і вигляд: {blocks: [...], design: {...}}. Замінюється ПО КЛЮЧАХ: передали лише design — блоки лишаються як були; передали blocks — список блоків замінюється цілком."},"actions":{"type":"object","description":"Що після відправки й куди слати заявку: after, thankyou_text, redirect, payment, telegram, integrations. Одразу в бота: {after:\"telegram\", telegram:{bot_id, flow_id, button}}. Замінюється по ключах, як config. Оплата: {after:\"payment\", payment:{paylink:\"<слаг>\", map:{<key поля>:\"client_name\"|\"client_phone\"|\"client_email\"}}}. integrations — [{kind, id, …}], id — інтеграція проєкту; ключі залежать від виду інтеграції."},"placements":{"type":"array","items":{"type":"object"},"description":"Розміщення ЦІЛИМ списком: [{code?, title, mode, config}]. Елемент із code змінює наявне розміщення; без code створюється нове. Розміщення, яких немає в списку, вимикаються (код на сайті перестане показувати форму). Без цього поля розміщення не змінюються."}},"required":["name"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/form_update":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_form_update","summary":"Змінити форму (зміни)","description":"Змінити форму: змінюються лише передані поля, решта береться з поточної форми. Невалідне не зберігається: повернеться список помилок, форма лишиться як була. Кеш форми на сайтах скидається одразу.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"form":{"type":"string","description":"Слаг або id форми."},"name":{"type":"string","description":"Назва форми (до 120 символів), видно лише в адмінці."},"slug":{"type":"string","description":"Адреса окремої сторінки /f/<slug>. Порожній — з назви."},"folder":{"type":["integer","string"],"description":"id папки форм (вид form); 0 — без папки."},"style_id":{"type":["integer","string"],"description":"id стилю; 0 — без стилю."},"config":{"type":"object","description":"Зміст і вигляд: {blocks: [...], design: {...}}. Замінюється ПО КЛЮЧАХ: передали лише design — блоки лишаються як були; передали blocks — список блоків замінюється цілком."},"actions":{"type":"object","description":"Що після відправки й куди слати заявку: after, thankyou_text, redirect, payment, telegram, integrations. Одразу в бота: {after:\"telegram\", telegram:{bot_id, flow_id, button}}. Замінюється по ключах, як config. Оплата: {after:\"payment\", payment:{paylink:\"<слаг>\", map:{<key поля>:\"client_name\"|\"client_phone\"|\"client_email\"}}}. integrations — [{kind, id, …}], id — інтеграція проєкту; ключі залежать від виду інтеграції."},"placements":{"type":"array","items":{"type":"object"},"description":"Розміщення ЦІЛИМ списком: [{code?, title, mode, config}]. Елемент із code змінює наявне розміщення; без code створюється нове. Розміщення, яких немає в списку, вимикаються (код на сайті перестане показувати форму). Без цього поля розміщення не змінюються."}},"required":["form"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/form_set_active":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_form_set_active","summary":"Увімкнути чи вимкнути форму (зміни)","description":"Вимкнена форма зникає з усіх сайтів (за хвилину), заявки й статистика лишаються. Архівна форма не вмикається, доки її не повернуто з архіву.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"form":{"type":"string","description":"Слаг або id форми."},"active":{"type":"boolean"}},"required":["form","active"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/form_duplicate":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_form_duplicate","summary":"Копія форми (зміни)","description":"Копія форми з усіма розміщеннями й налаштуваннями. Створюється ВИМКНЕНОЮ, з новою адресою й новим кодом вставки: старий код на сайті лишається за оригіналом.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"form":{"type":"string","description":"Слаг або id форми."}},"required":["form"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/form_archive":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_form_archive","summary":"Форму в архів (зміни)","description":"Прибирає форму зі списку й вимикає її; заявки, оплати й статистика лишаються. Форму можна повернути з архіву. Остаточне видалення — лише в адмінці.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"form":{"type":"string","description":"Слаг або id форми."}},"required":["form"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/form_restore":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_form_restore","summary":"Повернути форму з архіву (зміни)","description":"Повертає форму з архіву ВИМКНЕНОЮ — вмикається вона окремо.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"form":{"type":"string","description":"Слаг або id форми."}},"required":["form"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/folder_create":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_folder_create","summary":"Створити папку (зміни)","description":"Папка для форм (kind=form), посилань на оплату (pay), креативів (photo), презентацій (deck) або бордів (board). Назви в межах виду не повторюються.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"kind":{"type":"string","enum":["form","pay","photo","deck","board"]},"name":{"type":"string","description":"До 60 символів."}},"required":["kind","name"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/folder_rename":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_folder_rename","summary":"Перейменувати папку (зміни)","description":"Нова назва папки.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"folder":{"type":["integer","string"]},"name":{"type":"string"}},"required":["folder","name"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/folder_move":{"post":{"tags":["Інструменти: Форми й стилі"],"operationId":"tool_folder_move","summary":"Перекласти в папку (зміни)","description":"Перекласти форму (kind=form), посилання на оплату (pay), креатив (photo), презентацію (deck) чи борд (board) в папку того ж виду; folder=0 — винести з папки.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"kind":{"type":"string","enum":["form","pay","photo","deck","board"]},"item":{"type":["integer","string"],"description":"id того, що перекладаємо."},"folder":{"type":["integer","string"]}},"required":["kind","item","folder"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/paylink_create":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_paylink_create","summary":"Створити посилання на оплату (зміни)","description":"Нове посилання на оплату через WayForPay. Повертає публічну адресу оплати (pay_url) — її ставлять на кнопку чи в листі, або вказують у формі (actions.payment.paylink = slug).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"name":{"type":"string","description":"Назва продукту — її бачить покупець на сторінці оплати. До 120 символів."},"price":{"type":"string","description":"Ціна, наприклад \"990\" чи \"990.50\". Більша за нуль, до двох знаків після коми."},"currency":{"type":"string","enum":["UAH","USD","EUR"]},"merchant":{"type":["integer","string"],"description":"id платіжки з merchants_list. Без нього — платіжка проєкту за замовчуванням."},"slug":{"type":"string","description":"Слаг посилання; порожній — з назви. Форми, що ведуть на посилання, переїдуть на новий слаг самі."},"folder":{"type":["integer","string"],"description":"id папки оплат (folders_list kind=pay); 0 — без папки."},"success_url":{"type":"string","description":"Куди вести після успішної оплати (https://…). Порожньо — налаштування платіжки. В адресі можна змінні оплати: {{payment.order_ref}}, {{payment.amount}}, {{fields.client_phone}}, {{fields.client_email}}, {{fields.client_name}}, {{person.emails}}, {{utm.utm_source}} тощо — повний перелік у vars_list (event=order)."},"declined_url":{"type":"string","description":"Куди вести після невдалої оплати."},"success_target":{"type":["object","null"],"description":"Ціль замість адреси: {type: \"page\", site_id, page_id, query?} — сторінка опублікованого сайту проєкту (site_get), або {type: \"flow\", bot_id, flow_id, query?} — ланцюжок бота. query — параметри зі змінними без «?»: \"order_ref={{payment.order_ref}}&phone={{fields.client_phone}}\"; для ланцюжка вони лягають в однойменні СТВОРЕНІ змінні бота (phone і email — ще й у змінні контакту). null — прибрати ціль."},"declined_target":{"type":["object","null"],"description":"Те саме для невдалої оплати."},"integrations":{"type":"array","items":{"type":"object"},"description":"Куди слати події оплати: [{kind, id, ...}] — id з integrations_list. Замінює список цілком. Ключі кожного виду, змінні оплати (зокрема пошта й телефон з форми, з оплати й «усі») і формати колонок таблиці — у vars_list (event=order)."},"active":{"type":"boolean","description":"За замовчуванням true."}},"required":["name","price"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/paylink_update":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_paylink_update","summary":"Змінити посилання на оплату (зміни)","description":"Змінити посилання: передайте лише те, що змінюєте. Зміна ціни діє для нових оплат одразу, адреса (pay_url) лишається тією самою. Кожна зміна ціни пишеться в журнал зі старим і новим значенням.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"paylink":{"type":"string","description":"Слаг або id посилання."},"name":{"type":"string","description":"Назва продукту — її бачить покупець на сторінці оплати. До 120 символів."},"price":{"type":"string","description":"Ціна, наприклад \"990\" чи \"990.50\". Більша за нуль, до двох знаків після коми."},"currency":{"type":"string","enum":["UAH","USD","EUR"]},"merchant":{"type":["integer","string"],"description":"id платіжки з merchants_list. Без нього — платіжка проєкту за замовчуванням."},"slug":{"type":"string","description":"Слаг посилання; порожній — з назви. Форми, що ведуть на посилання, переїдуть на новий слаг самі."},"folder":{"type":["integer","string"],"description":"id папки оплат (folders_list kind=pay); 0 — без папки."},"success_url":{"type":"string","description":"Куди вести після успішної оплати (https://…). Порожньо — налаштування платіжки. В адресі можна змінні оплати: {{payment.order_ref}}, {{payment.amount}}, {{fields.client_phone}}, {{fields.client_email}}, {{fields.client_name}}, {{person.emails}}, {{utm.utm_source}} тощо — повний перелік у vars_list (event=order)."},"declined_url":{"type":"string","description":"Куди вести після невдалої оплати."},"success_target":{"type":["object","null"],"description":"Ціль замість адреси: {type: \"page\", site_id, page_id, query?} — сторінка опублікованого сайту проєкту (site_get), або {type: \"flow\", bot_id, flow_id, query?} — ланцюжок бота. query — параметри зі змінними без «?»: \"order_ref={{payment.order_ref}}&phone={{fields.client_phone}}\"; для ланцюжка вони лягають в однойменні СТВОРЕНІ змінні бота (phone і email — ще й у змінні контакту). null — прибрати ціль."},"declined_target":{"type":["object","null"],"description":"Те саме для невдалої оплати."},"integrations":{"type":"array","items":{"type":"object"},"description":"Куди слати події оплати: [{kind, id, ...}] — id з integrations_list. Замінює список цілком. Ключі кожного виду, змінні оплати (зокрема пошта й телефон з форми, з оплати й «усі») і формати колонок таблиці — у vars_list (event=order)."}},"required":["paylink"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/paylink_set_active":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_paylink_set_active","summary":"Увімкнути чи вимкнути посилання (зміни)","description":"Вимкнене посилання не приймає нових оплат; історія й адреса лишаються.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"paylink":{"type":"string","description":"Слаг або id посилання."},"active":{"type":"boolean"}},"required":["paylink","active"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/paylink_duplicate":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_paylink_duplicate","summary":"Копія посилання (зміни)","description":"Копія посилання з тією самою ціною й платіжкою, але новою адресою. Створюється ВИМКНЕНОЮ.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"paylink":{"type":"string","description":"Слаг або id посилання."}},"required":["paylink"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/integration_create":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_integration_create","summary":"Підключити інтеграцію (зміни)","description":"Нове підключення: webhook (заявки й оплати JSON-ом на вашу адресу), telegram (сповіщення в підключений чат), sheets (рядок у Google Таблицю), capi (події в Meta). Підключення доставляє лише там, де його id вказано в actions.integrations форми чи integrations посилання.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"kind":{"type":"string","enum":["webhook","telegram","sheets","capi"]},"title":{"type":"string","description":"Назва підключення, видно лише в адмінці."},"url":{"type":"string","description":"webhook: адреса приймача, лише https://."},"chat_id":{"type":"string","description":"telegram: chat_id чату, уже підключеного до проєкту."},"spreadsheet":{"type":"string","description":"sheets: посилання на Google Таблицю або її id. Таблицю треба відкрити на редагування для сервісного акаунта (його пошта — в адмінці)."},"pixel_id":{"type":"string","description":"capi: ID пікселя Meta."},"test_code":{"type":"string","description":"capi: тестовий код подій (Events Manager → Test events)."},"domain_verify":{"type":"string","description":"capi: код підтвердження домену."},"send":{"type":"string","enum":["both","pixel","capi"],"description":"capi: both — браузер і сервер, pixel — лише браузер, capi — лише сервер."},"secret":{"type":"string","description":"webhook: ключ підпису; capi: маркер доступу. Лише записується — прочитати його назад не можна. Порожньо — лишити збережений."},"active":{"type":"boolean"}},"required":["kind","title"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/integration_update":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_integration_update","summary":"Змінити інтеграцію (зміни)","description":"Змінити підключення: змінюються лише передані поля. Вид підключення не змінюється.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]},"title":{"type":"string","description":"Назва підключення, видно лише в адмінці."},"url":{"type":"string","description":"webhook: адреса приймача, лише https://."},"chat_id":{"type":"string","description":"telegram: chat_id чату, уже підключеного до проєкту."},"spreadsheet":{"type":"string","description":"sheets: посилання на Google Таблицю або її id. Таблицю треба відкрити на редагування для сервісного акаунта (його пошта — в адмінці)."},"pixel_id":{"type":"string","description":"capi: ID пікселя Meta."},"test_code":{"type":"string","description":"capi: тестовий код подій (Events Manager → Test events)."},"domain_verify":{"type":"string","description":"capi: код підтвердження домену."},"send":{"type":"string","enum":["both","pixel","capi"],"description":"capi: both — браузер і сервер, pixel — лише браузер, capi — лише сервер."},"secret":{"type":"string","description":"webhook: ключ підпису; capi: маркер доступу. Лише записується — прочитати його назад не можна. Порожньо — лишити збережений."},"active":{"type":"boolean"}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/integration_set_active":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_integration_set_active","summary":"Увімкнути чи вимкнути інтеграцію (зміни)","description":"Вимкнена інтеграція лишається прив'язаною до форм, але нічого не отримує. Це заміна видаленню: повернути — active=true.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]},"active":{"type":"boolean"}},"required":["id","active"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/integration_duplicate":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_integration_duplicate","summary":"Копія інтеграції (зміни)","description":"Копія підключення разом із ключем: те саме з однією зміненою дрібницею (інший чат, піксель, таблиця) — без повторного введення маркера.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/telegram_chats":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_telegram_chats","summary":"Чати Telegram","description":"Чати й групи, підключені до проєкту, з гілками форуму. Лише їх можна вказати в telegram-інтеграції. Новий чат підключається лише з адмінки: бота додають у групу чи в особисті (кнопка або QR-код в інтеграції Telegram).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/telegram_test":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_telegram_test","summary":"Перевірити Telegram (зміни)","description":"Надіслати пробне повідомлення «Перевірка звʼязку» в підключений чат (і гілку, якщо треба).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"chat_id":{"type":"string"},"thread_id":{"type":"integer","description":"id гілки форуму."}},"required":["chat_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/sheets_probe":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_sheets_probe","summary":"Перевірити таблицю","description":"Що бачить сервісний акаунт у Google Таблиці: аркуші й заголовок обраного. Якщо доступу немає — помилка з поясненням.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"spreadsheet":{"type":"string"},"tab":{"type":"string"}},"required":["spreadsheet"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/deliveries_list":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_deliveries_list","summary":"Доставки","description":"Останні доставки в інтеграції проєкту: куди, статус (pending, sent, failed, dead), спроби, остання помилка. failed — ще повторюватиметься сама, dead — здалась; обидві можна повторити вручну.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"integration":{"type":["integer","string"]},"status":{"type":"string","enum":["pending","sent","failed","dead"]}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/delivery_retry":{"post":{"tags":["Інструменти: Інтеграції й платіжки"],"operationId":"tool_delivery_retry","summary":"Повторити доставку (зміни)","description":"Повторити доставку зараз — наприклад, коли приймач лежав і вже піднявся. Повертає результат спроби.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"integration":{"type":["integer","string"]},"delivery":{"type":["integer","string"]}},"required":["integration","delivery"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/contact_alt":{"post":{"tags":["Інструменти: Контакти"],"operationId":"tool_contact_alt","summary":"Інша пошта, телефон чи Telegram ID контакту (зміни)","description":"Керує іншими поштами, телефонами й Telegram ID контакту (alt_emails / alt_phones / alt_telegram_ids картки контакту). action=primary — зробити значення основним: колишнє основне НЕ зникає, а стає іншим (обмін місцями). action=remove — прибрати значення зі списку інших; основне так прибрати не можна, контакт не видаляється. value можна передати в будь-якому написанні: «+38 067 111-22-33» і «Olya@Mail.com » знайдуться.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id контакту."},"kind":{"type":"string","enum":["phone","email","telegram"]},"value":{"type":"string"},"action":{"type":"string","enum":["primary","remove"]}},"required":["id","kind","value","action"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/contact_fields_list":{"post":{"tags":["Інструменти: Контакти"],"operationId":"tool_contact_fields_list","summary":"Змінні контакту","description":"Власні поля картки контакту проєкту (рівень, місто, тариф…) у порядку картки: ключ, назва, тип, варіанти списку, група, чи показується колонкою в списку. Значення в контакті — vars картки контакту. У текстах бота — {{contact.ключ}}.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/contact_field_save":{"post":{"tags":["Інструменти: Контакти"],"operationId":"tool_contact_field_save","summary":"Створити чи змінити змінну контакту (зміни)","description":"Нова змінна — без key (ключ складеться з label латиницею й більше не зміниться); наявна — з key. type — один із типів змінних (types); options — варіанти для select і multi. Передавайте лише те, що змінюєте. Видалення змінних інструмент не підтримує — це робить людина в «Контакти → Налаштування».\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"key":{"type":"string","description":"Ключ наявної змінної; без нього — нова."},"label":{"type":"string"},"type":{"type":"string","enum":["text","long","number","money","date","datetime","select","multi","check","phone","email","url"]},"options":{"type":"array","items":{"type":"string"}},"group":{"type":"string"},"hint":{"type":"string"},"in_list":{"type":"boolean","description":"Показувати колонкою в списку контактів."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/contact_update":{"post":{"tags":["Інструменти: Контакти"],"operationId":"tool_contact_update","summary":"Змінити контакт: ім'я, теги, змінні (зміни)","description":"Часткова зміна картки контакту: name; tags_add / tags_remove; vars — {ключ змінної: значення}, порожній рядок стирає. Значення перевіряються за типом змінної (дата, число, телефон, варіант списку…). Кожна зміна потрапляє в історію картки.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id контакту."},"name":{"type":"string"},"tags_add":{"type":"array","items":{"type":"string"}},"tags_remove":{"type":"array","items":{"type":"string"}},"vars":{"type":"object","additionalProperties":{"type":"string"}}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bots_list":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bots_list","summary":"Чат-боти проєкту","description":"Боти школи в Telegram, Instagram і TikTok: id, channel (мережа), @username, статус, скільки активних підписників і ланцюжків, limits — обмеження мережі (кнопок під повідомленням, довжина тексту, window_hours — скільки годин після повідомлення людини їй можна писати; 0 — без обмеження), event_url — адреса для зовнішніх подій (POST {\"event\",\"telegram_id\"|\"phone\"|\"email\",\"vars\"}).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_replies_list":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_replies_list","summary":"Шаблони відповідей","description":"Шаблони відповідей проєкту — ті, що оператор вставляє в чат через «/» і кнопкою «Шаблони» в угоді CRM: id, title, shortcut, text. У тексті змінні підписника ({{first_name}}…) і угоди: {{deal.first_name}}, {{deal.<ключ чи назва поля угоди>}} — значення поля словами, {{deal.price}}, {{deal.pay_link}} — ціна й посилання на оплату першого неоплаченого пункту угоди.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_reply_save":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_reply_save","summary":"Зберегти шаблон відповіді (зміни)","description":"Додати шаблон відповіді (без id) або змінити наявний (з id). title — до 120 символів, text — до 4000, shortcut — одне слово для «/» (необов'язково). Змінні — як в описі списку шаблонів. Нікому нічого не надсилає.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]},"title":{"type":"string"},"text":{"type":"string"},"shortcut":{"type":"string"}},"required":["title","text"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_flows_list":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_flows_list","summary":"Ланцюжки бота","description":"Ланцюжки бота: id, назва, тип (welcome — на /start, default — коли нічого не підійшло, regular — звичайний), published — чи бот його запускає, saved — чи є збережена версія, unsaved_changes — чи чернетка відрізняється від збереженої (бот її не бачить), тригери запуску, folder — папка (порожньо — без папки).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"],"description":"id бота"}},"required":["bot"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_vars_list":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_vars_list","summary":"Змінні бота","description":"Змінні, які можуть уживати блоки ланцюжків: subscriber — у кожного підписника своє значення ({{назва}}), bot — одне значення на весь бот ({{$назва}}), system — вбудовані, лише читання. Блоки працюють ЛИШЕ з цими змінними.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]}},"required":["bot"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_var_upsert":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_var_upsert","summary":"Створити або змінити змінну (зміни)","description":"Створює змінну або змінює її тип і опис. scope=subscriber — змінна підписника (значення збирають ланцюжки: «чекати відповідь», «Дія», «Запит API», ШІ-агент). scope=bot — змінна бота з одним значенням на всіх (value), напр. промокод. Назву змінити не можна (на неї посилаються ланцюжки); видалити — лише людина в адмінці.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"scope":{"type":"string","enum":["subscriber","bot"]},"name":{"type":"string","description":"літери, цифри, «_», пробіл усередині; до 64"},"type":{"type":"string","enum":["string","number","date","datetime","time","phone","email","url"]},"description":{"type":"string","description":"що в змінній — для людей у команді"},"value":{"type":"string","description":"лише для scope=bot"}},"required":["bot","scope","name"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_flow_schema":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_flow_schema","summary":"Формат ланцюжка","description":"Опис графа ланцюжка: типи блоків, їхні поля, виходи (порти) і обмеження мереж (channels). За цим форматом складається graph ланцюжка й розсилки.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_flow_get":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_flow_get","summary":"Ланцюжок: граф","description":"Граф ланцюжка (nodes, edges) — чернетка або опублікована версія — і зауваження перевірки. rev — версія чернетки, захищає її від перезапису. uid блоку — його ID для людини (як id бота чи ланцюжка): називайте блоки людині саме ним; id — внутрішній ключ для стрілок (edges).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"flow":{"type":["integer","string"]},"version":{"type":"string","enum":["draft","published"],"description":"за замовчуванням draft"}},"required":["bot","flow"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_flow_validate":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_flow_validate","summary":"Перевірити граф","description":"Перевіряє граф ланцюжка так само, як кнопки «Зберегти» й «Опублікувати» в редакторі: error — не опублікується, warn — ймовірний недогляд. Нічого не зберігає.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"graph":{"type":"object"}},"required":["bot","graph"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_flow_create":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_flow_create","summary":"Новий ланцюжок (зміни)","description":"Створює звичайний ланцюжок із чернеткою graph (без graph — лише блок «Старт»). НЕ публікує: бот почне ним користуватись після публікації (право ключа «Розсилки й публікація ланцюжків») або коли людина натисне «Опублікувати» в editor_url. Координати x/y можна не вказувати — редактор розкладе блоки сам. template замість graph — готова частина вебінарної воронки: webinar_reg («Вебінар: реєстрація й нагадування»), webinar_after («Вебінар: після ефіру — оффер і дожим»), webinar_missed («Вебінар: не прийшов — перенести на наступний»), mini_course («Міні-курс: уроки з доступом до дати»); webinar — id розкладу вебінару, pay_url — посилання на оплату для оффера. Змінні webinar_at і webinar_link шаблон заводить сам. Тексти в шаблоні — типові заготовки. folder — папка, у яку покласти ланцюжок (як у списку ланцюжків; нова з'явиться сама).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"name":{"type":"string"},"graph":{"type":"object"},"folder":{"type":"string","description":"папка; порожньо — без папки"},"template":{"type":"string","enum":["webinar_reg","webinar_after","webinar_missed","mini_course"]},"webinar":{"type":["integer","string"]},"pay_url":{"type":"string"}},"required":["bot","name"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_flow_update":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_flow_update","summary":"Змінити чернетку ланцюжка (зміни)","description":"Замінює ЧЕРНЕТКУ ланцюжка цілим графом graph. rev — версія чернетки, яку змінюють: якщо чернетку тим часом змінили в редакторі, прийде помилка замість перезапису. На id блоків тримаються статистика й люди, що зараз у ланцюжку: блок з іншим id вважається новим. Новим блокам id видає сервер: придумані (n_ask1) він замінить своїми й поверне в renamed (старий → новий) — далі працюйте з новими. node_ids — ID блоків для людини (ключ → «nd_…»). НЕ публікує: чернетку викочує окрема публікація (право ключа «Розсилки й публікація ланцюжків») або людина в редакторі. folder — перекласти звичайний ланцюжок у папку (порожній рядок — без папки; без поля папка не змінюється).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"flow":{"type":["integer","string"]},"graph":{"type":"object"},"rev":{"type":"integer","description":"rev поточної чернетки"},"folder":{"type":"string"}},"required":["bot","flow","graph","rev"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_flow_patch":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_flow_patch","summary":"Точкова правка чернетки ланцюжка (зміни)","description":"Змінює ЧЕРНЕТКУ ланцюжка частково, без передачі всього графа — для великих ланцюжків. ops — до 100 операцій по черзі: {op: \"replace\", find, replace, in?: \"url\" (типово — адреси кнопок і медіа) | \"text\" (тексти й підписи кнопок) | \"all\", nodes?: [ключі чи ID блоків] — лише в них} — замінити підрядок усюди, де він трапився; {op: \"set\", node: ключ чи ID блоку, path: шлях у data блоку через крапку (items.1.buttons.0.tag), value} — записати значення (null — прибрати поле). Блоки, стрілки й порядок не змінюються — для цього потрібен повний граф. rev — версія чернетки: якщо її тим часом змінили, правки не буде. Операція, що нічого не змінила, — помилка, уся правка тоді не зберігається. НЕ публікує.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"flow":{"type":["integer","string"]},"rev":{"type":"integer","description":"rev поточної чернетки"},"ops":{"type":"array","items":{"type":"object"}}},"required":["bot","flow","rev","ops"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_flow_publish":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_flow_publish","summary":"Опублікувати ланцюжок (зміни)","description":"Викочує ЧЕРНЕТКУ ланцюжка людям — те саме, що кнопки редактора. mode: save — чернетка стає робочою версією, вмикач не змінюється (опублікований ланцюжок одразу йде новою версією; новий лишається вимкненим); live — зробити робочою й увімкнути (тригери й посилання починають запускати ланцюжок); off — зняти з публікації (нових запусків не буде, хто всередині — дійде до кінця; чернетку не чіпає). rev — версія чернетки (з читання чи останньої правки), обов'язкова для save і live: якщо чернетку тим часом змінили, публікації не буде — щоб не викотити чужі незбережені правки. Чернетка з помилками перевірки (issues рівня error) не публікується. Розсилки так не запускаються.\n\nПраво ключа: «Читання й зміни» з увімкненими розсилками.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"flow":{"type":["integer","string"]},"mode":{"type":"string","enum":["save","live","off"]},"rev":{"type":"integer","description":"rev чернетки, яку викочуємо (для save і live)"}},"required":["bot","flow","mode"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_webinars_list":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_webinars_list","summary":"Розклади вебінарів для ботів","description":"Розклади сесій проєкту для дії «Записати на вебінар» (op webinar_assign): id, назва, live|auto, розклад, кімната, прив'язка до вебінару webinarstars (для подій після ефіру), найближчі сесії.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_webinar_upsert":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_webinar_upsert","summary":"Створити чи змінити розклад вебінару (зміни)","description":"Без id — новий. kind: auto (schedule: {days: [1..7], times: [\"19:00\"], cutoff_min: 15}) або live (schedule: {dates: [\"28.09.2026 19:00\"]}). room_url — посилання на кімнату, можна {{first_name}}, {{phone}}, {{subscriber_id}}. webinar_id — id вебінару webinarstars (без нього подій «був / не прийшов» не буде). tz — пояс розкладу. Видалити не можна — лише active: false.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]},"name":{"type":"string"},"kind":{"type":"string","enum":["auto","live"]},"schedule":{"type":"object"},"room_url":{"type":"string"},"webinar_id":{"type":["integer","string"]},"duration_min":{"type":"integer"},"tz":{"type":"string"},"active":{"type":"boolean"}},"required":["name","kind","schedule"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_subscribers_import":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_subscribers_import","summary":"Імпортувати підписників (зміни)","description":"Переносить людей у бота разом зі змінними й тегами — як «Аудиторія → Імпорт» в адмінці, але без файлу. Людину впізнаємо за telegram_id: немає — створюємо, є — вирішує exists (fill — доповнити порожнє, overwrite — перезаписати, skip — не чіпати). Нічого не надсилає і не запускає ланцюжків. У vars — лише наявні змінні бота. Рядок із помилкою не записується зовсім. Бот зможе писати людині, лише якщо вона запускала саме цього бота в Telegram. До 500 людей за виклик.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"subscribers":{"type":"array","items":{"type":"object","properties":{"telegram_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"username":{"type":"string"},"lang":{"type":"string","description":"uk, ru, en…"},"tags":{"type":"array","items":{"type":"string"}},"subscribed_at":{"type":"string","description":"ДД.ММ.РРРР ГГ:ХХ, ISO або unix-час"},"status":{"type":"string","enum":["active","unsubscribed","blocked","banned"],"description":"лише для нових; статус наявного не змінюється"},"vars":{"type":"object","description":"{\"назва змінної\": \"значення\"}; true/false → TRUE/FALSE"}},"required":["telegram_id"]}},"exists":{"type":"string","enum":["fill","overwrite","skip"],"description":"за замовчуванням fill"},"tag":{"type":"string","description":"тег усім із цього виклику, напр. «імпорт 05.10.2026»"}},"required":["bot","subscribers"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_subscribers_find":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_subscribers_find","summary":"Знайти підписників бота","description":"Пошук підписника: ім'я, @username, id людини в мережі бота (user_id), телефон чи пошта (змінні phone/email). telegram_id у відповіді — стара назва user_id, лишена для сумісності. Повертає id підписника, статус і скільки ланцюжків зараз іде. Без q — останні.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"q":{"type":"string"},"in_flow":{"type":["integer","string"],"description":"лише ті, в кого зараз іде цей ланцюжок"}},"required":["bot"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_subscriber_runs":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_subscriber_runs","summary":"Ланцюжки підписника","description":"Що зараз іде в людини (live: ланцюжок, блок, статус waiting — чекає відповіді / sleeping — на паузі, next_at — коли наступний крок, тригер) і що було за 30 днів (history з причиною завершення). У людини може йти кілька ланцюжків одночасно.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"subscriber":{"type":["integer","string"]}},"required":["bot","subscriber"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_run_stop":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_run_stop","summary":"Зупинити ланцюжок у людини (зміни)","description":"Зупиняє один запуск (id запуску): скасовує його паузи, повтори й очікування відповіді. Людині нічого не надсилається, інші її ланцюжки йдуть далі.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"subscriber":{"type":["integer","string"]},"run":{"type":"integer"},"reason":{"type":"string"}},"required":["bot","subscriber","run"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_broadcasts_list":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_broadcasts_list","summary":"Розсилки бота","description":"Розсилки бота, нові зверху: id, назва, стан (draft — чернетка, scheduled — заплановано, sending, paused, done, cancelled), вміст (own — власне повідомлення розсилки з flow_id — його граф редагується як чернетка ланцюжка; flow — готовий ланцюжок бота, за бажанням з блоку start_node), умови аудиторії, час, темп і коротка статистика для запущених.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]}},"required":["bot"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_broadcast_create":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_broadcast_create","summary":"Нова розсилка (чернетка) (зміни)","description":"Створює ЧЕРНЕТКУ розсилки. Вміст: mode=own — власне повідомлення: graph (у форматі ланцюжка) або просто text — одне повідомлення; mode=flow — готовий опублікований ланцюжок flow (id ланцюжка), start_node — ID блоку («nd_…», uid у графі ланцюжка) або його ключ, з якого почати (порожньо — з початку). Аудиторія conds — групи умов, між групами «або»: [{match:\"all\"|\"any\", conds:[{src, name?, op, value}]}]. src і op: var (name — змінна; eq, neq, contains, not_contains, starts, ends, empty, not_empty, gt, gte, lt, lte; дати — before/after з датою ДД.ММ.РРРР чи now-7d, older_than/within_last/within_next з «7d», «24h»), tag (has/not_has), subscribed і active — дата підписки й остання активність (ті самі дати), source (текстові), contact (has/not_has — є картка в Контактах), flow (ran/not_ran, value — id ланцюжка), broadcast (got/not_got, value — id розсилки), inflow (in/not_in, value — id ланцюжка або порожньо). Без умов — усім активним. rate — людей на секунду (1–25, типово 20). Сама нічого не надсилає: тест, запуск і планування — окремі дії з правом ключа «Розсилки» або людиною на сторінці (page_url).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"name":{"type":"string"},"mode":{"type":"string","enum":["own","flow"]},"text":{"type":"string"},"graph":{"type":"object"},"flow":{"type":["integer","string"]},"start_node":{"type":"string"},"conds":{"type":"array","items":{"type":"object"}},"rate":{"type":"integer"}},"required":["bot","name","mode"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_broadcast_update":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_broadcast_update","summary":"Змінити розсилку (зміни)","description":"Змінює ще не запущену розсилку (draft чи scheduled): name, conds і rate — як при створенні; вміст — mode=flow з flow і start_node (готовий опублікований ланцюжок) або mode=own з text чи graph (власне повідомлення, замінює його повністю). Вміст запланованої розсилки не змінюється: для цього її повертають у чернетку. Передавайте лише те, що змінюєте. Нічого не надсилає.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"broadcast":{"type":["integer","string"]},"name":{"type":"string"},"mode":{"type":"string","enum":["own","flow"]},"text":{"type":"string"},"graph":{"type":"object"},"flow":{"type":["integer","string"]},"start_node":{"type":"string"},"conds":{"type":"array","items":{"type":"object"}},"rate":{"type":"integer"}},"required":["bot","broadcast"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_broadcast_test":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_broadcast_test","summary":"Тест розсилки (зміни)","description":"Надсилає розсилку як тест: той самий вміст, але поза статистикою й без зміни стану розсилки. Кому — subscribers (id підписників цього бота, до 20); порожньо — адміну бота. Перед тестом власне повідомлення перевіряється й публікується, як при запуску: помилки в ньому — відмова з їх переліком.\n\nПраво ключа: «Читання й зміни» з увімкненими розсилками.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"broadcast":{"type":["integer","string"]},"subscribers":{"type":"array","items":{"type":"integer"}}},"required":["bot","broadcast"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_broadcast_launch":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_broadcast_launch","summary":"Запустити або запланувати розсилку (зміни)","description":"Запускає розсилку зараз (when=now) або планує на час at (when=at, «ДД.ММ.РРРР ГГ:ХХ» у часовому поясі бота). Заплановану — переплановує. Перед запуском власне повідомлення перевіряється й публікується; помилки в ньому, час у минулому чи порожня аудиторія — відмова. expect_recipients — скільки людей, за вашим розрахунком, отримає розсилку: якщо зараз під умови підходить помітно інша кількість (понад 10% чи більше ніж на 2), розсилка не стартує, а відповідь містить справжнє число. Про запуск бот повідомляє команду в чат сповіщень бота (або адміну бота). Запущену розсилку змінити не можна — лише призупинити чи скасувати.\n\nПраво ключа: «Читання й зміни» з увімкненими розсилками.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"broadcast":{"type":["integer","string"]},"when":{"type":"string","enum":["now","at"]},"at":{"type":"string"},"expect_recipients":{"type":"integer"}},"required":["bot","broadcast","when","expect_recipients"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_broadcast_control":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_broadcast_control","summary":"Керувати розсилкою (зміни)","description":"Дія над розсилкою: unschedule — заплановану повернути в чернетку (до того, як почала надсилатись); pause і resume — призупинити й продовжити ту, що надсилається; cancel — скасувати заплановану, ту, що надсилається, чи на паузі (хто вже отримав — отримав); copy — нова чернетка з тими самими вмістом, аудиторією й темпом.\n\nПраво ключа: «Читання й зміни» з увімкненими розсилками.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"broadcast":{"type":["integer","string"]},"action":{"type":"string","enum":["unschedule","pause","resume","cancel","copy"]}},"required":["bot","broadcast","action"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/bot_broadcast_stats":{"post":{"tags":["Інструменти: Чат-боти й чати"],"operationId":"tool_bot_broadcast_stats","summary":"Статистика розсилки","description":"Статистика розсилки: отримувачів, у черзі, надіслано, помилки (з них заблокували бота), пропущено (людина відписалась чи з нею говорив оператор), натиснули кнопку й % залученості. insights — що сталося після: натискання кожної кнопки (buttons), відповіли протягом 48 год (replied), оплатили за pay_days днів після отримання й сума (paid, paid_sum, currency), отримали й натиснули по годинах (hours), автор, початок, тривалість, час тесту. pay_days — 1, 3 (типово) або 7. З recipients=true — ще й перші 200 отримувачів зі станом (queued, skipped, sent, clicked, error, blocked), кнопкою, відповіддю й оплатою; state — відфільтрувати за станом або replied / paid.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"bot":{"type":["integer","string"]},"broadcast":{"type":["integer","string"]},"recipients":{"type":"boolean"},"state":{"type":"string"},"pay_days":{"type":"integer","enum":[1,3,7]}},"required":["bot","broadcast"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/webinars":{"post":{"tags":["Інструменти: Вебінари"],"operationId":"tool_webinars","summary":"Вебінари за період","description":"Вебінари кабінету webinarstars і проведені сесії за період: глядачі (унікальні після дедуплікації за телефоном), пік онлайн, середній і медіанний час перегляду, кліки по кнопках, коментарі й залученість. Плюс найближчі заплановані сесії. Сесія з порожнім synced_at ще не прочитана з кабінету — її нулі означають саме це, а не провальний ефір. sync_state = pending натомість означає лише чергу на повторне читання й буває в сесій із повними даними.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"period":{"type":"string","enum":["7","30","all"],"description":"Період: 7 чи 30 останніх днів або весь час. За замовчуванням 30."},"webinar":{"type":"string","description":"webinar_id у кабінеті; без нього — усі."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/webinar_session":{"post":{"tags":["Інструменти: Вебінари"],"operationId":"tool_webinar_session","summary":"Одна сесія вебінару","description":"Детальний звіт сесії: крива присутності, воронка кожної кнопки (показано → побачили → натиснули), сплеск чату в часі, розподіли за пристроями й географією, скільки глядачів упізнано в базі контактів і посилання на запис, а також розріз «звідки прийшли»: форма реєстрації, реклама й розміщення кожного глядача. Розріз будується з номера заявки, який школа підставляє в посилання на кімнату; там, де його немає, lead_labels.labelled буде нулем і розрізи порожні — це означає «невідомо», а не «реклами не було». Імен, телефонів і текстів чату тут немає.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id сесії."}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/webinar_visitors":{"post":{"tags":["Інструменти: Вебінари"],"operationId":"tool_webinar_visitors","summary":"Глядачі сесії","description":"Глядачі однієї сесії з фільтрами: залученість, частка й хвилини перегляду, коментарі, реакція на конкретну кнопку, оплата після ефіру, тег контакту. Усі умови поєднуються через «і». Саме тут відповіді на «хто досидів до оферу й не натиснув», «хто бачив офер і не оплатив» і «кому передзвонити». По 50 на сторінку, найдовше дивились зверху. Тексти коментарів — лише за with_comments.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"session":{"type":["integer","string"],"description":"id сесії."},"form":{"type":["integer","string"],"description":"id форми реєстрації з webinar_session.sources.by_form: лише ті, хто прийшов саме з неї."},"source":{"type":"string","description":"Точне utm_source заявки."},"only":{"type":"string","enum":["clicked","stayed","commented","matched","labelled"],"description":"clicked — натиснув хоч одну кнопку; stayed — досидів до порогу кабінету (він у відповіді, filters.stayed_means_pct); commented — писав у чат; matched — упізнаний у базі контактів; labelled — видно форму, з якої прийшов."},"button":{"type":"integer","description":"position кнопки з webinar_session.buttons. Позиція унікальна в межах СЕСІЇ: та сама цифра в іншій сесії означає іншу кнопку."},"button_text":{"type":"string","description":"Кнопка за частиною тексту чи посилання — на відміну від button, однаково працює в усіх повторах вебінару."},"button_state":{"type":"string","enum":["clicked","seen","shown","none"],"description":"Що зробив із button / button_text: clicked — натиснув (за замовчуванням); seen — бачив і не натиснув; shown — бачив, натиснув чи ні; none — не натиснув, бачив чи ні."},"clicked_any":{"type":"string","enum":["yes","no"],"description":"yes — натиснув хоч одну кнопку; no — жодної."},"saw_button":{"type":"boolean","description":"Бачив хоч одну кнопку (тобто був в ефірі під час показу)."},"min_engagement":{"type":"integer","minimum":0,"maximum":100},"min_watch_pct":{"type":"integer","minimum":0,"maximum":100},"min_minutes":{"type":"integer","minimum":0,"description":"Дивився щонайменше стільки хвилин."},"min_comments":{"type":"integer","minimum":0},"sat_through":{"type":"boolean","description":"Досидів до порогу кабінету. Те саме, що only=stayed, але поєднується з рештою умов."},"paid":{"type":"string","enum":["yes","no"],"description":"yes — має успішну оплату від початку цього ефіру; no — не має. Оплату видно лише в упізнаних у базі, тож no охоплює й невпізнаних."},"tag":{"type":"string","description":"Тег контакту в базі школи."},"q":{"description":"Імʼя або телефон у будь-якому написанні.","type":"string"},"sort":{"type":"string","enum":["watched","engagement","comments"],"description":"За замовчуванням watched."},"with_comments":{"type":"boolean","description":"Додати тексти коментарів кожного глядача, до 20."},"page":{"type":["integer","string"],"minimum":1,"description":"Сторінка, з 1."}},"required":["session"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/webinar_visitor":{"post":{"tags":["Інструменти: Вебінари"],"operationId":"tool_webinar_visitor","summary":"Один глядач сесії","description":"Усе про одного глядача: кожен його захід окремо (звідси видно, чому «дивився дві години» буває при годинному ефірі — два пристрої водночас), статус КОЖНОЇ кнопки сесії включно з тими, яких він не бачив, усі його коментарі, мітки кабінету й картка в базі школи, якщо впізнали.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"session":{"type":["integer","string"],"description":"id сесії."},"id":{"type":["integer","string"],"description":"id глядача. Унікальний у межах сесії, тому session обовʼязковий."}},"required":["session","id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/webinar_comments":{"post":{"tags":["Інструменти: Вебінари"],"operationId":"tool_webinar_comments","summary":"Чат сесії","description":"Тексти чату однієї сесії в хронологічному порядку, по 100 на сторінку. Відповідає на «про що найчастіше питали» і «що писали в момент оферу»: у кожного рядка є video_sec — секунда в записі на YouTube, якщо запис прив'язано.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"session":{"type":["integer","string"],"description":"id сесії."},"q":{"description":"Підрядок у тексті коментаря.","type":"string"},"page":{"type":["integer","string"],"minimum":1,"description":"Сторінка, з 1."}},"required":["session"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/webinar_report_get":{"post":{"tags":["Інструменти: Вебінари"],"operationId":"tool_webinar_report_get","summary":"Звіт про ефір у Telegram: налаштування","description":"Як зараз налаштовано звіт, що після кожного ефіру йде в Telegram-чат команди: рядки шапки (header), списки людей (lists), затримка, чат, посилання-броні. Разом із цим — усе, з чого можна збирати: available.rows (показники шапки), available.conditions (умови списків), available.chats і available.paylinks.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/webinar_report_update":{"post":{"tags":["Інструменти: Вебінари"],"operationId":"tool_webinar_report_update","summary":"Звіт про ефір у Telegram: змінити (зміни)","description":"Змінює налаштування звіту про ефір. Правка часткова: змінюються лише передані поля, але header і lists замінюються ЦІЛКОМ — новий перелік передається повністю. Умови списку поєднуються через «і»; назви умов ті самі, що у фільтрах глядачів сесії. Вмикає звіт і надсилає тестовий лише людина в адмінці (settings_url): це повідомлення в робочий чат команди. Якщо звіт уже ввімкнено, зміни діють із наступного ефіру.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"header":{"type":"array","items":{"type":"object"},"description":"Рядки шапки по порядку: {row, label?}. row — ключ з available.rows; label — свій підпис (без нього типовий). Для row=text label обовʼязковий — це сам текст рядка; row=gap — порожній рядок. Порожній масив повертає типову шапку."},"lists":{"type":"array","items":{"type":"object"},"description":"Списки людей, до 5: {name, show?, conditions?}. show — скільки людей показувати: 0 — усіх, інакше 1–200 (типово 15). conditions — обʼєкт умов з available.conditions, напр. {\"sat_through\": true, \"clicked_any\": \"no\"}. Порожній масив прибирає списки."},"delay_min":{"type":"integer","minimum":0,"maximum":1440,"description":"Через скільки хвилин після кінця ефіру слати. 0 — одразу, щойно кабінет віддасть остаточний звіт."},"booking_paylinks":{"type":"array","items":{"type":["integer","string"]},"description":"id посилань на оплату, що вважаються бронями (з available.paylinks). Решта оплат рахується як повні."},"integration_id":{"type":["integer","string"],"description":"Чат: id підключення з available.chats."},"thread":{"type":"integer","description":"Гілка чату з available.chats[].threads; 0 — загальна стрічка."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/sites_list":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_sites_list","summary":"Сайти проєкту","description":"Сайти школи: id, назва, головна адреса, чи опублікований, чи є неопубліковані зміни.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_schema":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_schema","summary":"Формат сторінки сайту","description":"Типи блоків, їхні поля й варіанти вигляду, формат кнопок і посилань, стиль блоку, стиль сайту, спливні вікна й формат своїх ефектів полотна (ключ fx).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_get":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_get","summary":"Сайт: сторінки, адреси, налаштування","description":"Сторінки (id, адреса, назва, тип, SEO, чи є зміни), адреси (платформи й власні домени зі станом), спільне сайту (стиль, шапка, підвал) з globals_rev, посилання на редактор і перегляд чернетки.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"site":{"type":["integer","string"],"description":"id сайту"}},"required":["site"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_page_get":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_page_get","summary":"Сторінка: блоки","description":"Блоки сторінки — чернетка (за замовчуванням) або опублікована версія — з rev для збереження змін.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"site":{"type":["integer","string"]},"page":{"type":["integer","string"]},"version":{"type":"string","enum":["draft","published"]}},"required":["site","page"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_media_list":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_media_list","summary":"Медіатека","description":"Картинки сайтів проєкту: id (для полів media у блоках), розміри, alt. Нові картинки сайту беруться зі спільної медіатеки проєкту.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_media_from_library":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_media_from_library","summary":"Фото з медіатеки → на сайт (зміни)","description":"Бере фото зі спільної медіатеки проєкту (id файлу медіатеки, status=ready) і повертає id картинки сайту — його ставлять у поля media блоків. Той самий файл дає той самий id.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"media":{"type":["integer","string"]}},"required":["media"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_create":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_create","summary":"Новий сайт (зміни)","description":"Створює сайт зі стартовим лендінгом (перший екран, текст, програма, питання, форма) і сторінкою подяки. НЕ публікує. slug — адреса <slug>.sites.proonline.com.ua (латиниця, цифри, дефіс; порожньо — з назви).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"name":{"type":"string"},"slug":{"type":"string"},"template":{"type":"string","enum":["basic","webinar","course","lead"],"description":"Стартові сторінки: basic — Базовий лендінг; webinar — Вебінар; course — Продаж курсу; lead — Лід-магніт"}},"required":["name"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_page_create":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_page_create","summary":"Нова сторінка (зміни)","description":"Додає сторінку: path (напр. /oferta; порожньо — з назви), kind: page | thanks (подяка) | 404. blocks — одразу вміст (масив блоків сторінки); без них — порожній перший екран із назвою.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"site":{"type":["integer","string"]},"name":{"type":"string"},"path":{"type":"string"},"kind":{"type":"string","enum":["page","thanks","404"]},"blocks":{"type":"array","items":{"type":"object"}},"seo":{"type":"object","description":"title, description, og_title, og_description, og_image, noindex, sticky (кнопка внизу екрана)"}},"required":["site","name"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_page_update":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_page_update","summary":"Змінити чернетку сторінки (зміни)","description":"Замінює ЧЕРНЕТКУ сторінки цілим масивом blocks (порядок = порядок на сторінці); rev — версія чернетки, з якої зроблено зміни. Можна змінити й name, seo (частково). НЕ публікує: на живий сайт зміни йдуть лише після публікації. Повертає preview_url і editor_url.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"site":{"type":["integer","string"]},"page":{"type":["integer","string"]},"blocks":{"type":"array","items":{"type":"object"}},"rev":{"type":"integer","description":"rev чернетки сторінки, прочитаної перед зміною"},"name":{"type":"string"},"seo":{"type":"object","description":"поля, що змінюються: title, description, og_*, noindex, hide_header, hide_footer, sticky — кнопка внизу екрана ЦІЄЇ сторінки: {on, mobile (лише телефон), kind, text, short, price, old, note, style, link}; теж частково, {on: false} — прибрати"}},"required":["site","page","rev"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_globals_update":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_globals_update","summary":"Шапка, підвал, стиль сайту (зміни)","description":"Спільне для всіх сторінок: style (кольори, шрифти, округлення), header і footer (блоки типу header/footer), show_header, show_footer, popups (спливні вікна — масив ЦІЛКОМ). Кнопка внизу екрана — не тут: вона своя в кожної сторінки (seo.sticky сторінки). Зміни часткові: оновлюються лише передані поля; rev — globals_rev сайту. НЕ публікує.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"site":{"type":["integer","string"]},"rev":{"type":"integer","description":"globals_rev сайту"},"style":{"type":"object"},"header":{"type":"object"},"footer":{"type":"object"},"show_header":{"type":"boolean"},"show_footer":{"type":"boolean"},"popups":{"type":"array","items":{"type":"object"}},"progress":{"type":"boolean","description":"Смуга прогресу читання вгорі"}},"required":["site","rev"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_settings_update":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_settings_update","summary":"Налаштування сайту (зміни)","description":"Змінює налаштування сайту — лише передані: favicon (id картинки сайту; 0 — прибрати; квадратна, від 180 px), noindex (true — сховати від пошуковиків, false — відкрити для індексації), verify_google, verify_bing (код підтвердження або весь meta-тег). Лічильники (пікселі), пароль, адресу й редиректи налаштовує людина в адмінці. НЕ публікує: на живому сайті зʼявиться після публікації.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"site":{"type":["integer","string"]},"favicon":{"type":["integer","string"]},"noindex":{"type":"boolean"},"verify_google":{"type":"string"},"verify_bing":{"type":"string"}},"required":["site"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_stats":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_stats","summary":"Аналітика сайту","description":"Відвідувачі, заявки, оплати й виручка сайту; воронка, дні, джерела (utm_source; \"\" — без міток), переходи без міток (direct/search/social/домен), сторінки, пристрої, країни з містами, форми. Фільтри звужують усе разом: page (id), source, device (mobile|desktop|tablet), country (UA, PL…). Заявки й оплати — ті самі, що в розділі «Заявки».\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"site":{"type":["integer","string"]},"period":{"type":"string","enum":["7","30","all"]},"page":{"type":["integer","string"]},"source":{"type":"string"},"device":{"type":"string","enum":["mobile","desktop","tablet"]},"country":{"type":"string","description":"ISO-код: UA, PL, DE…"}},"required":["site"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_check":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_check","summary":"Перевірити сайт перед публікацією","description":"Те саме, що перевіряє кнопка «Опублікувати» перед публікацією: errors зупиняють публікацію (форму не вибрано, посилання в нікуди), warnings — SEO-підказки, що не зупиняють.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"site":{"type":["integer","string"]}},"required":["site"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_publish":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_publish","summary":"Опублікувати сайт (зміни)","description":"Робить чернетки живими. Публікується ВЕСЬ сайт одразу: усі сторінки, шапка, підвал, стиль і налаштування — разом із правками, які людина зробила в редакторі й ще не публікувала (що саме зміниться — unpublished_changes сайту). Помилки перевірки (errors) публікацію зупиняють. Попередня версія лишається в історії редактора — повернути її може людина.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"site":{"type":["integer","string"]}},"required":["site"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_speed":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_speed","summary":"Оптимізація: швидкість сайту","description":"Те саме, що розділ «Оптимізація»: остання перевірка Google PageSpeed кожної опублікованої сторінки (mobile і desktop): оцінки 0–100, LCP/FCP/TBT/CLS/TTFB з оцінкою good|mid|poor і зміною від попередньої перевірки, що гальмує (issues: kind auto — вмикається кнопкою «Оптимізувати», platform — на боці ProForms, you — потрібна дія школи; advice — що зробити; block — який блок сторінки). field — реальні відвідувачі за 28 днів (75-й перцентиль, як рахує Google). Перевіряється лише ОПУБЛІКОВАНА версія. page — лише одна сторінка.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"site":{"type":["integer","string"]},"page":{"type":["integer","string"]}},"required":["site"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_fx_list":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_fx_list","summary":"Ефекти полотна","description":"Ефекти для елемента полотна t=fx: builtin — вбудовані (fx: ключ), custom — свої з бібліотеки проєкту (fx: \"custom\", ref: id, params: {…}). Для своїх: id, назва, опис, параметри, rev, де стоїть (used). archived: true — архів.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"archived":{"type":"boolean"}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_fx_get":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_fx_get","summary":"Ефект: код і параметри","description":"Свій ефект повністю: код, параметри, rev (версія для змін), на яких сторінках стоїть.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"fx":{"type":["integer","string"]}},"required":["fx"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_fx_create":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_fx_create","summary":"Новий ефект (зміни)","description":"Створює свій ефект у бібліотеці проєкту: name, code (JavaScript: function frame(env, state), необов’язково function setup(env)), params — [{key, label, type number|color|text|select|toggle, min, max, step, options, default}], about — короткий опис. Код працює в пісочниці: без доступу до сторінки й мережі, лише малювання на полотні. На полотні ефект — елемент {t: \"fx\", fx: \"custom\", ref: id, params}. Повертає url — сторінку, де видно, як ефект виглядає.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"name":{"type":"string"},"code":{"type":"string"},"about":{"type":"string"},"params":{"type":"array","items":{"type":"object"}}},"required":["name","code"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_fx_update":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_fx_update","summary":"Змінити ефект (зміни)","description":"Змінює свій ефект: передайте лише те, що міняється (name, about, code, params), і rev ефекту. На опублікованих сайтах лишається попередній код до наступної публікації сайту.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"fx":{"type":["integer","string"]},"rev":{"type":"integer"},"name":{"type":"string"},"code":{"type":"string"},"about":{"type":"string"},"params":{"type":"array","items":{"type":"object"}}},"required":["fx","rev"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_fx_set_active":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_fx_set_active","summary":"Ефект: в архів / з архіву (зміни)","description":"active: false — прибрати ефект із бібліотеки в архів (опубліковані сайти працюють далі на своїй версії; нова публікація сторінки з цим ефектом зупиниться, доки його не замінять); true — повернути.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"fx":{"type":["integer","string"]},"active":{"type":"boolean"}},"required":["fx","active"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/site_speed_check":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_site_speed_check","summary":"Оптимізація: перевірити зараз (зміни)","description":"Ставить у чергу нову перевірку PageSpeed усіх опублікованих сторінок (як кнопка «Перевірити зараз»). Займає 20–60 с на сторінку; результат — у звіті швидкості сайту (pending — скільки ще в черзі).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"site":{"type":["integer","string"]}},"required":["site"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/cms_collections_list":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_cms_collections_list","summary":"Колекції CMS","description":"Колекції проєкту: id, назва, поля (key, label, kind, options) і кількість записів. Колекції спільні для всіх сайтів школи; на сайт виводяться блоком cms («Список з колекції») чи сторінкою записів.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/cms_collection_create":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_cms_collection_create","summary":"Нова колекція CMS (зміни)","description":"Створює колекцію: preset (ключ готового набору полів — відгуки, спікери, курси, вебінари; ключі — presets у переліку колекцій) або name + fields [{label, kind, options?}] (kind — один із типів полів колекцій, kinds).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"preset":{"type":"string"},"name":{"type":"string"},"fields":{"type":"array","items":{"type":"object"}}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/cms_items_list":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_cms_items_list","summary":"Записи колекції","description":"Записи колекції: id, адреса (slug), стан (draft|published|dirty — є неопубліковані зміни), data (чернетка), rev (версія для змін). q — пошук у тексті.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"collection":{"type":["integer","string"]},"q":{"type":"string"}},"required":["collection"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/cms_item_create":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_cms_item_create","summary":"Новий запис колекції (зміни)","description":"Створює запис ЧЕРНЕТКОЮ: data — {key поля: значення} за типами полів колекції (rich — HTML з <p><b><i><ul><li><a>; image — id картинки сайту; video/audio — id файлу медіатеки; date — «2026-10-01» чи «2026-10-01T19:00»; ref — id запису іншої колекції). Переклад для сторінок іншими мовами — _i18n: {\"en\": {key текстового поля: текст}}; без перекладу поля там буде основна мова. slug — адреса запису латиницею (порожньо — з назви). НЕ публікує: запис публікує людина в розділі «Колекції»; повертає url запису.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"collection":{"type":["integer","string"]},"data":{"type":"object"},"slug":{"type":"string"}},"required":["collection","data"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/cms_item_update":{"post":{"tags":["Інструменти: Сайти"],"operationId":"tool_cms_item_update","summary":"Змінити запис колекції (зміни)","description":"Змінює ЧЕРНЕТКУ запису: data — лише поля, які змінюєте (решта лишається). rev — версія запису, з якої зроблено зміни: правка людини, зроблена пізніше, не затирається. НЕ публікує.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"item":{"type":["integer","string"]},"data":{"type":"object"},"rev":{"type":"integer"},"slug":{"type":"string"}},"required":["item","data","rev"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/media_list":{"post":{"tags":["Інструменти: Файли"],"operationId":"tool_media_list","summary":"Медіатека: файли","description":"Файли проєкту: id (для полів media у ланцюжках ботів), тип (photo, video, audio, voice — голосове, video_note — кружечок, file), назва, папка (повний шлях «Вебінари/Жовтень»), стан обробки, розмір (bytes — файл, bytes_total — разом з прев’ю), розміри, тривалість, адреса на CDN і чи піде в Telegram. Фільтри: kind (кілька через кому), folder — шлях папки (recursive=true — разом з підпапками), q — пошук за назвою, min_bytes / max_bytes; sort: created | name | bytes, dir: asc | desc. Також повертає перелік папок і чи готове сховище файлів.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"kind":{"type":"string"},"folder":{"type":"string"},"q":{"type":"string"},"recursive":{"type":"boolean"},"min_bytes":{"type":"integer"},"max_bytes":{"type":"integer"},"sort":{"type":"string","enum":["created","name","bytes"]},"dir":{"type":"string","enum":["asc","desc"]},"page":{"type":["integer","string"],"description":"з 1, по 100 файлів"}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/media_folders":{"post":{"tags":["Інструменти: Файли"],"operationId":"tool_media_folders","summary":"Медіатека: папки","description":"Дерево папок медіатеки: шлях, скільки файлів і скільки займають — у самій папці й разом з підпапками. А також скільки займає вся медіатека (bytes — разом з копіями), за типами і в кошику. Окремо папки не створюються: папка зʼявляється, коли файлу вказано шлях на кшталт «Вебінари/Жовтень».\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/media_get":{"post":{"tags":["Інструменти: Файли"],"operationId":"tool_media_get","summary":"Медіатека: один файл","description":"Файл за id: стан обробки (processing — ще готується, ready, failed з поясненням), адреса, розміри, тривалість, чи піде в Telegram, і де вже використано.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"media":{"type":["integer","string"]}},"required":["media"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/media_import_url":{"post":{"tags":["Інструменти: Файли"],"operationId":"tool_media_import_url","summary":"Медіатека: додати файл за посиланням (зміни)","description":"Сервер сам завантажить файл (до 200 МБ; пряме посилання, Google Drive «усі, хто має посилання» або Dropbox), перевірить за вмістом і підготує під Telegram: voice → OGG/Opus, video_note → квадрат до 60 с, video → MP4 (понад 50 МБ стисне). Обробка йде у фоні хвилину-дві: повертає id зі status=processing; файл придатний для ланцюжків, коли status стане ready. kind не вказано — тип за вмістом. Сховище файлів проєкту створюється автоматично; поки воно не готове — відмова з поясненням. Ліміти Telegram: photo — до 10 МБ; ширина + висота до 10 000 px; video — до 50 МБ; більше — стиснемо автоматично; video_note — квадрат до 60 с; обріжемо й стиснемо самі; voice — перетворимо на OGG/Opus, до 50 МБ; audio — MP3, M4A, OGG — до 50 МБ; file — будь-який документ до 50 МБ.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"url":{"type":"string"},"kind":{"type":"string","enum":["photo","video","audio","voice","video_note","file"]},"name":{"type":"string"},"folder":{"type":"string"}},"required":["url"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/media_upload":{"post":{"tags":["Інструменти: Файли"],"operationId":"tool_media_upload","summary":"Медіатека: завантажити файл (зміни)","description":"Завантажити файл, якого немає за посиланням (скріншот, банер з комп'ютера людини): content — вміст файлу в base64, name — назва з розширенням (за нею й за вмістом визначається тип). До 5 МБ; більші файли додаються за посиланням. Далі все як у звичайного завантаження: перевірка за вмістом, Bunny, обробка у фоні, доки status не стане ready. Повертає id і адресу на CDN (для фото — одразу). Потрібне готове сховище файлів проєкту.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"content":{"type":"string","description":"base64, без префікса data:"},"name":{"type":"string"},"kind":{"type":"string","enum":["photo","video","audio","voice","video_note","file"]},"folder":{"type":"string"}},"required":["content","name"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/media_update":{"post":{"tags":["Інструменти: Файли"],"operationId":"tool_media_update","summary":"Медіатека: назва й папка (зміни)","description":"Перейменувати файл і/або перенести в папку (папка — просто підпис; порожній рядок — без папки). Архів і видалення робить лише людина в розділі «Файли».\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"media":{"type":["integer","string"]},"name":{"type":"string"},"folder":{"type":"string"}},"required":["media"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/boards_list":{"post":{"tags":["Інструменти: Борди"],"operationId":"tool_boards_list","summary":"Борди: список","description":"Борди проєкту: id, назва, скільки об'єктів, коли й ким змінено, чи відкрите гостьове посилання, папка (folder_id), editor_url. q — пошук за назвою, folder_id — лише борди з цієї папки. folders — папки бордів з кількістю.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"q":{"type":"string"},"folder_id":{"type":["integer","string"]}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/board_get":{"post":{"tags":["Інструменти: Борди"],"operationId":"tool_board_get","summary":"Борд: вміст","description":"Об'єкти борду компактно: id, тип, текст, координати й розмір, фігура, колір, фрейм (parent), кінці ліній (from/to), вузли майнд-карт (root, pnode) з картою також відступним списком у mind_maps, живі картки (ref). Малюнки олівцем — без точок. Плюс відкриті коментарі. Координати — пікселі полотна, y росте вниз.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"board_id":{"type":["integer","string"]}},"required":["board_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/board_duplicate":{"post":{"tags":["Інструменти: Борди"],"operationId":"tool_board_duplicate","summary":"Борд: копія (зміни)","description":"Повна копія борду з усім вмістом і оформленням (кольори, шрифти, лінії, картинки) — як «Дублювати» в адмінці. id об'єктів у копії ті самі, що в оригіналі. Коментарі, історія й гостьове посилання не копіюються. title — назва копії.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"board_id":{"type":["integer","string"]},"title":{"type":"string"}},"required":["board_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/board_items_copy":{"post":{"tags":["Інструменти: Борди"],"operationId":"tool_board_items_copy","summary":"Борд: копія об'єктів (зміни)","description":"Скопіювати об'єкти в межах борду зі зсувом dx/dy — з усім оформленням. Фрейм копіюється разом з усім, що в ньому, а лінії — якщо обидва кінці серед скопійованого. Повертає ids: старий id → новий. Типово — праворуч від скопійованого з відступом 200.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"board_id":{"type":["integer","string"]},"ids":{"type":"array","items":{"type":"string"}},"dx":{"type":"number"},"dy":{"type":"number"}},"required":["board_id","ids"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/board_create":{"post":{"tags":["Інструменти: Борди"],"operationId":"tool_board_create","summary":"Борд: створити (зміни)","description":"Новий борд. template: blank — Порожній, mindmap — Майнд-карта, flowchart — Блок-схема, brainstorm — Мозковий штурм, funnel — Воронка запуску, cjm — CJM учня, course — Структура курсу, webinar — Сценарій вебінару, retro — Ретроспектива, swot — SWOT, kanban — Канбан. folder_id — одразу покласти в папку бордів. Повертає id та editor_url.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"title":{"type":"string"},"template":{"type":"string","enum":["blank","mindmap","flowchart","brainstorm","funnel","cjm","course","webinar","retro","swot","kanban"]},"folder_id":{"type":["integer","string"]}},"required":["title"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/board_items_add":{"post":{"tags":["Інструменти: Борди"],"operationId":"tool_board_items_add","summary":"Борд: додати об'єкти (зміни)","description":"Додати на борд до 500 об'єктів однією дією. Кожен: type (sticky — стікер, text, shape — фігура з текстом, connector — лінія, frame — фрейм-контейнер, card — жива картка ProForms, stamp — позначка, image — картинка за https-адресою src), text (для frame — title, для лінії — label), x, y, w, h (без координат — розкладу сам нижче наявного вмісту сіткою), fill/stroke/color (#rrggbb), shape (rect, round, ellipse, diamond, triangle, parallelogram, hexagon, star, terminator, document, database, manual, data), fontSize, bold. ref — ваша мітка, щоб посилатися на щойно створений об'єкт у parent (фрейм) і from/to ліній. card: {\"kind\":\"form|bot|site|paylink\",\"id\":N}. Лінія: from/to, route (straight|elbow|curve), endArrow (arrow|triangle|none…). Форматування частин тексту — rich замість text: [{\"t\":\"звичайний \"},{\"t\":\"жирний\",\"b\":true},{\"t\":\" курсив\",\"i\":true}] (b, i, u — підкреслений, s — закреслений, c — колір #rrggbb); text тоді збирається сам. Повертає id за ref.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"board_id":{"type":["integer","string"]},"items":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string"},"type":{"type":"string","enum":["sticky","text","shape","connector","frame","card","stamp","image"]},"text":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"},"parent":{"type":"string"},"from":{"type":"object","description":"{ref:\"a\"} або {id:\"…\"} — прив'язка до об'єкта (anchor: auto|top|right|bottom|left), або {x, y} — вільна точка"},"to":{"type":"object","description":"{ref:\"a\"} або {id:\"…\"} — прив'язка до об'єкта (anchor: auto|top|right|bottom|left), або {x, y} — вільна точка"},"card":{"type":"object"},"src":{"type":"string"}}}}},"required":["board_id","items"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/board_items_update":{"post":{"tags":["Інструменти: Борди"],"operationId":"tool_board_items_update","summary":"Борд: змінити об'єкти (зміни)","description":"Змінити наявні об'єкти за id: текст, координати, розмір, кольори, фігуру, вид лінії тощо — лише передані властивості. Тип об'єкта не змінюється. До 500 змін за раз. Видалення не підтримується — лише в редакторі борду.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"board_id":{"type":["integer","string"]},"updates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}}}}},"required":["board_id","updates"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/board_mindmap_from_outline":{"post":{"tags":["Інструменти: Борди"],"operationId":"tool_board_mindmap_from_outline","summary":"Борд: майнд-карта зі списку (зміни)","description":"Майнд-карта з відступного списку (табуляція чи пробіли; маркери «-», «*», «1.» можна). Один верхній рядок — корінь; кілька — під спільний корінь title. layout: both (гілки в обидва боки, типово) або right. Без board_id — створить новий борд із назвою title. Карта ляже нижче наявного вмісту. До 500 вузлів.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"board_id":{"type":["integer","string"]},"title":{"type":"string"},"outline":{"type":"string"},"layout":{"type":"string","enum":["both","right"]}},"required":["outline"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/board_flowchart":{"post":{"tags":["Інструменти: Борди"],"operationId":"tool_board_flowchart","summary":"Борд: блок-схема (зміни)","description":"Блок-схема з вузлів і переходів — координати рахує сервер (пошарово, цикли дозволені). nodes: [{key, text, shape?, fill?}] (shape — rect, round, diamond для рішень, terminator для старту/кінця…; перший вузол без входів стає «стартом»), edges: [{from: key, to: key, label?}]. direction: down (типово) або right. Без board_id — новий борд із назвою title.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"board_id":{"type":["integer","string"]},"title":{"type":"string"},"direction":{"type":"string","enum":["down","right"]},"nodes":{"type":"array","items":{"type":"object"}},"edges":{"type":"array","items":{"type":"object"}}},"required":["nodes"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/photo_designs_list":{"post":{"tags":["Інструменти: Фоторедактор"],"operationId":"tool_photo_designs_list","summary":"Фоторедактор: креативи","description":"Креативи проєкту (templates=true — шаблони): id, назва, розмір, скільки шарів, коли змінено, editor_url.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"q":{"type":"string"},"templates":{"type":"boolean"}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/photo_design_get":{"post":{"tags":["Інструменти: Фоторедактор"],"operationId":"tool_photo_design_get","summary":"Фоторедактор: вміст креативу","description":"Шари креативу знизу догори (порядок = порядок шарів) з усіма властивостями, розмір полотна, фон і поля шаблону (slot → id шару). Координати — пікселі полотна, y росте вниз; x, y — лівий верхній кут рамки шару.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"design_id":{"type":["integer","string"]}},"required":["design_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/photo_templates_list":{"post":{"tags":["Інструменти: Фоторедактор"],"operationId":"tool_photo_templates_list","summary":"Фоторедактор: шаблони з полями","description":"Шаблони проєкту з полями для заповнення: для кожного — slot, тип (text|image) і поточний текст.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/photo_design_from_template":{"post":{"tags":["Інструменти: Фоторедактор"],"operationId":"tool_photo_design_from_template","summary":"Фоторедактор: креатив із шаблону (зміни)","description":"Новий креатив-чернетка з шаблону. fields — {slot: значення}: для текстових полів рядок, для фото (photo, logo) — id готового фото з медіатеки проєкту. size — інший розмір (ig_post, ig_portrait, story, fb_post, yt_thumb, tg_post, banner, a4) або w/h: вміст перерахується пропорційно. Повертає editor_url — адресу редактора, де креатив перевіряють і зберігають картинку.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"template_id":{"type":"integer"},"title":{"type":"string"},"fields":{"type":"object"},"size":{"type":"string","enum":["ig_post","ig_portrait","story","fb_post","yt_thumb","tg_post","banner","a4"]},"w":{"type":"integer"},"h":{"type":"integer"}},"required":["template_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/photo_design_create":{"post":{"tags":["Інструменти: Фоторедактор"],"operationId":"tool_photo_design_create","summary":"Фоторедактор: новий креатив (зміни)","description":"Новий креатив-чернетка: size (ig_post, ig_portrait, story, fb_post, yt_thumb, tg_post, banner, a4) або w/h, bg (#rrggbb), items — шари знизу догори. Фото — {type:\"image\", media:<id медіатеки>, x, y, w, h}; текст — {type:\"text\", text, x, y, w, font, fontSize, weight, color, align, plate:{c,a,mode:\"box|lines\"}}. id шарів можна не вказувати.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"title":{"type":"string"},"size":{"type":"string","enum":["ig_post","ig_portrait","story","fb_post","yt_thumb","tg_post","banner","a4"]},"w":{"type":"integer"},"h":{"type":"integer"},"bg":{"type":"string"},"items":{"type":"array","items":{"type":"object","description":"Шар: id, type (image|text|shape|icon|grid), x, y, w, h, rot, opacity, text/rich, font, fontSize, weight, color, align, plate, stroke, shadow, media (id фото медіатеки), fill, shape…"}}},"required":["title"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/photo_design_update":{"post":{"tags":["Інструменти: Фоторедактор"],"operationId":"tool_photo_design_update","summary":"Фоторедактор: змінити шари (зміни)","description":"Змінити креатив: set — [{id, …властивості}] (null прибирає властивість), add — нові шари нагору, fields — {slot: значення} (текст для текстових полів, id фото медіатеки для фото-полів), bg — колір фону. Шари не видаляє. Перед змінами в історії макета зберігається версія «Перед змінами агента».\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"design_id":{"type":["integer","string"]},"set":{"type":"array","items":{"type":"object","description":"Шар: id, type (image|text|shape|icon|grid), x, y, w, h, rot, opacity, text/rich, font, fontSize, weight, color, align, plate, stroke, shadow, media (id фото медіатеки), fill, shape…"}},"add":{"type":"array","items":{"type":"object","description":"Шар: id, type (image|text|shape|icon|grid), x, y, w, h, rot, opacity, text/rich, font, fontSize, weight, color, align, plate, stroke, shadow, media (id фото медіатеки), fill, shape…"}},"fields":{"type":"object"},"bg":{"type":"string"}},"required":["design_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/photo_brand_get":{"post":{"tags":["Інструменти: Фоторедактор"],"operationId":"tool_photo_brand_get","summary":"Фоторедактор: бренд-кіт","description":"Бренд-кіт проєкту: кольори, стилі тексту (шрифт, товщина, k — розмір як частка меншої сторони полотна), шрифти бренду, лого (id фото медіатеки).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/photo_cutout":{"post":{"tags":["Інструменти: Фоторедактор"],"operationId":"tool_photo_cutout","summary":"Фоторедактор: прибрати фон з фото (зміни)","description":"Поставити фото медіатеки в чергу вирізки фону (сервер обробляє по одному, ліміт на проєкт за добу). Повертає завдання: status queued|running|done|failed, position, eta (с). Коли done — result_id: новий PNG без фону в медіатеці. Те саме фото вдруге віддається готовим одразу.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"media_id":{"type":["integer","string"]}},"required":["media_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/photo_job_get":{"post":{"tags":["Інструменти: Фоторедактор"],"operationId":"tool_photo_job_get","summary":"Фоторедактор: стан вирізки фону","description":"Стан завдання вирізки фону за job_id.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"job_id":{"type":["integer","string"]}},"required":["job_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/decks_list":{"post":{"tags":["Інструменти: Презентації"],"operationId":"tool_decks_list","summary":"Презентації: список","description":"Презентації проєкту: id, назва, формат, скільки слайдів, коли змінено, editor_url. templates=true — шаблони проєкту.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"q":{"type":"string","description":"Пошуковий рядок."},"templates":{"type":"boolean"}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/deck_get":{"post":{"tags":["Інструменти: Презентації"],"operationId":"tool_deck_get","summary":"Презентації: слайди","description":"Слайди презентації в порядку показу: slide_id, номер, макет, вміст за полями (title, subtitle, text, items, photo…), нотатки спікера, чи прихований. full=true — ще й шари кожного слайда з координатами (великий обсяг даних; це формат поля doc слайда).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"deck_id":{"type":["integer","string"]},"full":{"type":"boolean"}},"required":["deck_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/deck_layouts_list":{"post":{"tags":["Інструменти: Презентації"],"operationId":"tool_deck_layouts_list","summary":"Презентації: макети, теми, формати, шаблони","description":"Довідник: макети слайдів (які поля вмісту бере кожен), готові теми, формати й шаблони цілих презентацій (готові — ключ template, свої шаблони проєкту — ключ from_template).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/deck_assets_search":{"post":{"tags":["Інструменти: Презентації"],"operationId":"tool_deck_assets_search","summary":"Презентації: пошук у бібліотеці елементів","description":"Готові елементи для слайдів — та сама бібліотека, що в людини в редакторі: іконки, 3D-об'єкти, наліпки, стрілки, мокапи, логотипи. q — слова українською чи англійською («гроші», «clock»); type — icons | 3d | stickers | arrows | mockups | brands. Повертає id елементів для поля decor слайда.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"q":{"type":"string","description":"Пошуковий рядок."},"type":{"type":"string","enum":["icons","3d","stickers","arrows","mockups","brands"]}},"required":["q"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/deck_create":{"post":{"tags":["Інструменти: Презентації"],"operationId":"tool_deck_create","summary":"Презентації: нова презентація (зміни)","description":"Нова презентація зі слайдів: slides — [{layout, title, subtitle, text, items, number, price, cta, photo, notes}] (макети: title, section, text, bullets, two, photo_right, photo_left, photo_full, quote, number, cards, steps, agenda, speaker, offer, final). Замість slides можна template (готовий шаблон: webinar, webinar_gold, guide, checklist, lesson) або from_template (id шаблону проєкту). Без слайдів і шаблону — один титульний слайд із назвою. Координати рахує сервер. Повертає editor_url — показ і експорт у редакторі.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"title":{"type":"string"},"size":{"type":"string","enum":["wide","classic","a4","a4_land","portrait","story"],"description":"Формат: wide — слайди 16:9 для вебінару, a4 — PDF-гайд чи чек-лист."},"theme":{"type":["string","object"],"description":"Готова тема (light, dark, navy, cream, mint, lavender, coral, lime, classic, wine, gold, noir, rose, ocean; преміум-оформлення «як у Canva» — gold, noir, rose, ocean), «brand» — кольори й шрифти бренд-кіту проєкту, або своя: {colors: {bg, text, muted, accent, accent2, surface}, fonts: {head, body}, trans: none|fade|slide} (trans — перехід між слайдами, none — одразу)."},"slides":{"type":"array","items":{"type":"object","properties":{"layout":{"type":"string","enum":["title","section","text","bullets","two","photo_right","photo_left","photo_full","quote","number","cards","steps","agenda","speaker","offer","final"],"description":"Макет слайда."},"title":{"type":"string"},"subtitle":{"type":"string"},"text":{"type":"string","description":"Текст слайда; абзаци — через перенос рядка."},"items":{"type":"array","description":"Пункти: рядки або {title, text}. До 8.","items":{"type":["string","object"]}},"number":{"type":"string","description":"Велика цифра для макета number: «87%», «2 000+»."},"price":{"type":"string","description":"Ціна для макета offer: «4 900 грн»."},"cta":{"type":"string","description":"Напис на кнопці (offer, final)."},"photo":{"type":"integer","description":"id фото з медіатеки проєкту."},"notes":{"type":"string","description":"Нотатки спікера: глядачі їх не бачать."},"decor":{"type":"string","description":"Декор у кутку слайда: id елемента бібліотеки («fluent3d:money-bag», «emoji:rocket») або слова для пошуку («мішок грошей»). Мокап («mockups:phone», «mockups:laptop», «mockups:book») стає рамкою праворуч, а photo — фото в ній."}},"required":["layout"]}},"template":{"type":"string","enum":["webinar","webinar_gold","guide","checklist","lesson"]},"from_template":{"type":"integer"}},"required":["title"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/deck_from_outline":{"post":{"tags":["Інструменти: Презентації"],"operationId":"tool_deck_from_outline","summary":"Презентації: презентація з плану (зміни)","description":"Нова презентація з плану текстом. «# Заголовок» починає слайд, «## » — підзаголовок, «- пункт» і «1. крок» — пункти («Назва: пояснення» стає пунктом із заголовком і текстом), «> » — цитата, рядки «Нотатки: …», «Ціна: …», «Кнопка: …», «Цифра: …», «Макет: cards» — відповідні поля, решта рядків — текст слайда. Макет підбирається за вмістом (перший слайд — титул, нумеровані пункти — кроки, пункти з поясненнями — картки, лише заголовок — заставка розділу). Повертає editor_url.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"title":{"type":"string"},"outline":{"type":"string","description":"План презентації, до 100 слайдів."},"size":{"type":"string","enum":["wide","classic","a4","a4_land","portrait","story"],"description":"Формат: wide — слайди 16:9 для вебінару, a4 — PDF-гайд чи чек-лист."},"theme":{"type":["string","object"],"description":"Готова тема (light, dark, navy, cream, mint, lavender, coral, lime, classic, wine, gold, noir, rose, ocean; преміум-оформлення «як у Canva» — gold, noir, rose, ocean), «brand» — кольори й шрифти бренд-кіту проєкту, або своя: {colors: {bg, text, muted, accent, accent2, surface}, fonts: {head, body}, trans: none|fade|slide} (trans — перехід між слайдами, none — одразу)."}},"required":["title","outline"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/deck_slide_add":{"post":{"tags":["Інструменти: Презентації"],"operationId":"tool_deck_slide_add","summary":"Презентації: додати слайд (зміни)","description":"Додати слайд за макетом: layout і вміст (title, subtitle, text, items, number, price, cta, photo, notes). after — slide_id, після якого вставити слайд; без нього — в кінець. Перед першою зміною через MCP в історії зберігається версія «Перед змінами агента».\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"deck_id":{"type":["integer","string"]},"after":{"type":"string"},"layout":{"type":"string","enum":["title","section","text","bullets","two","photo_right","photo_left","photo_full","quote","number","cards","steps","agenda","speaker","offer","final"],"description":"Макет слайда."},"title":{"type":"string"},"subtitle":{"type":"string"},"text":{"type":"string","description":"Текст слайда; абзаци — через перенос рядка."},"items":{"type":"array","description":"Пункти: рядки або {title, text}. До 8.","items":{"type":["string","object"]}},"number":{"type":"string","description":"Велика цифра для макета number: «87%», «2 000+»."},"price":{"type":"string","description":"Ціна для макета offer: «4 900 грн»."},"cta":{"type":"string","description":"Напис на кнопці (offer, final)."},"photo":{"type":["integer","string"],"description":"id фото з медіатеки проєкту."},"notes":{"type":"string","description":"Нотатки спікера: глядачі їх не бачать."},"decor":{"type":"string","description":"Декор у кутку слайда: id елемента бібліотеки («fluent3d:money-bag», «emoji:rocket») або слова для пошуку («мішок грошей»). Мокап («mockups:phone», «mockups:laptop», «mockups:book») стає рамкою праворуч, а photo — фото в ній."}},"required":["deck_id","layout"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/deck_slide_update":{"post":{"tags":["Інструменти: Презентації"],"operationId":"tool_deck_slide_update","summary":"Презентації: змінити слайд (зміни)","description":"Змінити слайд за slide_id. Поля вмісту (title, text, items…) замінюють відповідні поля слайда, решта вмісту лишається; layout — перекласти той самий вміст в інший макет. УВАГА: слайд при цьому збирається за макетом наново — те, що людина розставила вручну, зникне (версія «Перед змінами агента» лишається в історії). notes і hidden змінюються без перезбирання. doc — замінити шари слайда цілком (формат — як у шарах повного вмісту презентації, full=true).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"deck_id":{"type":["integer","string"]},"slide_id":{"type":"string"},"hidden":{"type":"boolean"},"doc":{"type":"object","description":"Документ слайда цілком: {bg, items: [шари]}."},"layout":{"type":"string","enum":["title","section","text","bullets","two","photo_right","photo_left","photo_full","quote","number","cards","steps","agenda","speaker","offer","final"],"description":"Макет слайда."},"title":{"type":"string"},"subtitle":{"type":"string"},"text":{"type":"string","description":"Текст слайда; абзаци — через перенос рядка."},"items":{"type":"array","description":"Пункти: рядки або {title, text}. До 8.","items":{"type":["string","object"]}},"number":{"type":"string","description":"Велика цифра для макета number: «87%», «2 000+»."},"price":{"type":"string","description":"Ціна для макета offer: «4 900 грн»."},"cta":{"type":"string","description":"Напис на кнопці (offer, final)."},"photo":{"type":["integer","string"],"description":"id фото з медіатеки проєкту."},"notes":{"type":"string","description":"Нотатки спікера: глядачі їх не бачать."},"decor":{"type":"string","description":"Декор у кутку слайда: id елемента бібліотеки («fluent3d:money-bag», «emoji:rocket») або слова для пошуку («мішок грошей»). Мокап («mockups:phone», «mockups:laptop», «mockups:book») стає рамкою праворуч, а photo — фото в ній."}},"required":["deck_id","slide_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/deck_theme_set":{"post":{"tags":["Інструменти: Презентації"],"operationId":"tool_deck_theme_set","summary":"Презентації: змінити тему (зміни)","description":"Перефарбувати всю презентацію: усе, що було в кольорах і шрифтах попередньої теми, стає в нових; підібране людиною вручну не змінюється. theme — готова тема, «brand» або своя.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"deck_id":{"type":["integer","string"]},"theme":{"type":["string","object"],"description":"Готова тема (light, dark, navy, cream, mint, lavender, coral, lime, classic, wine, gold, noir, rose, ocean; преміум-оформлення «як у Canva» — gold, noir, rose, ocean), «brand» — кольори й шрифти бренд-кіту проєкту, або своя: {colors: {bg, text, muted, accent, accent2, surface}, fonts: {head, body}, trans: none|fade|slide} (trans — перехід між слайдами, none — одразу)."}},"required":["deck_id","theme"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/studios_list":{"post":{"tags":["Інструменти: Студія"],"operationId":"tool_studios_list","summary":"Студія: список","description":"Студії проєкту (ефіри на YouTube з браузера): id, назва, чи йде зараз ефір, чи задано ключ трансляції, посилання для спікерів (якщо ввімкнене), коли був останній ефір, studio_url. В ефір виходять лише вручну, на сторінці studio_url.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/studio_broadcasts":{"post":{"tags":["Інструменти: Студія"],"operationId":"tool_studio_broadcasts","summary":"Студія: ефіри","description":"Минулі ефіри студії: коли почався, скільки тривав (секунд), чому завершився (host — ведучий, host_gone — ведучий зник, never_started, too_long), стан запису (ready, processing, failed, none) і media_id запису в медіатеці. current — ефір, що йде просто зараз, або null.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"studio_id":{"type":["integer","string"]},"limit":{"type":"integer","description":"Скільки останніх ефірів, до 100 (типово 20)."}},"required":["studio_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/studio_schema":{"post":{"tags":["Інструменти: Студія"],"operationId":"tool_studio_schema","summary":"Студія: формат сцени","description":"Довідник формату сцени: з чого складається сцена (розкладка або вільні елементи, фон, оформлення, звук, перехід), які значення дозволені, ліміти й приклад. Координати вільної сцени — у віртуальному кадрі студії (поле virtual студії).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/studio_get":{"post":{"tags":["Інструменти: Студія"],"operationId":"tool_studio_get","summary":"Студія: сцени","description":"Студія цілком: кадр ефіру (frame) і віртуальний кадр для координат (virtual), сцени з усіма налаштуваннями, спільні банери й рядок, що біжить, перехід між сценами, version, чи йде ефір, studio_url.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"studio_id":{"type":["integer","string"]}},"required":["studio_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/studio_scene_create":{"post":{"tags":["Інструменти: Студія"],"operationId":"tool_studio_scene_create","summary":"Студія: нова сцена (зміни)","description":"Додати сцену в студію. scene — об'єкт сцени у форматі студії (досить name і того, що відрізняється від типового); або template — id шаблону сцени, b:… чи t:… (готова сцена, вписана в кадр студії; name перейменує її). Сцена додається в кінець і не виходить в ефір сама. Під час ефіру студію змінювати не можна. Повертає scene_id.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"studio_id":{"type":["integer","string"]},"name":{"type":"string"},"scene":{"type":"object"},"template":{"type":"string"}},"required":["studio_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/studio_scene_update":{"post":{"tags":["Інструменти: Студія"],"operationId":"tool_studio_scene_update","summary":"Студія: змінити сцену (зміни)","description":"Часткова правка сцени: у patch — лише те, що змінюється (name, mode, layout, sources, bg, tile, items, look, audio, trans). look і audio зливаються з наявними по ключах; items, sources і bg замінюються цілком — щоб змінити один елемент, передається весь список items із цією зміною. Під час ефіру студію змінювати не можна.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"studio_id":{"type":["integer","string"]},"scene_id":{"type":"string"},"patch":{"type":"object"}},"required":["studio_id","scene_id","patch"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/studio_update":{"post":{"tags":["Інструменти: Студія"],"operationId":"tool_studio_update","summary":"Студія: банери, рядок, перехід (зміни)","description":"Спільне для всіх сцен студії: banners — тексти банерів (до 30, кожен до 140 знаків; список замінюється цілком), ticker — рядок, що біжить (до 300 знаків), host_name — ім'я ведучого на плашці (порожнє — з облікового запису), transition — перехід між сценами {kind: cut|fade|slide|zoom|dip, ms, color}. Змінюються лише передані поля. Який банер зараз в ефірі, вирішує ведучий. Під час ефіру студію змінювати не можна.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"studio_id":{"type":["integer","string"]},"banners":{"type":"array","items":{"type":"string"}},"ticker":{"type":"string"},"host_name":{"type":"string"},"transition":{"type":"object"}},"required":["studio_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/studio_scene_copy":{"post":{"tags":["Інструменти: Студія"],"operationId":"tool_studio_scene_copy","summary":"Студія: копія сцени в іншу студію (зміни)","description":"Скопіювати сцену в іншу студію — цього ж проєкту або іншого (to_project — слаг; типово цей). Файли сцени (фон, картинки, музика, відео) в інший проєкт копіюються в його «Файли»; чого перенести не вдалось — прибирається, про це warnings. У студію, що в ефірі, копіювати не можна.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"studio_id":{"type":["integer","string"]},"scene_id":{"type":"string"},"to_studio_id":{"type":["integer","string"]},"to_project":{"type":"string"}},"required":["studio_id","scene_id","to_studio_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/studio_templates_list":{"post":{"tags":["Інструменти: Студія"],"operationId":"tool_studio_templates_list","summary":"Студія: шаблони сцен","description":"Шаблони сцен: готові (id «b:…») і свої, збережені з усіх проєктів (id «t:…»): назва, проєкт, кадр, під який зроблено, і короткий опис сцени.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/studio_template_save":{"post":{"tags":["Інструменти: Студія"],"operationId":"tool_studio_template_save","summary":"Студія: сцену — в шаблони (зміни)","description":"Зберегти сцену студії як шаблон проєкту: далі з нього можна робити сцени в будь-якій студії. Повертає template — id шаблону.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"studio_id":{"type":["integer","string"]},"scene_id":{"type":"string"},"name":{"type":"string"}},"required":["studio_id","scene_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/ads_overview":{"post":{"tags":["Інструменти: Реклама"],"operationId":"tool_ads_overview","summary":"Реклама: огляд","description":"Підсумки реклами Meta за період: витрати в ₴ (за курсом НБУ дня витрати), заявки й ціна заявки, скільки людей з реклами були на вебінарі, оплати, виручка (нетто), ROAS і ROMI, зміна до попереднього такого ж періоду, кількість заявок з Facebook/Instagram без мітки ad_id. Когорта: людині зараховуються вебінари й оплати ПІСЛЯ її заявки, тож ROAS свіжого періоду ще зростатиме.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"range":{"type":"object","description":"Період: period — today|yesterday або 7|14|30|90 повних днів до вчора (без сьогодні, як в Ads Manager), або from/to — дати YYYY-MM-DD. Без нього — 30 днів.","properties":{"period":{"type":"string","enum":["today","yesterday","7","14","30","90"]},"from":{"type":"string"},"to":{"type":"string"}}},"model":{"type":"string","enum":["last","first"],"description":"Атрибуція: last — оголошення з заявки (за замовчуванням), first — з першої мітки людини."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/ads_campaigns":{"post":{"tags":["Інструменти: Реклама"],"operationId":"tool_ads_campaigns","summary":"Реклама: кампанії","description":"Кампанії → адсети з витратами Meta й нашими результатами (заявки, вебінар, оплати, виручка, ROAS) за період.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"range":{"type":"object","description":"Період: period — today|yesterday або 7|14|30|90 повних днів до вчора (без сьогодні, як в Ads Manager), або from/to — дати YYYY-MM-DD. Без нього — 30 днів.","properties":{"period":{"type":"string","enum":["today","yesterday","7","14","30","90"]},"from":{"type":"string"},"to":{"type":"string"}}},"model":{"type":"string","enum":["last","first"],"description":"Атрибуція: last — оголошення з заявки (за замовчуванням), first — з першої мітки людини."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/ads_creatives":{"post":{"tags":["Інструменти: Реклама"],"operationId":"tool_ads_creatives","summary":"Реклама: креативи","description":"Оголошення (креативи) за період з метриками Meta (CTR, CPM, частота, hook — 3 с перегляду / покази, hold — ThruPlay / 3 с) і нашими (заявки, ціна заявки, вебінар, оплати, ROAS), оцінки hook/hold/click 0–100 відносно середнього по кабінету (50 — середнє), позначки winner / fatigue / tracked. sort: spend|roas|cpl|leads. Тексти креативу тут не віддаються.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"range":{"type":"object","description":"Період: period — today|yesterday або 7|14|30|90 повних днів до вчора (без сьогодні, як в Ads Manager), або from/to — дати YYYY-MM-DD. Без нього — 30 днів.","properties":{"period":{"type":"string","enum":["today","yesterday","7","14","30","90"]},"from":{"type":"string"},"to":{"type":"string"}}},"model":{"type":"string","enum":["last","first"],"description":"Атрибуція: last — оголошення з заявки (за замовчуванням), first — з першої мітки людини."},"sort":{"type":"string","enum":["spend","roas","cpl","leads"]},"limit":{"type":"integer","description":"До 100, за замовчуванням 30."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/ads_creative_get":{"post":{"tags":["Інструменти: Реклама"],"operationId":"tool_ads_creative_get","summary":"Реклама: креатив","description":"Один креатив: тексти, посилання, url_tags, метрики за період, утримання відео (3 с / 25 / 50 / 75 / 100%) і до 50 людей, що прийшли з нього (заявка, скільки дивились вебінар, скільки заплатили).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"ad_id":{"type":"string"},"range":{"type":"object","description":"Період: period — today|yesterday або 7|14|30|90 повних днів до вчора (без сьогодні, як в Ads Manager), або from/to — дати YYYY-MM-DD. Без нього — 30 днів.","properties":{"period":{"type":"string","enum":["today","yesterday","7","14","30","90"]},"from":{"type":"string"},"to":{"type":"string"}}},"model":{"type":"string","enum":["last","first"],"description":"Атрибуція: last — оголошення з заявки (за замовчуванням), first — з першої мітки людини."}},"required":["ad_id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/ads_draft_create":{"post":{"tags":["Інструменти: Реклама"],"operationId":"tool_ads_draft_create","summary":"Реклама: чернетка кампанії (зміни)","description":"Створює ЧЕРНЕТКУ кампанії Meta в майстрі ProForms (Advantage+: бюджет на кампанію, широка аудиторія, автоплейсменти, один адсет, кожен файл — окреме оголошення). У Meta нічого не створюється: створює на паузі й запускає людина в адмінці за editor_url. objective — стандартна ціль Meta; destination — куди веде: website (link_url обов'язковий), messaging (channels: messenger|instagram|whatsapp, greeting — привітання), leadform (миттєва форму людина налаштує в майстрі), none (лише для awareness). goal — на що оптимізувати (порожньо — рекомендоване Meta), event — подія на сайті для конверсійних цілей. link_url — адреса форми (/f/…), сторінки сайту чи посилання на оплату цього проєкту (лише адреси, доступні рекламі проєкту). media_ids — фото/відео медіатеки. Мітки utm+ad_id ставляться самі. budget — на день у валюті кабінету. Ручні ставки, кілька аудиторій і бюджет на адсет людина задає в «Додатково» майстра.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"name":{"type":"string"},"objective":{"type":"string","enum":["awareness","traffic","engagement","leads","sales"]},"destination":{"type":"string","enum":["website","messaging","leadform","none"]},"goal":{"type":"string","description":"Ключ мети: awareness: reach, impressions, recall, thruplay; traffic: lpv, clicks, reach, conversations; engagement: conversations, conversions, lpv; leads: conversions, leads, quality, conversations; sales: conversions, value, conversations"},"event":{"type":"string","enum":["LEAD","COMPLETE_REGISTRATION","webinar","INITIATED_CHECKOUT","PURCHASE"]},"channels":{"type":"array","items":{"type":"string","enum":["messenger","instagram","whatsapp"]}},"greeting":{"type":"string"},"link_url":{"type":"string"},"media_ids":{"type":"array","items":{"type":["integer","string"]}},"message":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"cta":{"type":"string","enum":["LEARN_MORE","SIGN_UP","APPLY_NOW","SUBSCRIBE","SHOP_NOW","GET_OFFER","BOOK_NOW","CONTACT_US","DOWNLOAD","GET_QUOTE"]},"countries":{"type":"array","items":{"type":"string"}},"age_min":{"type":"integer"},"age_max":{"type":"integer"},"budget":{"type":"number"}},"required":["objective"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/ads_link_options":{"post":{"tags":["Інструменти: Реклама"],"operationId":"tool_ads_link_options","summary":"Реклама: куди може вести","description":"Адреси, на які може вести реклама з майстра: форми, сторінки опублікованих сайтів, посилання на оплату.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/ads_pause":{"post":{"tags":["Інструменти: Реклама"],"operationId":"tool_ads_pause","summary":"Реклама: пауза (зміни)","description":"Ставить на паузу оголошення, адсет чи кампанію Meta (id оголошення, адсету чи кампанії). Увімкнути назад і змінити бюджет може лише людина в адмінці.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":"string"}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_overview":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_overview","summary":"База знань клієнта: огляд","description":"Огляд бази знань клієнта: правила ведення бази (guide), профіль клієнта, скільки нотаток кожного типу, чинні рішення, останні зустрічі й журнал останніх змін.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_search":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_search","summary":"Пошук у базі знань","description":"Шукає нотатки за словами в назві й тексті. Слова шукаються за початком («бюджет» знайде «бюджету»), нотатка має містити всі слова, тож 1–3 ключові слова знаходять більше, ніж фраза. snippet — фрагмент зі збігом у **зірочках**. Закриті рішення теж знаходяться (поле status). in=sources — шукати не в нотатках, а в репліках транскриптів: хто й коли це сказав (source — id транскрипту, seq — номер репліки, t — час; цитата — [[src:ID@ГГ:ХХ:СС]]).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"q":{"type":"string","description":"Пошуковий рядок."},"type":{"type":"string","description":"Ключ типу нотаток (profile, meeting, decision, person… і власні типи команди)."},"tag":{"type":"string","description":"Лише нотатки з цим #тегом."},"in":{"type":"string","enum":["notes","sources"]}},"required":["q"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_list":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_list","summary":"Нотатки бази знань","description":"Список нотаток без тексту: за типом (ключ типу) і статусом. Зустрічі й рішення — від найновіших за датою. status: active — лише чинні рішення. origin — знайти нотатку, перенесену з цього джерела (ключ origin, заданий при створенні чи перенесенні).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"type":{"type":"string","description":"Ключ типу нотаток (profile, meeting, decision, person… і власні типи команди)."},"status":{"type":"string","enum":["active","superseded","cancelled"]},"origin":{"type":"string"},"tag":{"type":"string","description":"Лише нотатки з цим #тегом."},"page":{"type":["integer","string"],"minimum":1,"description":"Сторінка, з 1."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_read":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_read","summary":"Прочитати нотатку","description":"Нотатка цілком: текст (markdown), властивості, статус, rev (номер версії для точкової правки), куди посилається (links) і хто посилається на неї (backlinks, із рядком, де згадано). У довгій нотатці: outline=true — лише заголовки розділів без тексту; section — один розділ за назвою заголовка. expand=true — розгорнути вставки ![[Нотатка#Розділ]] цитатами з джерела (лише для читання: у збереженому тексті вставки лишаються нерозгорнутими).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"note":{"type":["integer","string"],"description":"id нотатки або її точна назва."},"section":{"type":"string","description":"Назва заголовка розділу."},"outline":{"type":"boolean"},"expand":{"type":"boolean"}},"required":["note"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_create":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_create","summary":"Нова нотатка (зміни)","description":"Створює нотатку й одразу зберігає (чернеток немає; людина бачить запис у журналі й може відкотити). Точний дубль назви — помилка з id наявної нотатки, схожі нотатки повертаються в similar. type — ключ типу нотаток. body — markdown, зв'язки — [[Назва нотатки]]; без body ставиться шаблон типу: template — id чи назва шаблону (без нього — перший). props — {ключ властивості: значення} за описом типу. date — РРРР-ММ-ДД (для типів із dated: зустріч, рішення). source — id транскрипту, з якого зроблено цю нотатку зустрічі: транскрипт буде позначено розібраним. aliases — інші назви списком. internal=true — нотатка лише для команди (клієнт, якому відкрили базу знань, її не бачить): правила роботи, оцінки клієнта, доступи. origin — ключ джерела при перенесенні з іншої системи (адреса сторінки): якщо нотатка з таким origin уже є, вона ОНОВЛЮЄТЬСЯ, а не створюється вдруге. Властивості виду secret (тип «Доступи») шифруються, і прочитати їх назад не можна; текст нотатки не шифрується.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"type":{"type":"string","description":"Ключ типу нотаток (profile, meeting, decision, person… і власні типи команди)."},"title":{"type":"string"},"body":{"type":"string"},"props":{"type":"object"},"date":{"type":"string"},"template":{"type":["integer","string"]},"source":{"type":["integer","string"]},"aliases":{"type":"array","items":{"type":"string"}},"internal":{"type":"boolean"},"origin":{"type":"string"},"summary":{"type":"string","description":"Одним реченням: що і навіщо змінено. Це бачить команда в журналі."}},"required":["type","title","summary"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_append":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_append","summary":"Дописати в нотатку (зміни)","description":"Дописує text у кінець нотатки або в кінець розділу section (назва заголовка). rev не потрібен: текст додається до поточного стану, тож правка людини, зроблена хвилину тому, не зникне. Наявний текст не змінюється.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"note":{"type":["integer","string"],"description":"id нотатки або її точна назва."},"text":{"type":"string"},"section":{"type":"string"},"summary":{"type":"string","description":"Одним реченням: що і навіщо змінено. Це бачить команда в журналі."}},"required":["note","text","summary"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_patch":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_patch","summary":"Змінити нотатку (зміни)","description":"Точкова правка наявної нотатки. rev (номер версії нотатки) обов'язковий — захищає від затирання правки, зробленої після цієї версії. Один зі способів змінити текст: section + content — замінити вміст розділу (заголовок лишається); find + replace — замінити фрагмент, який трапляється в тексті рівно один раз; body — увесь текст цілком. Також: title (стара назва лишиться іншою назвою, посилання не зламаються), props, date, aliases (інші назви списком), internal (true — лише для команди), archived=true — перенести в архів, archived=false — повернути з архіву (note — id). Захищену властивість (пароль) можна записати чи стерти (порожній рядок) через props, але не прочитати.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"note":{"type":["integer","string"],"description":"id нотатки або її точна назва."},"rev":{"type":"integer"},"summary":{"type":"string","description":"Одним реченням: що і навіщо змінено. Це бачить команда в журналі."},"section":{"type":"string"},"content":{"type":"string"},"find":{"type":"string"},"replace":{"type":"string"},"body":{"type":"string"},"title":{"type":"string"},"props":{"type":"object"},"date":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"internal":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["note","summary"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_import":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_import","summary":"Перенести кілька нотаток одразу (зміни)","description":"Пакетне створення: до 25 нотаток за виклик — для перенесення з іншої системи (Notion, Obsidian, таблиці). Кожен елемент items — поля нової нотатки: type, title, body, props, date, aliases, internal, origin, template. origin — адреса вихідної сторінки чи стабільний ключ: повторний виклик з тими самими origin оновлює ті самі нотатки, а не створює дублікати. Посилання [[Назва]] між нотатками пакета зв'яжуться самі, порядок не важливий. Помилка в одному елементі не зупиняє решту: у відповіді для кожного — created / updated / unchanged або error.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"items":{"type":"array","items":{"type":"object"},"maxItems":25},"summary":{"type":"string","description":"Одним реченням: що і навіщо змінено. Це бачить команда в журналі."}},"required":["items","summary"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_type_get":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_type_get","summary":"Тип нотаток докладно","description":"Один тип: властивості з їхніми ключами, видами й варіантами та повний текст кожного шаблону.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"type":{"type":"string","description":"Ключ типу нотаток (profile, meeting, decision, person… і власні типи команди)."}},"required":["type"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_refs_find":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_refs_find","summary":"Знайти об'єкт ProForms для посилання","description":"За адресою чи назвою повертає посилання для тексту нотатки: [[pf:вид:id]]. Розуміє публічні адреси (кнопка оплати …/pay/button/…, форма …/f/…, бот t.me/…?start=…, сторінка сайту клієнта) й адреси з адмінки. У нотатці таке посилання показує живу назву й стан об'єкта, а зі знаком оклику (![[pf:…]]) — сам об'єкт вікном.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"q":{"type":"string","description":"Адреса (URL) або частина назви."}},"required":["q"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_query":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_query","summary":"Нотатки за властивостями","description":"Відповідає на «які запуски були дорожчі за 2000», «чинні рішення про ціни», «усе з тегом ризик». query — рядки «ключ: значення»: type (ключ чи назва типу), where (умови через «;»: поле оператор значення), sort (поле і asc/desc), limit. Поля: title, date, status, updated, tag і властивості типу (ключ або назва). Оператори: = != > < >= <= ~ (містить). Приклад: \"type: launch\\nwhere: budget > 2000; status = active\\nsort: starts_on desc\". Той самий текст у блоці ```kb в нотатці показує людині живий список.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"query":{"type":"string"}},"required":["query"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_tasks":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_tasks","summary":"Завдання з нотаток","description":"Усі завдання («- [ ] …») з нотаток клієнта: що відкрито, чиє, до якого строку. Типово — лише відкриті. assignee — назва нотатки людини, на яку посилається рядок завдання; overdue=true — лише прострочені; note — завдання однієї нотатки; done=true — виконані. Завдання в нотатці — рядок «- [ ] текст [[Людина]] до 12.10».\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"done":{"type":"boolean"},"assignee":{"type":"string"},"overdue":{"type":"boolean"},"note":{"type":["integer","string"],"description":"id нотатки або її точна назва."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_task_done":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_task_done","summary":"Позначити завдання виконаним (зміни)","description":"Ставить галочку в рядку завдання в самій нотатці (нова версія з поясненням). note — нотатка із завданням, task — його текст точно як у нотатці. done=false — повернути в роботу.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"note":{"type":["integer","string"],"description":"id нотатки або її точна назва."},"task":{"type":"string"},"done":{"type":"boolean"}},"required":["note","task"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_capture":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_capture","summary":"Швидкий запис у щоденник (зміни)","description":"Дописує рядок із часом у нотатку сьогоднішнього дня (створює її, якщо ще немає). Для факту, якому ще не знайшли місця: «клієнт просить перенести ефір».\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"text":{"type":"string"}},"required":["text"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_share":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_share","summary":"Посилання на нотатку (зміни)","description":"Відкрити нотатку за посиланням поза командою або закрити. mode: view — сторінку читає будь-хто з посиланням, без входу (інструкція для користувачів); edit — людина з посиланням називається і править текст, правки видно в історії як «Ім'я (гість)»; off — закрити. days — скільки діє (без нього — без обмежень). Посилання [[…]] з нотатки клікабельні для гостя лише на нотатки з відкритим посиланням. Нотатки internal (лише команда) відкрити не можна. Повертає url.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"note":{"type":["integer","string"],"description":"id нотатки або її точна назва."},"mode":{"type":"string","enum":["off","view","edit"]},"days":{"type":"integer","minimum":1,"maximum":365}},"required":["note","mode"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_merge":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_merge","summary":"Злити дві нотатки (зміни)","description":"Прибирає дублікат: текст нотатки from дописується в into окремим розділом, її назва стає іншою назвою into (усі посилання [[…]] на неї далі працюють і ведуть на into), сама from іде в архів. Для двох записів про одну людину, продукт чи воронку. Захищені поля (паролі) з from не переносяться. Повтори в тексті into не прибираються автоматично.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"from":{"type":["integer","string"],"description":"id нотатки або її точна назва."},"into":{"type":["integer","string"],"description":"id нотатки або її точна назва."},"summary":{"type":"string","description":"Одним реченням: що і навіщо змінено. Це бачить команда в журналі."}},"required":["from","into","summary"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_supersede":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_supersede","summary":"Закрити рішення (зміни)","description":"Позначає рішення (нотатку типу decision чи іншого типу з closable) таким, що більше не діє. by — id чи назва нотатки, яка його замінює (нотатка-заміна має вже існувати); cancel=true — скасовано без заміни; reopen=true — знову чинне. Старе рішення лишається в базі з позначкою — так видно історію домовленостей. reason — чому.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"decision":{"type":["integer","string"],"description":"id нотатки або її точна назва."},"by":{"type":["integer","string"],"description":"id нотатки або її точна назва."},"cancel":{"type":"boolean"},"reopen":{"type":"boolean"},"reason":{"type":"string"}},"required":["decision","reason"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_sources_list":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_sources_list","summary":"Транскрипти зустрічей","description":"Сирі транскрипти розмов із клієнтом: id, назва, дата, тривалість, мовці, стан. status: new — ще не розібрано (нотатки зустрічі немає), processed — нотатка є (note), ignored — не потрібне.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"status":{"type":"string","enum":["new","processed","ignored"]}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_source_read":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_source_read","summary":"Прочитати транскрипт","description":"Репліки транскрипту по порядку: seq (номер), t (час ГГ:ХХ:СС), speaker, text. Довгий транскрипт віддається частинами: next — seq початку наступної частини (для from); порожнє next — кінець транскрипту. Формат посилання на репліку в нотатці: [[src:ID@ГГ:ХХ:СС]].\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"source":{"type":["integer","string"],"description":"id транскрипту."},"from":{"type":"integer","description":"З якої репліки (seq); без нього — з початку."}},"required":["source"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_source_add":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_source_add","summary":"Додати транскрипт (зміни)","description":"Кладе в базу знань сирий транскрипт розмови (людина вставила його в чат або дала файлом): text — VTT чи звичайний текст із репліками «Ім'я: слова», за змоги з часом. Транскрипт зберігається без змін і не редагується. Повертає id транскрипту. Той самий текст двічі не додається.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"title":{"type":"string"},"text":{"type":"string"},"date":{"type":"string","description":"Дата зустрічі, РРРР-ММ-ДД."}},"required":["title","text"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_type_create":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_type_create","summary":"Новий тип нотаток (зміни)","description":"Додає власний тип нотаток у ЦЕЙ проєкт (спільні для всіх проєктів типи налаштовуються в адмінці). Тип описує окремий вид сутностей («Оффер», «Конкурент»). label — назва в однині, plural — у множині, hint — що сюди писати. fields — властивості: [{label, kind, options?}], kind — text | number | date | select | url | note | secret (для select потрібні options). dated — має дату; closable — можна закривати, як рішення; single — одна на проєкт. template — markdown-заготовка тексту з розділами «## Назва». icon — file, brand, chat, check, user, users, tag, flag, goal, chart, card, lead, phone, video, mic, image, heart, fire, gift, pin, globe, link, bell, lock, gear, sheet, list, template, layers, hash, info, folder, bot, eye, present, board.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"label":{"type":"string"},"plural":{"type":"string"},"hint":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string","description":"#rrggbb"},"fields":{"type":"array","items":{"type":"object"}},"dated":{"type":"boolean"},"closable":{"type":"boolean"},"single":{"type":"boolean"},"template":{"type":"string"}},"required":["label"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/kb_type_update":{"post":{"tags":["Інструменти: База знань"],"operationId":"tool_kb_type_update","summary":"Змінити тип нотаток проєкту (зміни)","description":"Змінює тип ЦЬОГО проєкту (спільні типи змінює лише адміністратор платформи). Правка часткова. fields — повний новий список властивостей; властивість без свого наявного key вважається новою, і її значення в нотатках губляться. template — {name, body}: додати шаблон або замінити наявний із такою назвою.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"type":{"type":"string","description":"Ключ типу нотаток (profile, meeting, decision, person… і власні типи команди)."},"label":{"type":"string"},"plural":{"type":"string"},"hint":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"fields":{"type":"array","items":{"type":"object"}},"dated":{"type":"boolean"},"closable":{"type":"boolean"},"template":{"type":"object"}},"required":["type"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnels_list":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnels_list","summary":"Воронки проєкту","description":"Воронки з підсумком за період: скільки людей зайшло, скільки дійшли до останнього кроку, конверсія й виручка. Період — це коли людина УВІЙШЛА у воронку; кроки й оплати цих забігів беруться на сьогодні. outside — оплати поза воронками: кожна оплата належить одному забігу або жодному, тому суми по воронках плюс outside дорівнюють загальній виручці.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"period":{"type":"string","enum":["today","yesterday","7","30","all"],"description":"Період: сьогодні, вчора, 7 чи 30 останніх днів або весь час."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_get":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_get","summary":"Опис воронки","description":"Кроки воронки з цілями, вікна, входи. checks — слабкі місця, де номер забігу може загубитись. step_options — з чого можна вибирати ціль кроку в цьому проєкті (форми, платіжні посилання, боти, події, вебінари).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"funnel":{"type":["integer","string"],"description":"id воронки."},"options":{"type":"boolean","description":"Додати step_options — варіанти цілей для кроків воронки."}},"required":["funnel"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_stats":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_stats","summary":"Числа воронки","description":"Забіги за період по кроках: n, pct (від ПЕРШОГО кроку — кроки не ворота, їх можна пропустити), median_s (медіана часу від входу), skipped_prev (дійшли сюди, оминувши попередній крок). origins — «звідки зайшли»: реклама (з джерелами), органіка тощо. trust — як зійшлись кроки й оплати: підтверджено (номер забігу в посиланні чи бот) або оцінено (людина + термін guess_days від її останнього кроку). confirmed у кроці — скільки забігів дійшли сюди підтверджено: крок, де частка різко падає, — місце, де номер забігу губиться. У кроках оплати — revenue, revenue_confirmed і payments саме цього кроку. segment у відповіді — застосовані умови сегмента словами (порожньо — усі люди). У кроці з розрізом за міткою чи деталлю (параметр details; detail і detail_label кажуть, за чим розкладено) — breakdown: значення мітки (value; «-» — без мітки), n забігів, а в оплаті ще payments і revenue. В оплаті людина з кількома оплатами з різних джерел є в кожному з них: гроші по значеннях точні, а сума n може перевищити n кроку. З charts=true — ще дані графіків екрана: daily (по днях ВХОДУ: runs, steps{ключ: скільки з них дійшли}, revenue, mature — чи закрилось вікно; у днях із mature=false частки ще ростуть) і time_between (розподіл часу між кроками по кошиках і медіана; early — у кого другий крок стався раніше за перший). entry_form_views — покази форми першого кроку за період (покази, не люди). Також: cost_per_lead, cost_per_sale, avg_check, ltv, romi2, costs (ручні витрати за джерелом).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"funnel":{"type":["integer","string"],"description":"id воронки."},"period":{"type":"string","enum":["today","yesterday","7","30","all"],"description":"Період: сьогодні, вчора, 7 чи 30 останніх днів або весь час."},"charts":{"type":"boolean","description":"Додати daily і time_between — ті самі дані, з яких екран малює динаміку по днях і час між кроками."},"by_registrations":{"type":"boolean","description":"Рахувати від усіх реєстрацій, а не від людей: вхід і частки — від registrations. Типово — люди (runs); registrations і repeat_registrations віддаються завжди."},"by_event":{"type":"boolean","description":"Додати by_event — воронку за датою події: кожен крок рахується в день, коли відбувся (сходиться з касою й рекламним кабінетом за ті самі дні). Частки між кроками там умовні."},"details":{"type":"object","description":"Деталі кроків: {ключ кроку: деталь} — чим розкласти крок у цій відповіді (breakdown), не чіпаючи воронку. Готові деталі кожного кроку — в описі воронки (steps[].details.list): paid — tariff, pay_kind, paylink; lead і wreg — form; visit — page, device, time, visits (скільки разів заходив); wcame / wstay / wclick — session, watched. Де details.mark = true, годиться ще mark:<назва мітки адреси> (у події — ключ її data), де details.field = true — field:<ключ поля форми>, напр. field:game_date. Приклад: {\"s4\": \"tariff\", \"s1\": \"field:game_date\"}. Без деталі крок розкладається за своєю міткою, якщо вона є."},"segment":{"type":"array","description":"Сегмент — умови до людей воронки, через «і»; кожна про один крок (ключ кроку: s1, s2…): {step, reached: false} — не дійшов; {step, detail, value} — дійшов із таким значенням деталі (деталі — як у details кроку; value — значення з breakdown у числах воронки, «-» — без значення); {step, hour_from, hour_to} — у ці години доби (9 і 10 — від 9:00 до 9:59); {step, date_from, date_to} — у ці дні, РРРР-ММ-ДД; {step, weekdays: [1..7]} — дні тижня, 1 — понеділок; {step, before: ключ іншого кроку} — раніше, ніж дійшов до нього. Умови одного кроку можна скласти в один обʼєкт. Приклад «перший візит о 9–10 і потім доплатили»: [{\"step\":\"s2\",\"hour_from\":9,\"hour_to\":10},{\"step\":\"s5\"}]. У кроці зараховано перший факт людини. До 8 умов.","items":{"type":"object"}},"confirmed_only":{"type":"boolean","description":"Лише кроки й оплати, що зійшлись за номером забігу (без оцінених за терміном). revenue_confirmed і revenue_guess віддаються завжди."}},"required":["funnel"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_step_from":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_step_from","summary":"Звідки переходять у крок","description":"Який крок був у людей останнім перед вибраним — за часом, а не за порядком у списку (кроки не ворота). Відповідає на «після якого уроку найчастіше записуються на консультацію». step — ключ кроку; без нього — останній крок воронки (мета). from — попередні кроки від найчастішого: n, share (%), median_s (за скільки переходять). manual — скільки людей мають цільовий крок лише ручною відміткою: у розкладку вони не йдуть, бо справжнього часу там немає.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"funnel":{"type":["integer","string"],"description":"id воронки."},"period":{"type":"string","enum":["today","yesterday","7","30","all"],"description":"Період: сьогодні, вчора, 7 чи 30 останніх днів або весь час."},"step":{"type":"string","description":"Ключ кроку (s3, s4…). Без нього — останній крок."},"confirmed_only":{"type":"boolean","description":"Лише кроки, що зійшлись за номером забігу."}},"required":["funnel"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_runs":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_runs","summary":"Забіги: хто стоїть за числами","description":"Забіг — одне проходження однієї людини по одній воронці. steps_done — скільки кроків є, steps_skipped — скільки оминуто (далі кроки вже є), goal — чи досягнуто останній крок: мети можна дійти, пропустивши середину. Фільтри: reached / not_reached — ключ кроку (s1, s2…), status, origin, пошук. Або contact — усі забіги однієї людини в усіх воронках. Телефон маскований; повна картка контакту — за contact_id.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"funnel":{"type":["integer","string"],"description":"id воронки; не потрібен, якщо задано contact."},"contact":{"type":["integer","string"],"description":"id контакту — його забіги в усіх воронках."},"period":{"type":"string","enum":["today","yesterday","7","30","all"],"description":"Період: сьогодні, вчора, 7 чи 30 останніх днів або весь час."},"segment":{"type":"array","description":"Сегмент — умови до людей воронки, через «і»; кожна про один крок (ключ кроку: s1, s2…): {step, reached: false} — не дійшов; {step, detail, value} — дійшов із таким значенням деталі (деталі — як у details кроку; value — значення з breakdown у числах воронки, «-» — без значення); {step, hour_from, hour_to} — у ці години доби (9 і 10 — від 9:00 до 9:59); {step, date_from, date_to} — у ці дні, РРРР-ММ-ДД; {step, weekdays: [1..7]} — дні тижня, 1 — понеділок; {step, before: ключ іншого кроку} — раніше, ніж дійшов до нього. Умови одного кроку можна скласти в один обʼєкт. Приклад «перший візит о 9–10 і потім доплатили»: [{\"step\":\"s2\",\"hour_from\":9,\"hour_to\":10},{\"step\":\"s5\"}]. У кроці зараховано перший факт людини. До 8 умов.","items":{"type":"object"}},"reached":{"type":"string","description":"Ключ кроку, якого забіг досяг."},"mark":{"type":"string","description":"Разом із reached для кроку з розрізом: value з breakdown у числах воронки — лише забіги, що досягли кроку з цим значенням мітки («-» — без мітки)."},"not_reached":{"type":"string","description":"Ключ кроку, якого забіг НЕ досяг."},"status":{"type":"string","enum":["open","done","expired","reentered"]},"origin":{"type":"string","enum":["ads","funnel","organic","broadcast","manual"]},"repeat":{"type":"boolean","description":"Лише спроби з повторними реєстраціями (registrations > 1)."},"q":{"type":"string","description":"Пошуковий рядок."},"page":{"type":["integer","string"],"minimum":1,"description":"Сторінка, з 1."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_run":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_run","summary":"Один забіг покроково","description":"Кожен крок забігу: коли досягнуто, як зійшовся (вхід, за посиланням run=, з бота, за людиною й часом), сума оплат кроку. skipped — крок пропущено, а наступні досягнуто. match = manual — крок поставлено вручну.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"run":{"type":"string","description":"Номер забігу R_…."}},"required":["run"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_run_data_set":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_run_data_set","summary":"Записати значення в забіг (зміни)","description":"Своє значення в конкретний забіг воронки (тариф, дата ефіру, відповідь): далі воно підставляється як {{run.name}} у ланцюжках бота, адресах і вебхуках форм та оплат, а в бота — ще й {{run:#НОМЕР_воронки.name}}. Назва — латиниця, цифри й «_», з літери, до 40 знаків; до 50 значень на забіг, до 500 знаків кожне. Порожнє значення очищає.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"run":{"type":"string","description":"Номер забігу R_…."},"name":{"type":"string","description":"Назва значення, наприклад tariff."},"value":{"type":"string"}},"required":["run","name","value"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_step_mark":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_step_mark","summary":"Позначити крок вручну (зміни)","description":"Поставити людям крок воронки вручну — коли точно відомо, що вони його пройшли, а система цього не бачить (урок дивились до того, як зʼявилась подія; на ефірі були з іншого акаунта). Лише тим, хто вже у воронці: runs — номери забігів R_…, нових забігів відмітка не відкриває. Крок оплати й перший крок (вхід) так не ставляться; крок, який система вже бачить, лишається як є. У числах такі кроки йдуть окремо (manual у числах воронки, match = manual у забігу) і не зникають після перезбирання забігів. Ручна відмітка — твердження людини, а не слід у даних.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"runs":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":200,"description":"Номери забігів R_… — до 200 за виклик."},"step":{"type":"string","description":"Ключ кроку (s3, s4…)."},"at":{"type":"string","description":"Коли крок стався: 2026-10-09 або 2026-10-09 14:30. Без нього — зараз. Має бути між входом людини у воронку й цією хвилиною."},"note":{"type":"string","description":"Чому поставлено — до 200 символів."}},"required":["runs","step"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_step_unmark":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_step_unmark","summary":"Зняти ручну відмітку кроку (зміни)","description":"Прибирає крок, поставлений вручну (через MCP чи кнопкою в адмінці). Кроки, які побачила система, так не знімаються.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"run":{"type":"string","description":"Номер забігу R_…."},"step":{"type":"string","description":"Ключ кроку."}},"required":["run","step"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_events":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_events","summary":"Реєстр своїх подій","description":"Свої події проєкту («видали урок 1») з кількістю спрацювань за період. unmatched — події без людини: вони ні до якого забігу не дотягнуться. event_url — адреса, куди зовнішній бот чи сервіс (SendPulse, CRM) ставить подію: POST, JSON {\"event\": id або назва, \"lead\": \"L_…\"}; замість lead годяться phone, email, contact; необовʼязкові run, at, idempotency_key і data {ключ: значення}: data.broadcast — назва розсилки чужого бота (забіг, відкритий такою подією, матиме походження broadcast із цією назвою), будь-який ключ data можна взяти міткою кроку-події (mark). Нових людей виклик не заводить, доки не передано create: true разом із telegram_id, phone або email (і, за бажання, name) — тоді невідома людина стає контактом; та сама подія тієї самої людини за 5 хвилин рахується раз. У воронці подія зʼявляється протягом двох хвилин. Людину можна назвати й telegram_id. payment_url — туди ж сервіс повідомляє про оплату, що пройшла не через нашу сторінку (кнопка оплати SendPulse): POST, JSON {\"paylink\": слаг або id посилання, \"amount\": \"888\", \"order_ref\": номер замовлення в сервісі, \"status\": approved | refunded | declined | expired | pending}; людина — lead, telegram_id, phone, email; необовʼязкові currency, name, telegram_username, src і marks {мітка: значення} для розрізів, at, details {усе, що знає сервіс}. Оплата стає транзакцією й іде у воронку, «Статистику» й продукти; невпізнану людину заводить.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"period":{"type":"string","enum":["today","yesterday","7","30","all"],"description":"Період: сьогодні, вчора, 7 чи 30 останніх днів або весь час."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_systems_list":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_systems_list","summary":"Системи воронок","description":"Система — ланцюг із кількох воронок (міні-продукт → вебінар → тріпваєр) зі стрілками між ними. Тут — системи проєкту з числом людей і виручкою за період. Одна воронка може стояти в кількох системах.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"period":{"type":"string","enum":["7","30","all"],"description":"Період: 7 чи 30 останніх днів або весь час. За замовчуванням 30."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_system_stats":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_system_stats","summary":"Карта системи числами","description":"По кожній воронці системи: скільки зайшло і звідки (origins: ads — реклама, funnel — з попередньої воронки, broadcast — розсилка, organic), конверсія (conversion — дійшли мети в самій воронці; buyers_later і conversion_later — не дійшли тут, але дійшли мети в наступній воронці свого шляху; conversion_total — разом), своя виручка (revenue) і revenue_later — що ті самі люди принесли далі по системі (це ТІ САМІ гроші, що revenue наступних воронок, — у сумі з ними вони рахуються двічі). links — скільки людей перейшло кожною стрілкою. Виручка системи (revenue вгорі) рахує кожну оплату один раз. unlinked_moves — люди переходять між воронками, де стрілки немає. Гроші: spend — витрати вузла (привʼязані кампанії Meta цілком + ручні), romi_ads — окупність реклами цієї воронки (виручка людей із реклами проти витрат; хто прийшов з іншої воронки, коштує нуль), cost_per_entry — ціна входу з реклами. Вгорі romi — РОМІ СИСТЕМИ: уся виручка за весь шлях проти всіх витрат. romi = null — витрат немає або виручка не в гривні (currency_ok).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"system":{"type":["integer","string"],"description":"id системи."},"period":{"type":"string","enum":["7","30","all"],"description":"Період: 7 чи 30 останніх днів або весь час. За замовчуванням 30."}},"required":["system"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_journey":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_journey","summary":"Шлях людини по воронках","description":"Усі воронки, які пройшла людина, ланцюжками: з якої в яку переходила, де зараз, що принесла.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"contact":{"type":["integer","string"],"description":"id контакту."}},"required":["contact"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_system_save":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_system_save","summary":"Створити чи змінити систему воронок (зміни)","description":"Без system — нова система; із system — часткова правка (змінюються лише передані поля). funnels і links замінюються ЦІЛКОМ. Стрілка {from, to, label?} — ідентифікаторами воронок. Переходи людей знаходяться самі, і за минулий час теж: після збереження шляхи й мітки «з воронки» перечитуються.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"system":{"type":["integer","string"],"description":"id системи для правки; без нього створюється нова."},"name":{"type":"string"},"funnels":{"type":"array","items":{"type":["integer","string"]},"description":"id воронок системи."},"links":{"type":"array","items":{"type":"object"},"description":"Стрілки: [{from: id воронки, to: id воронки, label?}]."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_spend_save":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_spend_save","summary":"Реклама й ручні витрати воронки (зміни)","description":"Витрати воронки — список замінюється ЦІЛКОМ. Без system — ручні витрати просто на воронці (для школи без систем воронок): із них рахуються ціна ліда, ціна продажу й РОМІ у числах воронки. Із system — те саме для воронки в системі, плюс привʼязка кампаній Meta (meta_id); кампанія належить одній воронці. Витрати стоять проти людей, за яких заплачено: з оголошень і з джерел ручних витрат.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"system":{"type":["integer","string"],"description":"Система воронок; без неї витрати вносяться на саму воронку."},"funnel":{"type":["integer","string"],"description":"id воронки."},"campaigns":{"type":"array","items":{"type":"string"},"description":"meta_id кампаній, груп або оголошень. Лише разом із system."},"costs":{"type":"array","items":{"type":"object"},"description":"Ручні витрати в гривні: [{from: \"2026-10-01\", to: \"2026-10-07\", amount: \"5000.00\", label: \"Блогер\", utm_source: \"blogger_olena\"}]. utm_source — яким джерелом приходять люди за ці гроші: їхня виручка стане проти цієї витрати; без нього РОМІ воронки буде занижений."}},"required":["funnel"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_reports_list":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_reports_list","summary":"Регулярні звіти воронки","description":"Звіти воронки, що надсилаються за розкладом: щоденні й тижневі, у чат Telegram або в Google Таблицю. Для кожного — вид, час (київський), куди, рядки (rows) і списки людей (lists), стан і остання помилка. available: які рядки можна вибрати (to_sheet — чи пишеться рядок у Таблицю), кроки воронки, чати й таблиці з «Інтеграцій».\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"funnel":{"type":["integer","string"],"description":"id воронки."},"archived":{"type":"boolean"}},"required":["funnel"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_report_save":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_report_save","summary":"Створити або змінити звіт воронки (зміни)","description":"Без id — новий звіт; з id — часткова правка. kind: daily (за вчора) або weekly (останні сім повних днів; weekday 1–7, 1 — понеділок). at_time — ГГ:ХХ за київським часом. channel: telegram (integration_id — чат з «Інтеграцій», thread — гілка) або sheet (integration_id — Google Таблиця з «Інтеграцій», tab — аркуш). rows — ключі рядків із available.rows списку звітів у потрібному порядку (порожньо — типовий набір); text — свій текст для рядка text. lists — до трьох списків людей: [{reached: ключ кроку, not: ключ кроку або порожньо, limit: 0–200}]. Новий звіт створюється ВИМКНЕНИМ: увімкнути його й надіслати пробний можна лише у вкладці «Звіти» адмінки. archive: true — в архів.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"funnel":{"type":["integer","string"],"description":"id воронки."},"id":{"type":["integer","string"]},"name":{"type":"string"},"kind":{"type":"string","enum":["daily","weekly"]},"weekday":{"type":"integer"},"at_time":{"type":"string"},"channel":{"type":"string","enum":["telegram","sheet"]},"integration_id":{"type":["integer","string"]},"thread":{"type":"integer"},"tab":{"type":"string"},"rows":{"type":"array","items":{"type":"string"}},"text":{"type":"string"},"lists":{"type":"array","items":{"type":"object"}},"archive":{"type":"boolean"}},"required":["funnel"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_export_run":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_export_run","summary":"Разовий звіт воронки в Google Таблицю (зміни)","description":"Окремий аркуш «Звіт <дата>» у вибраній таблиці: зведення, кроки, джерела, дні входу й графіки Таблиць (лійка та динаміка). integration — id інтеграції Google Таблиць (available.sheets у списку звітів воронки).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"funnel":{"type":["integer","string"],"description":"id воронки."},"integration":{"type":["integer","string"]},"period":{"type":"string","enum":["today","yesterday","7","30","all"],"description":"Період: сьогодні, вчора, 7 чи 30 останніх днів або весь час."}},"required":["funnel","integration"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_create":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_create","summary":"Створити воронку (зміни)","description":"Нова воронка: кроки або шаблон (webinar, minicourse, magnet). Забіги зберуться самі з уже записаних заявок, оплат, підписок і вебінарів — і за минулий час теж. Цілі кроків — id форм, платіжних посилань, ботів, подій, вебінарів проєкту.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"name":{"type":"string"},"window_days":{"type":"integer","description":"Скільки днів після входу кроки ще зараховуються забігу. 1–365."},"entry_hold":{"type":["object","null"],"description":"Вікно входу за умовою: {bot: id бота, tag: назва тегу} — поки в людини в цьому боті стоїть тег, повторний вхід — та сама спроба (нового забігу й нового числа в «людях» немає); тег зняли — нова спроба. Людини в боті немає — рішення за днями (entry_days). Рішення записується з фактом входу, тож числа не пливуть після «Зібрати наново». null — зняти умову."},"steps":{"type":"array","description":"Кроки по порядку. Перший — вхід: він відкриває забіг. Кожен: {kind, target?, pct?, window?}. kind: visit (зайшов на сайт ProForms; людина — браузер відвідувача: кілька заходів — одна людина; анонімний відвідувач зводиться з контактом, щойно лишив заявку з форми сайту чи оплатив кнопкою з сайту, а lead=L_… / tg=<Telegram ID> в адресі впізнають його одразу; target = id сайту), lead (заявка, target = id форми), paid (оплата, target = id платіжного посилання), bot (перша підписка в бота, target = id бота), flow (запущено ланцюжок бота, target = id ланцюжка — обовʼязково; ловить і тих, хто вже підписаний), event (своя подія, target = id події — обовʼязково), wreg / wcame / wstay / wclick (реєстрація, прихід, досидів pct% ефіру або min хвилин, натиснув кнопку; target = id вебінару), order (створив замовлення — дійшов до оплати, навіть якщо не заплатив; target = id посилання на оплату). Без target — «будь-яка». Кілька цілей одним кроком — targets: [id, id] замість target: ефір у двох кімнатах чи кілька тарифів одного продукту ({kind:\"paid\", targets:[38,39,40]}); крок ловить будь-яку з них. window — своє вікно кроку в днях замість вікна воронки. mark у paid / wcame / wstay / wclick / event — розріз за міткою адреси: {kind:\"paid\", mark:\"src\"} лишає крок одним, а числа воронки розкладають його за значеннями, що реально трапились (breakdown). Так видно, звідки купили й чи прийшли на ефір або на повтор, — окремих кроків під кожне джерело не треба. У event mark — ключ із data події: {kind:\"event\", target:27, mark:\"src\"} розкладає «отримав розсилку» за тим, що надіслали в data.src. У paid ще mark_value — умова: {kind:\"paid\", mark:\"src\", mark_value:\"dozhym\"} ловить лише такі оплати. entry: true — другий вхід: людина без забігу, що потрапила одразу на цей крок (розсилка повз сайт), відкриває забіг із нього й у origins стає окремим рядком (broadcast з назвою розсилки).","items":{"type":"object"}},"template":{"type":"string","enum":["webinar","minicourse","magnet"],"description":"Замість steps: готовий набір кроків без цілей."}},"required":["name"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_update":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_update","summary":"Змінити воронку (зміни)","description":"Часткова правка: змінюються лише передані поля. steps замінює кроки ЦІЛКОМ; кроки, що не змінили суті, зберігають свої ключі, тож стара історія читається далі. Забіги, що вже увійшли, памʼятають попередні кроки. Перезбирання історії за новими кроками робить лише людина в адмінці.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"funnel":{"type":["integer","string"],"description":"id воронки."},"name":{"type":"string"},"window_days":{"type":"integer"},"entry_days":{"type":"integer","description":"Вікно входу: повторний вхід тієї самої людини раніше, ніж через стільки днів від початку спроби, — дубль цієї спроби (нового забігу не відкриває). 0 — кожен повтор одразу нова спроба. Не більше за window_days (вікно результату)."},"guess_days":{"type":"integer","description":"Вікно здогаду: скільки днів після останнього кроку людини оплата БЕЗ номера забігу ще зараховується воронці."},"entry_hold":{"type":["object","null"],"description":"Вікно входу за умовою: {bot: id бота, tag: назва тегу} — поки в людини в цьому боті стоїть тег, повторний вхід — та сама спроба (нового забігу й нового числа в «людях» немає); тег зняли — нова спроба. Людини в боті немає — рішення за днями (entry_days). Рішення записується з фактом входу, тож числа не пливуть після «Зібрати наново». null — зняти умову."},"steps":{"type":"array","description":"Кроки по порядку. Перший — вхід: він відкриває забіг. Кожен: {kind, target?, pct?, window?}. kind: visit (зайшов на сайт ProForms; людина — браузер відвідувача: кілька заходів — одна людина; анонімний відвідувач зводиться з контактом, щойно лишив заявку з форми сайту чи оплатив кнопкою з сайту, а lead=L_… / tg=<Telegram ID> в адресі впізнають його одразу; target = id сайту), lead (заявка, target = id форми), paid (оплата, target = id платіжного посилання), bot (перша підписка в бота, target = id бота), flow (запущено ланцюжок бота, target = id ланцюжка — обовʼязково; ловить і тих, хто вже підписаний), event (своя подія, target = id події — обовʼязково), wreg / wcame / wstay / wclick (реєстрація, прихід, досидів pct% ефіру або min хвилин, натиснув кнопку; target = id вебінару), order (створив замовлення — дійшов до оплати, навіть якщо не заплатив; target = id посилання на оплату). Без target — «будь-яка». Кілька цілей одним кроком — targets: [id, id] замість target: ефір у двох кімнатах чи кілька тарифів одного продукту ({kind:\"paid\", targets:[38,39,40]}); крок ловить будь-яку з них. window — своє вікно кроку в днях замість вікна воронки. mark у paid / wcame / wstay / wclick / event — розріз за міткою адреси: {kind:\"paid\", mark:\"src\"} лишає крок одним, а числа воронки розкладають його за значеннями, що реально трапились (breakdown). Так видно, звідки купили й чи прийшли на ефір або на повтор, — окремих кроків під кожне джерело не треба. У event mark — ключ із data події: {kind:\"event\", target:27, mark:\"src\"} розкладає «отримав розсилку» за тим, що надіслали в data.src. У paid ще mark_value — умова: {kind:\"paid\", mark:\"src\", mark_value:\"dozhym\"} ловить лише такі оплати. entry: true — другий вхід: людина без забігу, що потрапила одразу на цей крок (розсилка повз сайт), відкриває забіг із нього й у origins стає окремим рядком (broadcast з назвою розсилки).","items":{"type":"object"}}},"required":["funnel"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_set_active":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_set_active","summary":"Увімкнути чи вимкнути воронку (зміни)","description":"Вимкнена воронка не відкриває нових забігів; зібрані забіги й числа лишаються.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"funnel":{"type":["integer","string"],"description":"id воронки."},"active":{"type":"boolean"}},"required":["funnel","active"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_merge":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_merge","summary":"Злити воронку в іншу (зміни)","description":"Одна воронка продукту замість кількох (мови, валюти). Злита воронка вимикається й віддає свої забіги: оплати й події переходять у воронку злиття, і та збирається наново. Номери забігів злитої воронки в посиланнях і змінних бота ведуть туди ж. Перед злиттям додайте у воронку злиття кроки злитої — форми, оплати, події. undo = true скасовує злиття: воронка знову робоча, обидві збираються наново.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"funnel":{"type":["integer","string"],"description":"id воронки."},"into_funnel":{"type":["integer","string"],"description":"id воронки, куди зливати."},"undo":{"type":"boolean"}},"required":["funnel"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_event_create":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_event_create","summary":"Створити свою подію (зміни)","description":"Назва бізнес-моменту, на який може спиратись крок воронки. Сама подія виставляється в боті (дія «Подія воронки») або ззовні — запитом POST на event_url проєкту.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"name":{"type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/funnel_event_update":{"post":{"tags":["Інструменти: Воронки"],"operationId":"tool_funnel_event_update","summary":"Перейменувати чи вимкнути подію (зміни)","description":"Перейменування не чіпає вже записаних подій і кроків воронок: вони тримаються за id.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"event":{"type":["integer","string"],"description":"id події."},"name":{"type":"string"},"active":{"type":"boolean"}},"required":["event"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/paylink_sales_debts":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_paylink_sales_debts","summary":"Очікувані доплати","description":"Хто ще має доплатити: відкриті продажі із залишком, найбільший борг — першим. Продаж — «людина купує продукт»: бронь і доплата за один курс — один продаж. У рядку: sale_id, людина, продукт, тариф, price (повна ціна для неї), paid, left у валюті тарифу (currency), left_base — той самий залишок у валюті виручки (base_currency), скільки оплат. Рахується лише там, де в продукту налаштовано тарифи. Продажі однієї людини є також у картці контакту (sales).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"limit":{"type":"integer","description":"Скільки рядків, типово 100."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/paylink_sale_update":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_paylink_sale_update","summary":"Змінити продаж людини (зміни)","description":"Рішення по одному продажу (sale_id — з картки контакту чи списку очікуваних доплат). Рівно одна дія: price — своя повна ціна рядком («8000.00»; порожній рядок повертає ціну тарифу); tariff — перевести на інший тариф продукту; close: true з note — закрити без доплати (залишок зникає з очікуваних доплат, гроші лишаються); reopen: true — відкрити закритий. Зміна ціни чи закриття одразу змінює очікувані гроші школи.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"sale":{"type":["integer","string"]},"price":{"type":"string"},"tariff":{"type":["integer","string"]},"close":{"type":"boolean"},"note":{"type":"string"},"reopen":{"type":"boolean"}},"required":["sale"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/transaction_pay_kind_set":{"post":{"tags":["Інструменти: Оплати"],"operationId":"tool_transaction_pay_kind_set","summary":"Вид оплати транзакції (зміни)","description":"Позначити, чим була оплата (id транзакції): full — повна оплата, booking — бронювання, part — частина, rest — доплата, upgrade — перехід на тариф; порожній рядок знімає позначку. Від виду залежать статус продажу (бронь чи частково), очікувані доплати й «вид оплати» в статистиці. Заданий так вид лишається, навіть якщо посилання потім налаштують інакше.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"transaction":{"type":["integer","string"]},"pay_kind":{"type":"string","enum":["","full","booking","part","rest","upgrade"]}},"required":["transaction","pay_kind"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_report":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_report","summary":"Звіт воронки продажів","description":"Цифри воронки за період — ті самі, що в «Звіті» воронки. period: today, yesterday, 7, 30, 90, month, all (або from і to — ДД-ММ-РРРР, РРРР-ММ-ДД). mode: events — що сталося за період (нові за створенням, виграні й програні за закриттям, виручка за оплатами), cohort — угоди, створені за період, і їхній результат. Гроші — у гривнях. summary — нові, виграно, виручка, конверсія у виграш, середній чек, цикл (медіана, днів) і prev — те саме за попередній період; open — у роботі зараз і прогноз; funnel — скільки угод дійшли до кожного етапу; stages — зараз, час на етапі (медіана, днів), застиглі, ймовірність виграшу; lost — причини програшу; owners — менеджери (перша реакція — секунди); signals — угоди, з якими щось не так; sources — за utm_source, з витратами, якщо їх внесено.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"pipeline":{"type":["integer","string"]},"period":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"mode":{"type":"string","enum":["events","cohort"]},"owner":{"type":["integer","string"],"description":"лише угоди цього відповідального"}},"required":["pipeline"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_pipelines_list":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_pipelines_list","summary":"Воронки продажів CRM","description":"Воронки продажів проєкту з етапами й полями угод. Етап: id, name, kind (open — у роботі, won — успіх, lost — провал), required — ключі полів, без яких етап не приймає угоду, require_paid — приймає лише оплачені. Поле: key (ключ у fields угоди), label, type, options — варіанти списку. lost_reasons — причини програшу: якщо список не порожній, перенесення в програшний етап вимагає одну з них — крім етапів з ask_reason: false.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_deals_list":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_deals_list","summary":"Угоди воронки","description":"Угоди однієї воронки (pipeline — id воронки). Звузити: stage — id етапу, q — пошук за назвою угоди, іменем, телефоном чи поштою людини, owner — id людини з team, state — open | won | lost. Найсвіжіші за часом на етапі — першими. У рядку: id, title, етап, людина, сума-прогноз (amount рядком), pay_state (none | partial | paid | refunded), скільки днів на етапі, відповідальний, відкриті задачі.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"pipeline":{"type":["integer","string"]},"stage":{"type":["integer","string"]},"q":{"type":"string"},"owner":{"type":["integer","string"]},"state":{"type":"string","enum":["open","won","lost"]},"limit":{"type":"integer","description":"Скільки рядків, типово 50, найбільше 200."}},"required":["pipeline"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_deal_get":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_deal_get","summary":"Угода CRM","description":"Одна угода (id угоди): етап, людина, сума, свої поля (fields: ключ → значення словами), оплата (що оплатити, що оплачено, скільки лишилось, pay_url — посилання на оплату з кодом угоди), задачі, останні записи історії.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_deal_create":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_deal_create","summary":"Нова угода CRM (зміни)","description":"Завести угоду у воронці (pipeline). contact — id контакту; або person — {name, phone, email}: людину знайде за телефоном чи поштою, а нема — заведе картку (без телефону й пошти — угода без людини). Без title угода називається іменем людини. stage — id етапу (типово перший робочий), amount — сума-прогноз рядком («1500.00»), owner — id людини з team, fields — свої поля: {ключ: значення} (дата — «2026-09-15» або «2026-09-15T14:30», список — назва варіанта).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"pipeline":{"type":["integer","string"]},"title":{"type":"string"},"contact":{"type":["integer","string"]},"stage":{"type":["integer","string"]},"amount":{"type":"string"},"currency":{"type":"string","enum":["UAH","USD","EUR"]},"owner":{"type":["integer","string"]},"fields":{"type":"object"},"person":{"type":"object","properties":{"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"}}}},"required":["pipeline"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_deal_update":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_deal_update","summary":"Змінити угоду CRM (зміни)","description":"Правка угоди: передавайте лише те, що змінюється. title, amount (рядком; порожній рядок прибирає суму), contact — id контакту, owner — id людини з team (0 — зняти відповідального), fields — {ключ: значення}; порожнє значення прибирає поле. Етап цим інструментом не міняється.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]},"title":{"type":"string"},"amount":{"type":"string"},"currency":{"type":"string","enum":["UAH","USD","EUR"]},"contact":{"type":["integer","string"]},"owner":{"type":["integer","string"]},"fields":{"type":"object"}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_deal_move":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_deal_move","summary":"Перенести угоду в етап (зміни)","description":"Перенести угоду в інший етап (stage — id етапу; можна в етап іншої воронки). Якщо етап вимагає полів — передайте їх у fields тим самим викликом; програшний етап у воронці з lost_reasons вимагає lost_reason з цього списку. Відмова називає, чого бракує. Перенесення в «успіх» чи «провал» закриває угоду.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]},"stage":{"type":["integer","string"]},"fields":{"type":"object"},"lost_reason":{"type":"string"}},"required":["id","stage"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_deal_note":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_deal_note","summary":"Нотатка до угоди (зміни)","description":"Дописати нотатку в історію угоди: про що домовились, що з'ясувати. Нотатку бачить уся команда воронки.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]},"text":{"type":"string"}},"required":["id","text"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_task_add":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_task_add","summary":"Задача до угоди (зміни)","description":"Поставити задачу до угоди: title — що зробити, due — строк («2026-09-15T14:30»; без нього — без строку), assignee — id людини з team (типово — відповідальний за угоду). Відмічає задачу виконаною людина у вікні угоди.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id угоди."},"title":{"type":"string"},"due":{"type":"string"},"assignee":{"type":["integer","string"]}},"required":["id","title"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_task_update":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_task_update","summary":"Змінити задачу угоди (зміни)","description":"Змінити задачу: id угоди й task — id задачі (з tasks угоди). Передайте лише те, що міняєте: title, due («2026-09-15T14:30»; порожній рядок — без строку), assignee — id людини з team (0 — нікому). done: true / false — відмітити виконаною або повернути в роботу.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id угоди."},"task":{"type":["integer","string"]},"title":{"type":"string"},"due":{"type":"string"},"assignee":{"type":["integer","string"]},"done":{"type":"boolean"}},"required":["id","task"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_pipeline_create":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_pipeline_create","summary":"Нова воронка CRM (зміни)","description":"Завести воронку продажів. stages — етапи по порядку: {name, kind: open | won | lost, rot_days?} (rot_days — за скільки днів без руху угода на етапі в роботі вважається застиглою). Без stages воронка отримає типові 5 етапів. Потрібен хоча б один етап open.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"name":{"type":"string"},"stages":{"type":"array","items":{"type":"object"}}},"required":["name"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_stages_save":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_stages_save","summary":"Етапи воронки CRM (зміни)","description":"Етапи воронки цілим списком по порядку: {id?, name, kind: open | won | lost, rot_days?}. Наявний етап — з його id, новий — без id. Етап, якого немає в списку, іде в архів, але лише порожній: якщо в ньому є угоди, нічого не зміниться й прийде пояснення.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"pipeline":{"type":["integer","string"]},"stages":{"type":"array","items":{"type":"object"}}},"required":["pipeline","stages"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_field_save":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_field_save","summary":"Поле угод CRM (зміни)","description":"Завести або змінити своє поле угод. Без id чи key — нове поле; з id або key — правка наявного. type (лише для нового): text — Текст, long — Довгий текст, number — Число, money — Гроші, date — Дата, datetime — Дата й час, select — Список, multi — Кілька значень, check — Прапорець, user — Людина з команди, url — Посилання, phone — Телефон. options — варіанти списку (для select і multi): словами або {id, label, color}, де color — #rrggbb; щоб перейменувати варіант, передайте його id з option_items і нову назву: без id нова назва стане новим варіантом, а значення старого в угодах зникнуть. При правці передавайте весь список: варіант, якого немає, зникає з вибору. grp — назва групи в картці угоди. important — показувати, що поле порожнє. pipelines — id воронок, де поле видно; порожньо — у всіх. Текстові поля з назвою utm_source, utm_medium, utm_campaign, utm_content, utm_term заповнюються мітками звернення самі.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","long","number","money","date","datetime","select","multi","check","user","url","phone"]},"options":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"color":{"type":"string"}},"required":["label"]}]}},"grp":{"type":"string"},"important":{"type":"boolean"},"pipelines":{"type":"array","items":{"type":["integer","string"]}}},"required":["label"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_fields_order":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_fields_order","summary":"Порядок полів угод CRM (зміни)","description":"Переставити поля угод. keys — ключі полів у тому порядку, в якому їх показувати. Переставлені поля займають ті самі місця, що й до того, решта не зсувається — тож досить передати поля однієї групи. Картка угоди показує першими поля без групи, далі групи за абеткою; порядок діє всередині групи. Повертає всі поля проєкту в новому порядку.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"keys":{"type":"array","items":{"type":"string"}}},"required":["keys"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_pipeline_settings":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_pipeline_settings","summary":"Налаштування воронки CRM (зміни)","description":"Налаштування воронки — передавайте лише те, що змінюєте. Етап можна назвати id або назвою. lost_reasons — причини програшу (список рядків; порожній — причину не питати). card — ключі полів на картці дошки (до 8). pay_first_stage / pay_full_stage / pay_refund_stage — куди угода йде сама після перших грошей, після повної оплати й коли всі гроші повернули (0 — нікуди). auto_owner — кому угоди, що приходять самі: 0 — нікому, -1 — по черзі, інакше id людини з team. required — {етап: [ключі полів]}, без яких етап не приймає угоду. require_paid — етапи «лише сплачені». notify_chat — chat_id Telegram-чату команди: туди йдуть нові угоди, нагадування задач і дія notify; порожньо — мовчати. no_reason — програшні етапи, де причину програшу не питати (напр., «Повернення» з власним полем причини); передавайте весь список. pay_refund_props — {ключ поля: значення}, чим заповнити порожні поля, коли угода сама йде в етап повернення (для списку — варіант словами); {} — нічого. default_amount — сума нової угоди, якщо її не вказали (рядком, «2500»; порожньо — без суми), default_currency — UAH | USD | EUR. notify_thread — id гілки форуму в цьому чаті (0 — загальна стрічка); гілки чату — у переліку Telegram-чатів проєкту. У відповіді hook_url — вхідний вебхук воронки: POST {telegram_id | phone | email, name, fields: {ключ поля: значення}, products: [id], stage} кладе людину угодою сюди (одна відкрита угода на людину, повтор дописує порожні поля). advance — просувати відкриту угоду вперед за діями людини: повторна форма, крок бота «Передати в CRM», ефір, оплата чи вебхук переносять угоду в етап, куди веде це звернення, — лише вперед за порядком етапів і лише з робочого етапу (закриту не відкриває, з пізнішого етапу не повертає). Без advance повторне звернення лише дописує порожні поля. webinar_intake — угоди з автовебів (передавайте лише те, що змінюєте): {on, by_webinar: {id вебінару: id варіанта поля «Ефір» або \"\"}, all (усі, хто прийшов на ефір), min_engagement (0–100, 0 — не за залученістю), clicked (натиснула кнопку), delay_min, offer_hours, products: [id — оплата за них означає «вже купила»; їх же додаємо в угоду], stage (вхідний етап), click_stage (етап для тих, хто натиснув кнопку; 0 — той самий, що вхідний), back_stages (з цих етапів повторна активність повертає угоду у вхідний; при advance не діє), notify_stages (тут лише сповіщення), fields: {did (поле «кілька значень»), did_click, did_comment (id варіантів), webinar, date, offer, comments, repeat — ключі полів}}. Сесії до першого ввімкнення не беруться. Вебінари проєкту з id — у відповіді.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"pipeline":{"type":["integer","string"]},"lost_reasons":{"type":"array","items":{"type":"string"}},"card":{"type":"array","items":{"type":"string"}},"pay_first_stage":{"type":["integer","string"]},"pay_full_stage":{"type":["integer","string"]},"pay_refund_stage":{"type":["integer","string"]},"auto_owner":{"type":["integer","string"]},"notify_chat":{"type":"string"},"notify_thread":{"type":"integer"},"required":{"type":"object"},"require_paid":{"type":"array","items":{"type":["integer","string"]}},"no_reason":{"type":"array","items":{"type":["integer","string"]}},"pay_refund_props":{"type":"object"},"default_amount":{"type":"string"},"default_currency":{"type":"string","enum":["UAH","USD","EUR"]},"advance":{"type":"boolean"},"webinar_intake":{"type":"object"}},"required":["pipeline"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_rules_list":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_rules_list","summary":"Автоматизації воронки CRM","description":"Автоматизації воронки та довідник для їх складання: triggers (події), actions (дії), sources — з чого будувати умови (conds: [{match: all | any, conds: [{src, op, value}]}], src і op — з sources).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"pipeline":{"type":["integer","string"]}},"required":["pipeline"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_rules_save":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_rules_save","summary":"Зберегти автоматизації воронки CRM (зміни)","description":"Автоматизації воронки ЦІЛИМ списком (правило, якого немає в списку, зникає; наявне — з його id). Правило: {id?, name, trigger, params, conds?, actions, active?}. trigger і params: created — {}; stage — {stage: id або назва, 0 — будь-який}; paid — {state: any | paid | refunded}; idle — {stage, days}; quiet — {stage, days}: людина мовчить N днів після останнього повідомлення від людини команди в чаті; date — {field: ключ поля-дати, offset: хвилини, мінус — до дати}; field — {field: ключ, value: варіант словами або порожньо — будь-яке нове значення}. actions (1–8): task {title, who: owner | id людини, hours — строк}; move {stage, reason — причина, коли етап програшний}; owner {who}; field {key, value — для списку словами}; notify {text} — у Telegram-чат команди; flow {flow: id опублікованого ланцюжка бота}.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"pipeline":{"type":["integer","string"]},"rules":{"type":"array","items":{"type":"object"}}},"required":["pipeline","rules"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_views_list":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_views_list","summary":"Вигляди воронки CRM","description":"Збережені вигляди воронки, які бачить людина ключа: id, name, kind (board — дошка, table — таблиця, calendar — календар), shared (бачить уся команда), mine (її власний — лише такий можна змінити), spec (filter, q, sort, columns, date_field). Також columns — з чого складати стовпці таблиці, і date_fields — поля для календаря, groups — за чим можна зібрати колонки дошки.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"pipeline":{"type":["integer","string"]}},"required":["pipeline"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_view_save":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_view_save","summary":"Зберегти вигляд воронки CRM (зміни)","description":"Новий вигляд (без id) або правка свого (з id). name; kind: board | table | calendar; shared — бачить уся команда (типово так); filter — умови у форматі conds автоматизацій; q — пошук; sort — [ключ, asc | desc] (title, amount, created, in_stage, stage, contact, pay або f:ключ поля); columns — стовпці таблиці з довідника columns виглядів; date_field — ключ поля-дати для календаря; order — [ключ, asc | desc], порядок карток на дошці; group — за чим колонки дошки: значення з довідника groups виглядів (типово stage). При правці order і group, яких не передали, лишаються як були.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"pipeline":{"type":["integer","string"]},"id":{"type":["integer","string"]},"name":{"type":"string"},"kind":{"type":"string","enum":["board","table","calendar"]},"shared":{"type":"boolean"},"filter":{"type":"array","items":{"type":"object"}},"q":{"type":"string"},"sort":{"type":"array","items":{"type":"string"}},"columns":{"type":"array","items":{"type":"string"}},"date_field":{"type":"string"},"order":{"type":"array","items":{"type":"string"}},"group":{"type":"string"}},"required":["pipeline","name","kind"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/crm_marks_save":{"post":{"tags":["Інструменти: CRM: угоди й воронки продажів"],"operationId":"tool_crm_marks_save","summary":"Мітки воронки CRM (зміни)","description":"Мітки воронки ЦІЛИМ списком: {id?, name, color — #rrggbb, effect: chip | stripe, conds — умови у форматі conds автоматизацій}. Мітка стоїть на угодах, що підходять під умови, і працює як фільтр.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"pipeline":{"type":["integer","string"]},"marks":{"type":"array","items":{"type":"object"}}},"required":["pipeline","marks"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/calls_list":{"post":{"tags":["Інструменти: Контакти"],"operationId":"tool_calls_list","summary":"Дзвінки","description":"Журнал дзвінків АТС проєкту: напрям, стан, тривалість, менеджер, контакт і угода, підсумок менеджера. missed_pending — скільки людей чекають передзвону. Найновіші першими, до 100 за раз (page — сторінка).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"period":{"type":"string","enum":["1","7","30","90","all"],"description":"Днів назад; 1 — сьогодні. Типово 7."},"user":{"type":["integer","string"],"description":"Менеджер (id людини команди)."},"dir":{"type":"string","enum":["in","out"]},"state":{"type":"string","enum":["answered","missed","all_missed","fail"],"description":"answered — розмова; missed — пропущені, на які ще не передзвонили; all_missed — усі пропущені; fail — вихідні без відповіді."},"q":{"type":"string","description":"Частина номера телефону."},"page":{"type":["integer","string"]}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/calls_report":{"post":{"tags":["Інструменти: Контакти"],"operationId":"tool_calls_report","summary":"Звіт по дзвінках","description":"Звіт по менеджерах за період: усього, вхідні, вихідні, розмов, пропущені, без передзвону, середній час до передзвону (хв), загальний і середній час розмов (с). user_id = null — дзвінки, яких АТС не віднесла нікому.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"period":{"type":"string","enum":["1","7","30","90","all"],"description":"Днів назад; 1 — сьогодні. Типово 7."},"user":{"type":["integer","string"],"description":"Менеджер (id людини команди)."},"dir":{"type":"string","enum":["in","out"]},"q":{"type":"string","description":"Частина номера телефону."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/call_get":{"post":{"tags":["Інструменти: Контакти"],"operationId":"tool_call_get","summary":"Дзвінок","description":"Один дзвінок: ті самі поля, що в журналі дзвінків, плюс відкриті угоди людини, до яких його можна віднести (deals).\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/call_start":{"post":{"tags":["Інструменти: Контакти"],"operationId":"tool_call_start","summary":"Подзвонити (зміни)","description":"Дзвінок через АТС від імені людини, чиїм ключем працює агент: АТС дзвонить на її внутрішній номер, а коли вона візьме слухавку — клієнту. Без внутрішнього номера за нею — помилка з поясненням. contact і deal — щоб дзвінок одразу ліг у потрібну картку.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"phone":{"type":"string"},"contact":{"type":["integer","string"]},"deal":{"type":["integer","string"]}},"required":["phone"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/call_outcome_set":{"post":{"tags":["Інструменти: Контакти"],"operationId":"tool_call_outcome_set","summary":"Підсумок дзвінка (зміни)","description":"Що вирішили в розмові: outcome (talked — Поговорили, callback — Попросили передзвонити, noanswer — Не відповів, busy — Зайнято, wrong — Не той номер, off — Недоступний), нотатка, угода тієї самої людини, задача «Передзвонити» (task: hour | tomorrow | week). Підсумок на пропущеному позначає його обробленим і закриває задачу «Передзвонити».\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"]},"outcome":{"type":"string","enum":["talked","callback","noanswer","busy","wrong","off"]},"note":{"type":"string"},"deal":{"type":["integer","string"]},"task":{"type":"string","enum":["hour","tomorrow","week"]}},"required":["id","outcome"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/dashboard_schema":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_dashboard_schema","summary":"Дашборди: довідник","description":"Як влаштовано дашборд «Статистики»: показники (metrics) і віджети (widgets). Показник — одна цифра по днях: kind = source (із системи: джерело + поле + параметри), formula (з інших показників за ключами) або manual (вносять руками). Тут — усі джерела з полями й параметрами, вигляди віджетів з опціями й кількістю показників, синтаксис формул, шаблони й приклад. Читайте першим, перш ніж будувати чи правити дашборд.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/dashboard_sources":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_dashboard_sources","summary":"Дашборди: що вибрати в джерелі","description":"Конкретні об'єкти проєкту для параметрів джерела: ads — кампанії й набори Meta (objects — їхні meta id рядками); leads — форми й поля заявок із частими значеннями (для filters: on = field:<ключ> | utm:<мітка> | country); form_views — форми; funnel — воронки з кроками (step — ключ кроку); payments — продукти й посилання на оплату; bot — боти з ланцюжками; webinar — вебінари; crm — воронки продажів.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"type":{"type":"string","enum":["ads","leads","form_views","funnel","payments","bot","webinar","crm"]}},"required":["type"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/dashboards_list":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_dashboards_list","summary":"Дашборди","description":"Дашборди проєкту: назва, скільки показників і віджетів, чи відкрито посилання для перегляду, адреса в адмінці.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."}},"required":[]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/dashboard_get":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_dashboard_get","summary":"Дашборд і його цифри","description":"Будова дашборду (показники, віджети, rev) і, якщо data = true, цифри за період: по днях для кожного показника, підсумок, попередній період такої ж довжини, статус до норми (ok / warn / bad) по днях і за період, лічильники «в нормі / відхилення» по днях. Період — period (today, yesterday, 7, 30, 90, month, prev) або from/to. Так відповідають на «як справи вчора»: period = yesterday.\n\nПраво ключа: «Лише читання» або «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id дашборду (dh_…)."},"data":{"type":"boolean","description":"Додати цифри. Типово true."},"period":{"type":"string","enum":["today","yesterday","7","30","90","month","prev"]},"from":{"type":"string","description":"РРРР-ММ-ДД"},"to":{"type":"string","description":"РРРР-ММ-ДД включно"},"segment":{"type":"string","description":"id категорії зі spec.segments; порожньо — усі."}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/dashboard_create":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_dashboard_create","summary":"Новий дашборд (зміни)","description":"Порожній дашборд або з шаблону: webinar (реклама → реєстрації → бот → ефір → оплати), mini (реклама → сайт → оплати), ladder (міні-продукт → основний). З funnel шаблон сам бере цифри з кроків воронки; чого в ній немає — ручні показники. Без воронки, але з кабінетом Meta — реклама з усього кабінету.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"title":{"type":"string"},"template":{"type":"string","enum":["webinar","mini","ladder"]},"funnel":{"type":["integer","string"],"description":"Воронка, з якої тягнути цифри шаблону."}},"required":["title"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/dashboard_update":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_dashboard_update","summary":"Змінити дашборд (зміни)","description":"Назва й налаштування: settings.period — типовий період, settings.yellow / settings.red — пороги підсвітки у % (типово 15 і 30), settings.refresh — автооновлення в хвилинах (0 — ні). segments — категорії-перемикач над віджетами, список замінюється цілком: [{id?, label, ads: {objects, match, join}, funnels: [{funnel, segment}], forms, paylinks}] — формат у довіднику (segments).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id дашборду (dh_…)."},"rev":{"type":"integer","description":"Ревізія, з якої почали правку. Необов'язково."},"title":{"type":"string"},"settings":{"type":"object","properties":{"period":{"type":"string"},"yellow":{"type":"number"},"red":{"type":"number"},"refresh":{"type":"integer"}}},"segments":{"type":"array","items":{"type":"object"}}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/dashboard_metric_save":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_dashboard_metric_save","summary":"Показник дашборду (зміни)","description":"Додати або змінити показник (за key). metric: {key, label, group, kind: source|formula|manual, source: {type, field, …параметри}, formula, unit: num|money|pct|x, dir: up|down|both, norm — на один день}. Ключ — латиниця, з нього формули посилаються на показник. Відповідь — значення за вчора й за 7 днів, щоб одразу перевірити, що цифри є. Новий показник ще не на екрані, поки його не додано у віджет. remove = ключ прибирає показник із дашборду й віджетів (віджет, де показників лишилось замало, теж); ручні цифри зберігаються — показник з тим самим ключем поверне їх. Показник, на який спирається формула, не прибрати.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id дашборду (dh_…)."},"rev":{"type":"integer","description":"Ревізія, з якої почали правку. Необов'язково."},"metric":{"type":"object"},"remove":{"type":"string","description":"Ключ показника, який прибрати (замість metric)."}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/dashboard_widget_save":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_dashboard_widget_save","summary":"Віджет дашборду (зміни)","description":"Додати віджет (без widget.id) або змінити наявний (з widget.id — часткова правка: лише передані поля). widget: {view, title, metrics: [ключі показників], options, x, y, w, h}. Сітка — 12 колонок, рядок ≈ 56 px; без x/y віджет стає в перше вільне місце. remove = id віджета прибирає його (показники й цифри лишаються).\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id дашборду (dh_…)."},"rev":{"type":"integer","description":"Ревізія, з якої почали правку. Необов'язково."},"widget":{"type":"object"},"remove":{"type":"string","description":"id віджета, який прибрати (замість widget)."}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/dashboard_layout":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_dashboard_layout","summary":"Розкласти віджети (зміни)","description":"Кілька віджетів за раз: [{id, x, y, w, h}]. Сітка — 12 колонок. Інші віджети не рухаються — перекриття уникайте самі.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id дашборду (dh_…)."},"rev":{"type":"integer","description":"Ревізія, з якої почали правку. Необов'язково."},"positions":{"type":"array","items":{"type":"object"}}},"required":["id","positions"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/dashboard_values_set":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_dashboard_values_set","summary":"Ручні цифри дашборду (зміни)","description":"Внести цифри за дні: values = [{metric: ключ, day: РРРР-ММ-ДД, value: число або null}]. Для ручного показника — його значення; для показника з системи — перекриває пораховане (позначається «змінено вручну»), null повертає пораховане. Формулу вручну не задати. До 500 цифр за раз.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id дашборду (dh_…)."},"values":{"type":"array","items":{"type":"object"}}},"required":["id","values"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/dashboard_share":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_dashboard_share","summary":"Посилання на дашборд (зміни)","description":"Посилання «лише перегляд» без входу: on = true відкриває (days — термін, без нього безстроково), false — закриває, regenerate = true — нове посилання замість старого (старе перестає діяти). За посиланням видно всі цифри дашборду, гроші теж.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id дашборду (dh_…)."},"on":{"type":"boolean"},"days":{"type":"integer"},"regenerate":{"type":"boolean"}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/tools/dashboard_archive":{"post":{"tags":["Інструменти: Статистика"],"operationId":"tool_dashboard_archive","summary":"Дашборд в архів (зміни)","description":"Прибирає дашборд в архів; посилання перестає діяти. Цифри в системі не зачіпаються.\n\nПраво ключа: «Читання й зміни».","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"Слаг проєкту (школи) з projects_list. Для ключа, прив'язаного до одного проєкту, можна не вказувати."},"id":{"type":["integer","string"],"description":"id дашборду (dh_…)."}},"required":["id"]}}}},"responses":{"200":{"description":"Результат інструмента.","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"type":"boolean","const":true},"result":{"type":"object","additionalProperties":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"webhooks":{"lead":{"post":{"tags":["Вебхуки"],"operationId":"webhookLead","summary":"Нова заявка","description":"Надсилається після кожної заявки з форми, до якої прив'язано вебхук. Для форми, що веде на оплату, теж: `checkout` каже, що людина йде платити, а `payment` до оплати дорівнює null.\n\n**Підпис.** Якщо в інтеграції задано секрет, запит несе заголовок `X-ProForms-Signature: sha256=<HMAC-SHA256 від сирого тіла>`. Рахуйте підпис від байтів, які отримали, а не від розібраного JSON. Вебхук на «адресу за замовчуванням» мерчанта йде без підпису.\n\n**Формат.** Схема нижче — режим «повний». У режимі «шаблон» тіло задає сама школа; з типом «form-data» вкладені поля стають плоскими (`form[slug]=…`).\n\n**Повтори.** Успіх — будь-яка відповідь 2xx за 10 секунд. Інакше повторюємо через 1 хв, 5 хв, 30 хв, 2 год, 12 год і 24 год. За перенаправленнями не йдемо.","parameters":[{"name":"X-ProForms-Signature","in":"header","schema":{"type":"string"},"example":"sha256=5f2b…","description":"Є лише тоді, коли в інтеграції задано секрет."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadWebhook"},"example":{"event":"lead","lead_id":"L_1739880000_9F3C","form":{"slug":"zayavka-na-kurs","name":"Заявка на курс"},"placement":{"code":"p_a1b2c3","title":"Попап на головній"},"submitted_at":"2026-11-09T04:53:14+02:00","fields":{"name":"Оля","phone":"380671234567","email":"olya@example.com"},"definition":{"name":{"label":"Імʼя","kind":"text"},"phone":{"label":"Телефон","kind":"phone"},"email":{"label":"Пошта","kind":"email"}},"utm":{"utm_source":"facebook","utm_medium":"cpc","utm_campaign":"taro-april","utm_content":"","utm_term":"","fbclid":"IwAR1x…"},"page":"https://school.com/taro","referer":"https://www.facebook.com/","checkout":{"product":"Курс «Таро з нуля»","amount":"3000.00","currency":"UAH"},"payment":null}}}},"responses":{"2XX":{"description":"Прийнято. Тіло відповіді не читається."}}}},"payment":{"post":{"tags":["Вебхуки"],"operationId":"webhookPayment","summary":"Оплата","description":"Гроші прийшли.\n\n**Підпис.** Якщо в інтеграції задано секрет, запит несе заголовок `X-ProForms-Signature: sha256=<HMAC-SHA256 від сирого тіла>`. Рахуйте підпис від байтів, які отримали, а не від розібраного JSON. Вебхук на «адресу за замовчуванням» мерчанта йде без підпису.\n\n**Формат.** Схема нижче — режим «повний». У режимі «шаблон» тіло задає сама школа; з типом «form-data» вкладені поля стають плоскими (`form[slug]=…`).\n\n**Повтори.** Успіх — будь-яка відповідь 2xx за 10 секунд. Інакше повторюємо через 1 хв, 5 хв, 30 хв, 2 год, 12 год і 24 год. За перенаправленнями не йдемо.","parameters":[{"name":"X-ProForms-Signature","in":"header","schema":{"type":"string"},"example":"sha256=5f2b…","description":"Є лише тоді, коли в інтеграції задано секрет."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderWebhook"},"example":{"event":"payment","order_ref":"PAY_1739880000_A1B2","lead_id":"L_1739880000_9F3C","form":"zayavka-na-kurs","product":"Курс «Таро з нуля»","status":"paid","amount":"99.00","currency":"USD","base_amount":"4158.00","base_currency":"UAH","fee":"104.00","fee_currency":"UAH","at":"2026-11-09T04:53:14+02:00","client":{"client_name":"Оля","client_phone":"380671234567","client_email":"olya@example.com"},"payer":{"email":"olya.pay@gmail.com","phone":"380671234567"},"person":{"name":"Оля","email":"olya@example.com","phone":"380671234567","name_form":"Оля","email_form":"olya@example.com","phone_form":"380671234567","name_payment":"","email_payment":"olya.pay@gmail.com","phone_payment":"380671234567","email_other":"olya.pay@gmail.com","phone_other":"","emails":["olya@example.com","olya.pay@gmail.com"],"phones":["380671234567"]},"utm":{"utm_source":"facebook","utm_medium":"cpc","utm_campaign":"taro-april","utm_content":"","utm_term":""}}}}},"responses":{"2XX":{"description":"Прийнято. Тіло відповіді не читається."}}}},"refund":{"post":{"tags":["Вебхуки"],"operationId":"webhookRefund","summary":"Повернення","description":"Гроші повернуто повністю або частково.\n\n**Підпис.** Якщо в інтеграції задано секрет, запит несе заголовок `X-ProForms-Signature: sha256=<HMAC-SHA256 від сирого тіла>`. Рахуйте підпис від байтів, які отримали, а не від розібраного JSON. Вебхук на «адресу за замовчуванням» мерчанта йде без підпису.\n\n**Формат.** Схема нижче — режим «повний». У режимі «шаблон» тіло задає сама школа; з типом «form-data» вкладені поля стають плоскими (`form[slug]=…`).\n\n**Повтори.** Успіх — будь-яка відповідь 2xx за 10 секунд. Інакше повторюємо через 1 хв, 5 хв, 30 хв, 2 год, 12 год і 24 год. За перенаправленнями не йдемо.","parameters":[{"name":"X-ProForms-Signature","in":"header","schema":{"type":"string"},"example":"sha256=5f2b…","description":"Є лише тоді, коли в інтеграції задано секрет."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderWebhook"},"example":{"event":"refund","order_ref":"PAY_1739880000_A1B2","lead_id":"L_1739880000_9F3C","form":"zayavka-na-kurs","product":"Курс «Таро з нуля»","status":"paid","amount":"99.00","currency":"USD","base_amount":"4158.00","base_currency":"UAH","fee":"104.00","fee_currency":"UAH","at":"2026-11-09T04:53:14+02:00","client":{"client_name":"Оля","client_phone":"380671234567","client_email":"olya@example.com"},"payer":{"email":"olya.pay@gmail.com","phone":"380671234567"},"person":{"name":"Оля","email":"olya@example.com","phone":"380671234567","name_form":"Оля","email_form":"olya@example.com","phone_form":"380671234567","name_payment":"","email_payment":"olya.pay@gmail.com","phone_payment":"380671234567","email_other":"olya.pay@gmail.com","phone_other":"","emails":["olya@example.com","olya.pay@gmail.com"],"phones":["380671234567"]},"utm":{"utm_source":"facebook","utm_medium":"cpc","utm_campaign":"taro-april","utm_content":"","utm_term":""}}}}},"responses":{"2XX":{"description":"Прийнято. Тіло відповіді не читається."}}}},"declined":{"post":{"tags":["Вебхуки"],"operationId":"webhookDeclined","summary":"Відмова","description":"Оплата не пройшла; `reason` і `reason_code` кажуть чому. Надсилається лише приймачам, яким увімкнено «усі статуси».\n\n**Підпис.** Якщо в інтеграції задано секрет, запит несе заголовок `X-ProForms-Signature: sha256=<HMAC-SHA256 від сирого тіла>`. Рахуйте підпис від байтів, які отримали, а не від розібраного JSON. Вебхук на «адресу за замовчуванням» мерчанта йде без підпису.\n\n**Формат.** Схема нижче — режим «повний». У режимі «шаблон» тіло задає сама школа; з типом «form-data» вкладені поля стають плоскими (`form[slug]=…`).\n\n**Повтори.** Успіх — будь-яка відповідь 2xx за 10 секунд. Інакше повторюємо через 1 хв, 5 хв, 30 хв, 2 год, 12 год і 24 год. За перенаправленнями не йдемо.","parameters":[{"name":"X-ProForms-Signature","in":"header","schema":{"type":"string"},"example":"sha256=5f2b…","description":"Є лише тоді, коли в інтеграції задано секрет."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderWebhook"},"example":{"event":"declined","order_ref":"PAY_1739880000_A1B2","lead_id":"L_1739880000_9F3C","form":"zayavka-na-kurs","product":"Курс «Таро з нуля»","status":"paid","amount":"99.00","currency":"USD","base_amount":"4158.00","base_currency":"UAH","fee":"104.00","fee_currency":"UAH","at":"2026-11-09T04:53:14+02:00","client":{"client_name":"Оля","client_phone":"380671234567","client_email":"olya@example.com"},"payer":{"email":"olya.pay@gmail.com","phone":"380671234567"},"person":{"name":"Оля","email":"olya@example.com","phone":"380671234567","name_form":"Оля","email_form":"olya@example.com","phone_form":"380671234567","name_payment":"","email_payment":"olya.pay@gmail.com","phone_payment":"380671234567","email_other":"olya.pay@gmail.com","phone_other":"","emails":["olya@example.com","olya.pay@gmail.com"],"phones":["380671234567"]},"utm":{"utm_source":"facebook","utm_medium":"cpc","utm_campaign":"taro-april","utm_content":"","utm_term":""}}}}},"responses":{"2XX":{"description":"Прийнято. Тіло відповіді не читається."}}}},"expired":{"post":{"tags":["Вебхуки"],"operationId":"webhookExpired","summary":"Рахунок прострочено","description":"Людина не заплатила вчасно. Лише з «усі статуси».\n\n**Підпис.** Якщо в інтеграції задано секрет, запит несе заголовок `X-ProForms-Signature: sha256=<HMAC-SHA256 від сирого тіла>`. Рахуйте підпис від байтів, які отримали, а не від розібраного JSON. Вебхук на «адресу за замовчуванням» мерчанта йде без підпису.\n\n**Формат.** Схема нижче — режим «повний». У режимі «шаблон» тіло задає сама школа; з типом «form-data» вкладені поля стають плоскими (`form[slug]=…`).\n\n**Повтори.** Успіх — будь-яка відповідь 2xx за 10 секунд. Інакше повторюємо через 1 хв, 5 хв, 30 хв, 2 год, 12 год і 24 год. За перенаправленнями не йдемо.","parameters":[{"name":"X-ProForms-Signature","in":"header","schema":{"type":"string"},"example":"sha256=5f2b…","description":"Є лише тоді, коли в інтеграції задано секрет."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderWebhook"},"example":{"event":"expired","order_ref":"PAY_1739880000_A1B2","lead_id":"L_1739880000_9F3C","form":"zayavka-na-kurs","product":"Курс «Таро з нуля»","status":"paid","amount":"99.00","currency":"USD","base_amount":"4158.00","base_currency":"UAH","fee":"104.00","fee_currency":"UAH","at":"2026-11-09T04:53:14+02:00","client":{"client_name":"Оля","client_phone":"380671234567","client_email":"olya@example.com"},"payer":{"email":"olya.pay@gmail.com","phone":"380671234567"},"person":{"name":"Оля","email":"olya@example.com","phone":"380671234567","name_form":"Оля","email_form":"olya@example.com","phone_form":"380671234567","name_payment":"","email_payment":"olya.pay@gmail.com","phone_payment":"380671234567","email_other":"olya.pay@gmail.com","phone_other":"","emails":["olya@example.com","olya.pay@gmail.com"],"phones":["380671234567"]},"utm":{"utm_source":"facebook","utm_medium":"cpc","utm_campaign":"taro-april","utm_content":"","utm_term":""}}}}},"responses":{"2XX":{"description":"Прийнято. Тіло відповіді не читається."}}}},"pending":{"post":{"tags":["Вебхуки"],"operationId":"webhookPending","summary":"Оплата в обробці","description":"Платіж ще перевіряється. Лише з «усі статуси».\n\n**Підпис.** Якщо в інтеграції задано секрет, запит несе заголовок `X-ProForms-Signature: sha256=<HMAC-SHA256 від сирого тіла>`. Рахуйте підпис від байтів, які отримали, а не від розібраного JSON. Вебхук на «адресу за замовчуванням» мерчанта йде без підпису.\n\n**Формат.** Схема нижче — режим «повний». У режимі «шаблон» тіло задає сама школа; з типом «form-data» вкладені поля стають плоскими (`form[slug]=…`).\n\n**Повтори.** Успіх — будь-яка відповідь 2xx за 10 секунд. Інакше повторюємо через 1 хв, 5 хв, 30 хв, 2 год, 12 год і 24 год. За перенаправленнями не йдемо.","parameters":[{"name":"X-ProForms-Signature","in":"header","schema":{"type":"string"},"example":"sha256=5f2b…","description":"Є лише тоді, коли в інтеграції задано секрет."}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderWebhook"},"example":{"event":"pending","order_ref":"PAY_1739880000_A1B2","lead_id":"L_1739880000_9F3C","form":"zayavka-na-kurs","product":"Курс «Таро з нуля»","status":"paid","amount":"99.00","currency":"USD","base_amount":"4158.00","base_currency":"UAH","fee":"104.00","fee_currency":"UAH","at":"2026-11-09T04:53:14+02:00","client":{"client_name":"Оля","client_phone":"380671234567","client_email":"olya@example.com"},"payer":{"email":"olya.pay@gmail.com","phone":"380671234567"},"person":{"name":"Оля","email":"olya@example.com","phone":"380671234567","name_form":"Оля","email_form":"olya@example.com","phone_form":"380671234567","name_payment":"","email_payment":"olya.pay@gmail.com","phone_payment":"380671234567","email_other":"olya.pay@gmail.com","phone_other":"","emails":["olya@example.com","olya.pay@gmail.com"],"phones":["380671234567"]},"utm":{"utm_source":"facebook","utm_medium":"cpc","utm_campaign":"taro-april","utm_content":"","utm_term":""}}}}},"responses":{"2XX":{"description":"Прийнято. Тіло відповіді не читається."}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","bearerFormat":"pf_ + 40 hex","description":"Ключ із профілю ProForms, розділ «Доступ для AI-агента». Право «Лише читання» або «Читання й зміни»; ключ можна прив'язати до одного проєкту."}},"schemas":{"ApiError":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string","description":"Код помилки, сталий."},"message":{"type":"string","description":"Пояснення для людини."}},"required":["ok","error","message"]},"PlainError":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string","description":"Текст помилки."}},"required":["ok","error"]},"FieldErrors":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"errors":{"type":"object","additionalProperties":{"type":"string"},"description":"Ключ — ключ поля форми; «_» — загальна помилка форми."}},"required":["ok","errors"]},"Contact":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"alt_phones":{"type":"array","items":{"type":"string"},"description":"Інші телефони тієї самої людини: з оплати, з другої заявки."},"alt_emails":{"type":"array","items":{"type":"string"},"description":"Інші пошти тієї самої людини."},"telegram_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"alt_telegram_ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"vars":{"type":"object","additionalProperties":true,"description":"Змінні контакту."},"leads_count":{"type":"integer","description":"Скільки заявок."},"paid_count":{"type":"integer","description":"Скільки оплат."},"paid_total":{"type":"string","description":"Сплачено всього.","example":"990.00"},"first_seen_at":{"type":"string","description":"Перша активність."},"last_seen_at":{"type":"string","description":"Остання активність."},"first_utm":{"type":"object","additionalProperties":true,"description":"Мітки першого контакту."},"last_utm":{"type":"object","additionalProperties":true,"description":"Мітки останнього контакту."},"possible_duplicate_of":{"oneOf":[{"type":"integer","description":"id контакту, з яким цей, можливо, одна людина."},{"type":"null"}]}},"required":["id","name","phone","email","alt_phones","alt_emails","telegram_id","alt_telegram_ids","tags","vars","leads_count","paid_count","paid_total","first_seen_at","last_seen_at","first_utm","last_utm","possible_duplicate_of"]},"ContactList":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"summary":{"type":"object","properties":{"total":{"type":"integer","description":"Усього контактів у проєкті."},"clients":{"type":"integer","description":"З них хоч раз платили."},"sum":{"type":"string","description":"Сплачено всіма.","example":"990.00"},"fresh":{"type":"integer","description":"Нових за 30 днів."},"review":{"type":"integer","description":"Можливих дублікатів."}},"required":["total","clients","sum","fresh","review"],"description":"Лічильники всього проєкту, не під фільтром."},"page":{"type":"integer"},"has_more":{"type":"boolean","description":"Чи є наступна сторінка."},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}}},"required":["ok","summary","page","has_more","contacts"]},"ContactCard":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"id":{"type":"string"},"name":{"type":"string"},"phone":{"oneOf":[{"type":"string"},{"type":"null"}]},"email":{"oneOf":[{"type":"string"},{"type":"null"}]},"alt_phones":{"type":"array","items":{"type":"string"},"description":"Інші телефони тієї самої людини: з оплати, з другої заявки."},"alt_emails":{"type":"array","items":{"type":"string"},"description":"Інші пошти тієї самої людини."},"telegram_id":{"oneOf":[{"type":"string"},{"type":"null"}]},"alt_telegram_ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"vars":{"type":"object","additionalProperties":true,"description":"Змінні контакту."},"leads_count":{"type":"integer","description":"Скільки заявок."},"paid_count":{"type":"integer","description":"Скільки оплат."},"paid_total":{"type":"string","description":"Сплачено всього.","example":"990.00"},"first_seen_at":{"type":"string","description":"Перша активність."},"last_seen_at":{"type":"string","description":"Остання активність."},"first_utm":{"type":"object","additionalProperties":true,"description":"Мітки першого контакту."},"last_utm":{"type":"object","additionalProperties":true,"description":"Мітки останнього контакту."},"possible_duplicate_of":{"oneOf":[{"type":"integer","description":"id контакту, з яким цей, можливо, одна людина."},{"type":"null"}]},"sales":{"type":"array","items":{"type":"object","additionalProperties":true,"description":"Покупка: продукт, тариф, скільки сплачено й скільки лишилось (left). status: booked, partial, paid, cancelled, refunded, unpriced. rest_url — особисте посилання на доплату."}},"chats":{"type":"array","items":{"type":"object","properties":{"subscriber_id":{"type":"string"},"bot_id":{"type":"string"},"bot":{"type":"string","description":"Назва бота."},"channel":{"type":"string","description":"Мережа: telegram, instagram, facebook, tiktok."},"username":{"oneOf":[{"type":"string"},{"type":"null"}]},"user_id":{"type":"string","description":"id людини саме в цьому боті."},"status":{"type":"string"},"last_at":{"oneOf":[{"type":"string","description":"Час."},{"type":"null"}]}},"required":["subscriber_id","bot_id","bot","channel","username","user_id","status","last_at"]},"description":"У яких ботах і мережах є чат із людиною."},"history":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","description":"Час."},"what":{"type":"string","description":"Що змінилось, текстом."},"kind":{"type":"string"},"by":{"type":"string","description":"Хто змінив."}},"required":["at","what","kind","by"]},"description":"Зміни картки, найновіші 50."},"leads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Номер заявки."},"created_at":{"type":"string","description":"Час."},"form":{"type":"string","description":"Назва форми."},"paid_at":{"oneOf":[{"type":"string","description":"Час."},{"type":"null"}]},"utm":{"type":"object","additionalProperties":true,"description":"Мітки заявки."},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["id","created_at","form","paid_at","utm"]}},"orders":{"type":"array","items":{"type":"object","properties":{"order_ref":{"type":"string"},"created_at":{"type":"string","description":"Час."},"paid_at":{"oneOf":[{"type":"string","description":"Час."},{"type":"null"}]},"product":{"type":"string"},"amount":{"type":"string","description":"Сума рядком.","example":"990.00"},"currency":{"type":"string"},"status":{"type":"string"},"net":{"type":"string","description":"Нетто в базовій валюті мерчанта.","example":"990.00"},"base_currency":{"oneOf":[{"type":"string"},{"type":"null"}]},"lead":{"oneOf":[{"type":"string","description":"Номер заявки, з якої прийшла оплата."},{"type":"null"}]},"form":{"oneOf":[{"type":"string"},{"type":"null"}]},"placement":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["order_ref","created_at","paid_at","product","amount","currency","status","net","base_currency","lead","form","placement"]}},"webinars":{"type":"array","items":{"type":"object","properties":{"session_id":{"type":"string"},"visitor_id":{"type":"string"},"webinar":{"type":"string"},"date_start":{"type":"string","description":"Час."},"watched_min":{"type":"integer"},"watched_pct":{"type":"integer"},"entries":{"type":"integer"},"comments":{"type":"integer"},"clicked":{"type":"boolean"},"engagement":{"type":"number"},"matched_by":{"type":"string","description":"phone або lead."}},"required":["session_id","visitor_id","webinar","date_start","watched_min","watched_pct","entries","comments","clicked","engagement","matched_by"]}},"number":{"type":"integer","description":"Номер об'єкта в проєкті, для показу людині."}},"required":["ok","id","name","phone","email","alt_phones","alt_emails","telegram_id","alt_telegram_ids","tags","vars","leads_count","paid_count","paid_total","first_seen_at","last_seen_at","first_utm","last_utm","possible_duplicate_of","sales","chats","history","leads","orders","webinars"]},"FunnelEvent":{"type":"object","properties":{"event":{"oneOf":[{"type":"integer"},{"type":"string"}],"description":"id події з екрана «Події» або її назва.","example":4},"lead":{"type":"string","description":"Номер заявки — найточніший спосіб назвати людину.","example":"L_1791364673_A882"},"contact":{"type":"integer","description":"id контакту."},"telegram_id":{"type":"string","description":"Telegram ID людини, лише цифри.","example":"123456789"},"phone":{"type":"string","description":"Телефон у будь-якому написанні.","example":"380671234567"},"email":{"type":"string","example":"olya@example.com"},"at":{"type":"string","description":"Коли сталася подія: ISO 8601 або unix. Не в майбутньому й не давніше року. Типово — зараз.","example":"2026-10-13T14:05:00+03:00"},"run":{"type":"string","description":"Номер забігу воронки. З ним подія зійдеться лише з цим забігом."},"data":{"type":"object","additionalProperties":true,"description":"Довільні подробиці, до 4 КБ. `broadcast` — назва розсилки: забіг, відкритий такою подією, матиме походження «Розсилка» з цією назвою. Будь-який ключ можна взяти міткою кроку-події."},"idempotency_key":{"type":"string","description":"Те саме, що заголовок Idempotency-Key."},"create":{"type":"boolean","description":"true — якщо людину не знайдено, завести контакт за telegram_id, phone чи email. Без нього невідома людина дає 422."},"name":{"type":"string","description":"Імʼя для нового контакту (лише разом із create)."}},"required":["event"],"description":"Потрібна подія й хоча б одне з: lead, contact, telegram_id, phone, email."},"FunnelEventResult":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"event_id":{"type":"integer","description":"id запису."},"duplicate":{"type":"boolean","description":"true — така подія вже була, нової не створено."},"event":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"matched_by":{"type":"string","description":"За чим упізнано людину: lead, contact, telegram_id, phone, email; порожньо — не впізнано.","example":"lead"}},"required":["ok","event_id","duplicate","event","matched_by"]},"FunnelPayment":{"type":"object","properties":{"paylink":{"type":"string","description":"Слаг або id посилання на оплату цього проєкту.","example":"kurs-1m"},"order_ref":{"type":"string","description":"Номер замовлення в сервісі, де пройшла оплата. Літери, цифри, «_» і «-».","example":"sp-88213"},"amount":{"type":"string","description":"Скільки справді заплатили. Без нього береться ціна посилання.","example":"990.00"},"currency":{"type":"string","enum":["UAH","USD","EUR"],"description":"Типово — валюта посилання."},"status":{"type":"string","enum":["approved","refunded","declined","expired","pending"],"default":"approved","description":"У гроші йдуть лише approved і refunded."},"lead":{"type":"string","description":"Номер заявки — найточніший спосіб назвати людину.","example":"L_1791364673_A882"},"contact":{"type":"integer","description":"id контакту."},"telegram_id":{"type":"string","description":"Telegram ID людини, лише цифри.","example":"123456789"},"phone":{"type":"string","description":"Телефон у будь-якому написанні.","example":"380671234567"},"email":{"type":"string","example":"olya@example.com"},"telegram_username":{"type":"string"},"name":{"type":"string","description":"Ім'я платника."},"product":{"type":"string","description":"Назва продукту. Типово — назва посилання."},"fee":{"type":"number","description":"Комісія сервісу."},"reason":{"type":"string","description":"Причина відмови."},"at":{"type":"string","description":"Час оплати: ISO 8601 або unix. Типово — зараз.","example":"2026-10-13T14:05:00+03:00"},"src":{"type":"string","description":"Мітка для розрізу кроку «Оплата».","example":"dozhym"},"run":{"type":"string","description":"Номер забігу воронки."},"marks":{"type":"object","additionalProperties":{"type":"string"},"description":"Інші мітки: utm_* та свої, до 30 штук."},"details":{"type":"object","additionalProperties":true,"description":"Усе, що сервіс знає про оплату; буде видно в картці транзакції."}},"required":["paylink","order_ref"]},"FunnelPaymentResult":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"order_ref":{"type":"string","description":"Номер замовлення в ProForms: EXT_ + ваш order_ref.","example":"EXT_sp-88213"},"duplicate":{"type":"boolean"},"status":{"type":"string","enum":["approved","refunded","declined","expired","pending"]},"paylink":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"}}},"matched_by":{"type":"string","description":"За чим упізнано людину: lead, contact, telegram_id, phone, email; порожньо — не впізнано.","example":"lead"}},"required":["ok","order_ref","duplicate","status","paylink","matched_by"]},"CrmHook":{"type":"object","properties":{"telegram_id":{"type":"string","description":"Telegram ID людини.","example":"123456789"},"phone":{"type":"string"},"email":{"type":"string"},"lead":{"type":"string","description":"Номер заявки ProForms."},"name":{"type":"string","description":"Ім'я — для нової картки."},"fields":{"type":"object","additionalProperties":true,"description":"Поля угоди: ключ чи назва поля → значення. Список — назвою варіанта; дата — 07.11.2026, 07.11.2026 19:07, 2026-11-07 чи ISO з поясом."},"products":{"type":"array","items":{"type":"integer"},"description":"id продуктів, якими людина цікавиться: оплата за них знайде цю угоду."},"stage":{"type":"string","description":"Етап нової угоди: id чи назва. Типово — перший."}}},"CrmHookResult":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"deal":{"type":"integer","description":"id угоди."},"created":{"type":"boolean","description":"true — нова угода, false — дописано у відкриту."},"contact":{"type":"integer","description":"id людини."},"fields":{"type":"array","items":{"type":"string"},"description":"Ключі полів, узятих із запиту."},"skipped":{"type":"object","additionalProperties":true,"description":"Поля, які не прийнято, з причиною."}},"required":["ok","deal","created","contact"]},"BotEvent":{"type":"object","properties":{"event":{"type":"string","description":"Назва події — та, що в тригері ланцюжка.","example":"course_done"},"subscriber_id":{"type":"integer","description":"id підписника бота."},"telegram_id":{"type":"string","description":"id людини в мережі бота.","example":"123456789"},"phone":{"type":"string","description":"Телефон контакту; звіряються останні 9 цифр."},"email":{"type":"string"},"vars":{"type":"object","additionalProperties":true,"description":"Значення, що потраплять у змінні ланцюжка."}},"required":["event"]},"BotEventResult":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"started":{"type":"integer","description":"Скільки ланцюжків запущено."},"subscribers":{"type":"integer","description":"Скільки підписників знайдено."}},"required":["ok","started","subscribers"]},"FormConfig":{"type":"object","properties":{"form":{"type":"object","properties":{"slug":{"type":"string"},"token":{"type":"string"},"schema_version":{"type":"integer"},"blocks":{"type":"array","items":{"type":"object","additionalProperties":true,"description":"Блок форми: текст, поле, кнопка. Види полів: text, tel, email, textarea, select, date, datetime, checkbox."}},"design":{"type":"object","additionalProperties":true,"description":"Оформлення: стиль проєкту з правками форми поверх."}}},"placement":{"type":"object","properties":{"code":{"type":"string"},"mode":{"type":"string","enum":["inline","popup","click","float"]}},"description":"Є лише тоді, коли розміщення з кодом p знайдено. Решта ключів залежить від mode."}},"required":["form"]},"SubmitKey":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"k":{"type":"string","description":"Ключ відправки.","example":"1791364673.9f3c1a2b.5d41402abc4b2a76b9719d911017c592"},"exp":{"type":"integer","description":"До якого часу діє, unix."}},"required":["ok","k","exp"]},"Submit":{"type":"object","properties":{"widget":{"type":"string","description":"Токен форми.","example":"w0a1b2c3d4e5f"},"p":{"type":"string","description":"Код розміщення."},"k":{"type":"string","description":"Ключ відправки з /key."},"hp":{"type":"string","description":"Пастка для ботів: має бути порожнім."},"fields":{"type":"object","additionalProperties":true,"description":"Значення полів: ключ поля → значення.","example":{"name":"Оля","phone":"380671234567"}},"utm":{"type":"object","additionalProperties":{"type":"string"},"description":"Мітки з адреси сторінки."},"page":{"type":"string","description":"Адреса сторінки з формою."},"referer":{"type":"string"},"fbp":{"type":"string","description":"Кука _fbp пікселя Meta."},"fbc":{"type":"string","description":"Кука _fbc."}},"required":["widget","fields"]},"SubmitResult":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"lead_id":{"oneOf":[{"type":"string","description":"Номер заявки.","example":"L_1791364673_A882"},{"type":"null"}]},"redirect_url":{"oneOf":[{"type":"string","description":"Куди вести людину: сторінка оплати або адреса з налаштувань форми."},{"type":"null"}]},"thankyou_text":{"type":"string","description":"Текст подяки, якщо перенаправлення немає."},"pixel":{"type":"array","items":{"type":"object","additionalProperties":true,"description":"Подія для пікселя в браузері."}},"bot_url":{"type":"string","description":"Посилання в бота з токеном заявки. Є, якщо форма веде в бота."},"bot_button":{"type":"string","description":"Напис на кнопці бота."}},"required":["ok","lead_id","redirect_url","thankyou_text"]},"FormEvent":{"type":"object","properties":{"e":{"type":"string","enum":["view","open"],"description":"Показ чи відкриття."},"widget":{"type":"string","description":"Токен форми."},"p":{"type":"string","description":"Код розміщення."},"utm":{"type":"object","additionalProperties":{"type":"string"}},"page":{"type":"string"}},"required":["e","widget"]},"JsonRpcRequest":{"type":"object","properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"oneOf":[{"type":"integer"},{"type":"string"}],"description":"Без id запит вважається сповіщенням."},"method":{"type":"string","enum":["initialize","ping","tools/list","tools/call"]},"params":{"type":"object","additionalProperties":true,"description":"Для tools/call: name — інструмент, arguments — його аргументи."}},"required":["jsonrpc","method"]},"JsonRpcResponse":{"type":"object","properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"oneOf":[{"type":"integer"},{"type":"string"},{"type":"null"}]},"result":{"type":"object","additionalProperties":true,"description":"Для tools/call: content[0].text — JSON із відповіддю інструмента, isError — чи відмова."},"error":{"type":"object","properties":{"code":{"type":"integer","description":"-32600, -32601, -32602 або -32700."},"message":{"type":"string"}}}},"required":["jsonrpc","id"]},"Health":{"type":"object","properties":{"ok":{"type":"boolean"},"env":{"type":"string","example":"production"},"db":{"type":"boolean"},"redis":{"type":"boolean"},"time":{"type":"string","description":"Час, ISO 8601.","example":"2026-10-13T14:05:00+03:00"},"migrations":{"type":"integer","description":"Скільки міграцій застосовано."},"events_default":{"oneOf":[{"type":"integer","description":"Рядків у страхувальній партиції подій; має бути 0."},{"type":"null"}]},"db_error":{"type":"string","description":"Є лише тоді, коли база недоступна."}},"required":["ok","env","db","redis","time"]},"LeadWebhook":{"type":"object","properties":{"event":{"type":"string","const":"lead"},"lead_id":{"type":"string","example":"L_1739880000_9F3C"},"form":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}}},"placement":{"oneOf":[{"type":"object","properties":{"code":{"type":"string"},"title":{"type":"string"}}},{"type":"null"}]},"submitted_at":{"type":"string","description":"Час, ISO 8601.","example":"2026-10-13T14:05:00+03:00"},"fields":{"type":"object","additionalProperties":true,"description":"Значення полів: ключ поля → значення."},"definition":{"type":"object","description":"Опис полів: ключ → підпис і вид.","additionalProperties":{"type":"object","properties":{"label":{"type":"string"},"kind":{"type":"string","enum":["text","tel","email","textarea","select","date","datetime","checkbox"]}}}},"utm":{"type":"object","additionalProperties":{"type":"string"},"description":"Мітки. П'ять ключів utm_* є завжди (порожні теж), решта — якщо були в адресі.","properties":{"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_content":{"type":"string"},"utm_term":{"type":"string"}}},"page":{"type":"string","description":"Сторінка з формою."},"referer":{"type":"string"},"checkout":{"oneOf":[{"type":"object","properties":{"product":{"type":"string"},"amount":{"type":"string","description":"Сума рядком.","example":"990.00"},"currency":{"type":"string"}},"description":"Куди людина йде платити. Заповнене, лише якщо форма веде на оплату."},{"type":"null"}]},"payment":{"oneOf":[{"type":"object","properties":{"order_ref":{"type":"string"},"amount":{"type":"string","description":"Сума рядком.","example":"990.00"},"paid_at":{"type":"string","description":"Час, ISO 8601.","example":"2026-10-13T14:05:00+03:00"}},"description":"Гроші, які вже прийшли. До оплати null."},{"type":"null"}]}},"required":["event","lead_id","form","placement","submitted_at","fields","definition","utm","page","referer","checkout","payment"]},"OrderWebhook":{"type":"object","properties":{"event":{"type":"string","enum":["payment","refund","declined","expired","pending"],"description":"Вид транзакції. Відмова ніколи не приходить як payment."},"order_ref":{"type":"string","example":"PAY_1739880000_A1B2"},"lead_id":{"oneOf":[{"type":"string","description":"Номер заявки."},{"type":"null"}]},"form":{"oneOf":[{"type":"string","description":"Слаг форми."},{"type":"null"}]},"product":{"type":"string"},"status":{"type":"string","description":"Стан замовлення.","example":"paid"},"amount":{"type":"string","description":"Сума у валюті платежу.","example":"990.00"},"currency":{"type":"string","example":"USD"},"base_amount":{"type":"string","description":"Скільки зарахують мерчанту.","example":"990.00"},"base_currency":{"type":"string","example":"UAH"},"fee":{"oneOf":[{"type":"string","description":"Комісія.","example":"990.00"},{"type":"null"}]},"fee_currency":{"oneOf":[{"type":"string","description":"Валюта комісії — базова валюта мерчанта."},{"type":"null"}]},"wfp_status":{"type":"string","description":"Статус WayForPay дослівно."},"reason":{"type":"string","description":"Причина відмови, текстом."},"reason_code":{"type":"string"},"at":{"type":"string","description":"Час, ISO 8601.","example":"2026-10-13T14:05:00+03:00"},"client":{"type":"object","additionalProperties":true,"description":"Основні дані людини: з форми, а якщо там порожньо — з оплати.","properties":{"client_name":{"type":"string"},"client_phone":{"type":"string"},"client_email":{"type":"string"}}},"payer":{"type":"object","additionalProperties":true,"description":"Рівно те, що людина ввела на сторінці оплати: name, email, phone."},"person":{"type":"object","additionalProperties":true,"description":"Обидва джерела окремо: name, email, phone, *_form, *_payment і списки без повторів."},"utm":{"type":"object","additionalProperties":{"type":"string"},"description":"Мітки. П'ять ключів utm_* є завжди (порожні теж), решта — якщо були в адресі.","properties":{"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_content":{"type":"string"},"utm_term":{"type":"string"}}}},"required":["event","order_ref","product","status","amount","currency","at","client","utm"]}},"responses":{"Unauthorized":{"description":"Ключа немає або він недійсний.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"unauthorized","message":"invalid or missing API key"}}}},"Forbidden":{"description":"Ключ не має доступу: він лише на читання, проєкт інший, розділ власникові ключа не відкрили, або запит прийшов із чужої сторінки в браузері.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"forbidden","message":"Цей ключ лише на читання. Зміни потребують ключа з правом «Читання й зміни» (створюється в профілі ProForms)."}}}},"NotFound":{"description":"Немає проєкту чи запису з таким id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"not_found","message":"Проєкту «x» немає. Список — у projects_list."}}}},"Invalid":{"description":"Аргументи не прийнято: бракує обов'язкового, значення поза переліком, або сервіс відмовив. Якщо є errors — це помилки полів. Нічого не збережено.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiError"},{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"string"}}}}]},"example":{"ok":false,"error":"invalid","message":"Не збережено — виправте й повторіть:","errors":{"price":"Ціна має бути більшою за нуль."}}}}},"RateLimited":{"description":"Понад 120 викликів на хвилину на ключ (спільно з /mcp). Заголовок Retry-After каже, скільки чекати.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"ok":false,"error":"rate_limited","message":"rate limit: 120 calls per minute"}}}}}}}