{"openapi":"3.1.0","info":{"title":"Selper Landing Chat API","version":"1.1.0","description":"Каталог агентів, діалоги й голос. Для серверних запитів передавайте X-API-Key. Для прямого браузерного чату отримайте короткочасний токен і передавайте його в Authorization: Bearer."},"servers":[{"url":"/","description":"Бекенд Selper, який надає цю документацію"}],"security":[{"LandingApiKey":[]}],"tags":[{"name":"Доступ"},{"name":"Каталог"},{"name":"Діалог"},{"name":"Голос"}],"paths":{"/api/landing-chat/access-token":{"post":{"tags":["Доступ"],"operationId":"createBrowserChatToken","summary":"Отримати токен для браузерного чату","description":"Викликайте із сервера з X-API-Key. Браузер використовує токен лише для вказаного агента та точного origin сайту. Щоб оновити токен, виконайте новий серверний запит.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrowserChatAccessInput"}}}},"responses":{"200":{"description":"Короткочасний токен для агента й origin","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrowserChatAccess"}}}},"400":{"description":"Некоректний запит","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Сервіс тимчасово недоступний","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/showcase-bots":{"get":{"tags":["Каталог"],"operationId":"getShowcaseBots","summary":"Агенти для кейсів","responses":{"200":{"description":"Список агентів","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Секрет сесії або доступ до ресурсу не підтверджено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/workspace-bots/{workspace_id}":{"get":{"tags":["Каталог"],"operationId":"getWorkspaceBots","summary":"Агенти робочого простору","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Список агентів","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Секрет сесії або доступ до ресурсу не підтверджено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public-agent/{bot_id}/config":{"parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"tags":["Діалог"],"operationId":"getBotConfig","summary":"Конфігурація агента","security":[{"LandingApiKey":[]},{"BrowserChatToken":[]}],"responses":{"200":{"description":"Доступні можливості","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotConfig"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public-agent/{bot_id}/session":{"parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"tags":["Діалог"],"operationId":"createSession","summary":"Створити сесію діалогу","security":[{"LandingApiKey":[]},{"BrowserChatToken":[]}],"responses":{"200":{"description":"Нова сесія","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Перевищено ліміт запитів","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public-agent/{bot_id}/message":{"parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"tags":["Діалог"],"operationId":"sendMessage","summary":"Надіслати повідомлення","security":[{"LandingApiKey":[]},{"BrowserChatToken":[]}],"description":"Відповідь агента приходить асинхронно. Для мережевого повтору надішліть той самий client_message_id і текст.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageInput"}}}},"responses":{"200":{"description":"Підтвердження прийому","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Receipt"}}}},"400":{"description":"Некоректний запит","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Секрет сесії або доступ до ресурсу не підтверджено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфлікт поточного стану або недоступна можливість агента","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Термін дії сесії минув","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Перевищено ліміт запитів","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public-agent/{bot_id}/message-status":{"parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"tags":["Діалог"],"operationId":"getMessageStatus","summary":"Статус повідомлення","security":[{"LandingApiKey":[]},{"BrowserChatToken":[]}],"parameters":[{"name":"session_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"client_message_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"X-CSRF-Token","in":"header","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{64}$"}}],"responses":{"200":{"description":"Статус обробки та ідентифікатор відповіді","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Receipt"}}}},"400":{"description":"Некоректний запит","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Секрет сесії або доступ до ресурсу не підтверджено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Термін дії сесії минув","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public-agent/{bot_id}/history":{"parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"tags":["Діалог"],"operationId":"getHistory","summary":"Історія діалогу","security":[{"LandingApiKey":[]},{"BrowserChatToken":[]}],"parameters":[{"name":"session_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"X-CSRF-Token","in":"header","required":false,"schema":{"type":"string","pattern":"^[a-f0-9]{64}$"},"description":"Обов’язковий для браузерного запиту з Authorization: Bearer. Використовуйте csrf_token поточної сесії."}],"responses":{"200":{"description":"Повідомлення або порожній список","content":{"application/json":{"schema":{"$ref":"#/components/schemas/History"}}}},"400":{"description":"Некоректний запит","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Секрет сесії або доступ до ресурсу не підтверджено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Термін дії сесії минув","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public-agent/{bot_id}/events":{"parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"tags":["Діалог"],"operationId":"streamEvents","summary":"Потік Server-Sent Events","security":[{"LandingApiKey":[]},{"BrowserChatToken":[]}],"parameters":[{"name":"session_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"X-CSRF-Token","in":"header","required":false,"schema":{"type":"string","pattern":"^[a-f0-9]{64}$"},"description":"Обов’язковий для браузерного запиту з Authorization: Bearer. Використовуйте csrf_token поточної сесії."}],"description":"У браузері відкрийте потік через fetch із заголовком Authorization. Кадр data містить JSON із типом connected, typing або message. Кадр message містить message з даними відповіді та окреме поле ui_instructions. Після розриву перечитайте історію.","responses":{"200":{"description":"Потік із JSON у полях data, а також коментарями : ping","content":{"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Некоректний запит","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Секрет сесії або доступ до ресурсу не підтверджено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Термін дії сесії минув","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public-agent/{bot_id}/session/reset":{"parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"tags":["Діалог"],"operationId":"resetSession","summary":"Скинути сесію","security":[{"LandingApiKey":[]},{"BrowserChatToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionInput"}}}},"responses":{"200":{"description":"Нова пара ідентифікатора та секрету","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"400":{"description":"Некоректний запит","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Секрет сесії або доступ до ресурсу не підтверджено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Перевищено ліміт запитів","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public-agent/{bot_id}/voice-message":{"parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"tags":["Голос"],"operationId":"sendVoiceMessage","summary":"Надіслати голосове повідомлення","security":[{"LandingApiKey":[]},{"BrowserChatToken":[]}],"parameters":[{"name":"session_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"X-CSRF-Token","in":"header","required":false,"schema":{"type":"string","pattern":"^[a-f0-9]{64}$"},"description":"Обов’язковий для браузерного запиту з Authorization: Bearer. Використовуйте csrf_token поточної сесії."},{"name":"csrf_token","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-f0-9]{64}$"},"description":"Для серверного запиту з X-API-Key."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"audio":{"type":"string","format":"binary"}},"required":["audio"]}}}},"responses":{"200":{"description":"Транскрипт, відповідь та адреса аудіо","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceReply"}}}},"400":{"description":"Некоректний запит","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Секрет сесії або доступ до ресурсу не підтверджено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфлікт поточного стану або недоступна можливість агента","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Термін дії сесії минув","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Перевищено ліміт запитів","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public-agent/{bot_id}/voice/audio/{messageId}":{"parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"get":{"tags":["Голос"],"operationId":"getVoiceAudio","summary":"Завантажити голосову відповідь","security":[{"LandingApiKey":[]},{"BrowserChatToken":[]}],"parameters":[{"name":"session_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"X-CSRF-Token","in":"header","required":false,"schema":{"type":"string","pattern":"^[a-f0-9]{64}$"},"description":"Обов’язковий для браузерного запиту з Authorization: Bearer. Використовуйте csrf_token поточної сесії."}],"responses":{"200":{"description":"Файл WAV","content":{"audio/wav":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Секрет сесії або доступ до ресурсу не підтверджено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Термін дії сесії минув","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public-agent/{bot_id}/realtime/validate":{"parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"tags":["Голос"],"operationId":"validateRealtimeSession","summary":"Перевірити сесію для realtime","security":[{"LandingApiKey":[]},{"BrowserChatToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionInput"}}}},"responses":{"200":{"description":"Сесія підтверджена","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"const":true}},"required":["valid"]}}}},"400":{"description":"Некоректний запит","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Секрет сесії або доступ до ресурсу не підтверджено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Термін дії сесії минув","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public-agent/{bot_id}/realtime/session":{"parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"post":{"tags":["Голос"],"operationId":"startRealtimeSession","summary":"Почати дзвінок WebRTC","security":[{"LandingApiKey":[]},{"BrowserChatToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","minLength":1,"maxLength":200},"csrf_token":{"type":"string","pattern":"^[a-f0-9]{64}$"},"sdp":{"type":"string","pattern":"^v=0","minLength":1,"maxLength":65536}},"required":["session_id","csrf_token","sdp"]}}}},"responses":{"200":{"description":"Ідентифікатор дзвінка та SDP answer","content":{"application/json":{"schema":{"type":"object","properties":{"call_id":{"type":"string"},"session_id":{"type":"string","minLength":1,"maxLength":200},"answer_sdp":{"type":"string"}},"required":["call_id","session_id","answer_sdp"]}}}},"400":{"description":"Некоректний запит","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Секрет сесії або доступ до ресурсу не підтверджено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфлікт поточного стану або недоступна можливість агента","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Термін дії сесії минув","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Перевищено ліміт запитів","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Помилка постачальника realtime","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Сервіс тимчасово недоступний","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/public-agent/{bot_id}/realtime/{callId}/end":{"parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"callId","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,200}$"}}],"post":{"tags":["Голос"],"operationId":"endRealtimeSession","summary":"Завершити дзвінок","security":[{"LandingApiKey":[]},{"BrowserChatToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionInput"}}}},"responses":{"200":{"description":"Дзвінок завершено","content":{"application/json":{"schema":{"type":"object","properties":{"ended":{"const":true}},"required":["ended"]}}}},"400":{"description":"Некоректний запит","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Відсутній, прострочений або недійсний ключ чи токен доступу. Токен має відповідати агенту й origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Секрет сесії або доступ до ресурсу не підтверджено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Агент, сесія або ресурс недоступні","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Сервіс тимчасово недоступний","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Помилка запиту","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"LandingApiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Запросіть API-ключ у адміністратора та зберігайте його на своєму сервері."},"BrowserChatToken":{"type":"http","scheme":"bearer","description":"Короткочасний токен, виданий через POST /api/landing-chat/access-token для одного агента й origin сайту."}},"schemas":{"BrowserChatAccessInput":{"type":"object","properties":{"bot_id":{"type":"string","format":"uuid"},"origin":{"type":"string","format":"uri","examples":["https://example.com"]}},"required":["bot_id","origin"]},"BrowserChatAccess":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"const":"Bearer"},"expires_in":{"type":"integer","minimum":1,"description":"Термін дії токена в секундах.","examples":[900]}},"required":["access_token","token_type","expires_in"]},"Catalog":{"type":"object","properties":{"bots":{"type":"array","items":{"$ref":"#/components/schemas/CatalogBot"}}},"required":["bots"]},"CatalogBot":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"short_description":{"type":"string"},"description":{"type":"string"},"logo_url":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","name","short_description","description","logo_url","tags"]},"BotConfig":{"type":"object","properties":{"bot_id":{"type":"string","format":"uuid"},"bot_name":{"type":"string"},"is_public":{"type":"boolean"},"is_active":{"type":"boolean"},"voice_enabled":{"type":"boolean"},"realtime_enabled":{"type":"boolean"},"voice_language":{"type":["string","null"]},"test_mode":{"type":"boolean"}},"required":["bot_id","bot_name","is_public","is_active","voice_enabled","realtime_enabled","voice_language","test_mode"]},"SessionInput":{"type":"object","properties":{"session_id":{"type":"string","minLength":1,"maxLength":200},"csrf_token":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["session_id","csrf_token"]},"Session":{"type":"object","properties":{"session_id":{"type":"string","minLength":1,"maxLength":200},"csrf_token":{"type":"string","pattern":"^[a-f0-9]{64}$"},"bot_name":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}},"required":["session_id","csrf_token"]},"MessageInput":{"type":"object","properties":{"session_id":{"type":"string","minLength":1,"maxLength":200},"csrf_token":{"type":"string","pattern":"^[a-f0-9]{64}$"},"message":{"type":"string","minLength":1,"maxLength":4000},"client_message_id":{"type":"string","format":"uuid","description":"Задайте UUID для безпечного повтору та перевірки статусу."},"client_name":{"type":"string"}},"required":["session_id","csrf_token","message"]},"Receipt":{"type":"object","properties":{"success":{"type":"boolean"},"session_id":{"type":"string","minLength":1,"maxLength":200},"client_message_id":{"type":["string","null"],"format":"uuid"},"message_id":{"type":["string","null"],"format":"uuid"},"status":{"enum":["processing","completed","failed","not_found"]},"reply_message_id":{"type":["string","null"],"format":"uuid"},"duplicate":{"type":"boolean"},"rate_remaining":{"type":"integer","minimum":0}},"required":["success","session_id","client_message_id","message_id","status","reply_message_id","duplicate"]},"History":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}},"required":["messages"]},"Message":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"role":{"enum":["user","assistant"]},"text":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/Action"}},"images":{"type":"array","items":{"type":"string"}},"ui_instructions":{"type":["object","null"]},"metadata":{"type":["object","null"]}},"required":["id","role","text","createdAt","actions","images","ui_instructions","metadata"]},"Action":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"label":{"type":"string"},"action":{"type":"string"},"payload":{"type":["object","null"]},"style":{"type":["string","null"]}},"required":["type","label","action"]},"VoiceReply":{"type":"object","properties":{"transcript":{"type":"string"},"finalText":{"type":"string"},"message_id":{"type":"string","format":"uuid"},"audio_url":{"type":["string","null"]},"rate_remaining":{"type":"integer","minimum":0}},"required":["transcript","finalText","message_id","audio_url","rate_remaining"]},"Error":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"retryAfter":{"type":"integer","minimum":0}},"required":["error"]}}}}