Create Bot
POST
/v1/bots
const url = 'https://api.cloud.agentums.ru/v1/bots';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"agent_slug":"assistant","title":"","token":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.cloud.agentums.ru/v1/bots \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "agent_slug": "assistant", "title": "", "token": "example" }'Создаёт бота по токену @BotFather и пресету. Валидирует токен, ставит вебхук.
Authorizations
Заголовок раздела «Authorizations»Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
BotCreateIn
Создание бота: токен @BotFather + выбранный пресет.
object
agent_slug
Agent Slug
string
title
Title
string
token
required
Token
string
Responses
Заголовок раздела «Responses»Successful Response
Media typeapplication/json
BotCreatedOut
Ответ на создание: карточка + подсказка, если вебхук не зарегистрировался.
object
agent_slug
required
Agent Slug
string
allowlist_count
Allowlist Count
integer
can_read_all_messages
Can Read All Messages
boolean
created_at
Created At
string
deep_link
Deep Link
string
enabled
required
Enabled
boolean
id
required
Id
string
owner_bound
required
Owner Bound
boolean
provider
required
Provider
string
title
required
Title
string
username
required
Username
string
webhook_note
Webhook Note
string
webhook_set
required
Webhook Set
boolean
Example
{ "allowlist_count": 0, "can_read_all_messages": false, "created_at": "", "deep_link": "", "webhook_note": ""}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}