Перейти к основному содержанию
POST
/
api
/
routes
/
add
Add a route
curl --request POST \
  --url http://localhost:8080/api/routes/add \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "source_bot_id": 1,
  "target_bot_id": 2,
  "condition_type": "chat_id",
  "condition_value": "-100123456789",
  "action": "forward",
  "target_chat_id": -100987654321,
  "enabled": true,
  "description": "Forward support chat to ops bot"
}
'
{
  "id": 123,
  "source_bot_id": 123,
  "target_bot_id": 123,
  "condition_type": "<string>",
  "condition_value": "<string>",
  "action": "<string>",
  "target_chat_id": 123,
  "enabled": true,
  "description": "<string>"
}

Авторизации

Authorization
string
header
обязательно

API key with bmx_ prefix. Obtain via /api/auth/api-keys.

Тело

application/json
source_bot_id
integer
обязательно

Source bot ID

target_bot_id
integer
обязательно

Target bot ID

action
string
обязательно

Routing action

condition_type
string

Condition type (chat_id, user_id, keyword, all)

condition_value
string

Value for the condition

target_chat_id
integer

Target chat ID

enabled
boolean
по умолчанию:true

Start enabled

description
string

Human-readable description

Ответ

Route created

id
integer

Route ID

source_bot_id
integer

Source bot that receives messages

target_bot_id
integer

Target bot that forwards messages

condition_type
string

Condition to match (e.g., chat_id, user_id, keyword, all)

condition_value
string

Value to match for the condition

action
string

Action to take (forward, copy, etc.)

target_chat_id
integer

Target chat to route messages to

enabled
boolean

Whether this route is active

description
string

Human-readable description of this route