Buko Docs

Bot API

Buko Bot API lets an external agent operate a bot account inside Buko chats. The bot is only the messaging endpoint. Your agent service decides what to do with each message.

Status

Bot API is available for official and approved bots. Public self-service bot creation is not open yet.

Base URLs

PurposeURL
REST APIhttps://ims.buko.app
Bot Gateway WebSocketwss://ims.buko.app/bot/ws
Documentationhttps://im.buko.app/dev-docs/bot-api/

All REST methods use HTTPS. All Bot Gateway connections use WSS.

Core concepts

ConceptMeaning
Bot accountA Buko identity with kind = bot, display name, handle, avatar, and owner.
Official botA Buko-operated bot with an explicit official marker in clients.
Managed agentA Buko official bot whose token is encrypted in secret_vault for the official runner.
Bot tokenSecret token used by your agent. It starts with bot_.
ChatA Buko space_id. It can be a private bot DM or a group.
UpdateAn event delivered to a bot, such as message, edited_message, or my_chat_member.
Message IDThe message seq inside one chat, serialized as a string.

Identifier contract

Buko uses Telegram-like method names, but identifiers follow Buko's existing chat model.

API fieldBuko meaningType
chat_idspace_id, opaque stringstring
message_idmessage seq inside the chatstring
reply_to_message_idtarget message seq in the same chatstring
update_idmonotonically increasing update id scoped to one botstring
from.idper-bot scoped user idstring

message_id is not a small global integer. Treat it as an opaque string even when it looks numeric.

from.id is scoped to the current bot. It is stable for that bot, but it is not the user's raw internal account id.

Private chats and /start

Bots cannot send private messages to arbitrary users.

A private bot chat becomes available only after a user starts the bot from the Buko app. The current user-facing start flow creates or opens the private chat, records the start relationship, and sends a visible /start message into that chat. The /start message is delivered to the bot as a normal message update.

Groups

Bots can be added to groups. In groups, privacy mode is enabled by default: the bot receives only explicit invocations:

Bot-authored messages are not echoed back to the same bot.

Delivery modes

Buko does not support webhooks. Use one of these modes:

See Receiving Updates.

Quick start

export BUKO_BOT_TOKEN="bot_xxx"

curl -sS https://ims.buko.app/bot/getMe \
  -X POST \
  -H "Authorization: Bot $BUKO_BOT_TOKEN" \
  -H "Content-Type: application/json"

Send a message after a user has started your bot:

curl -sS https://ims.buko.app/bot/sendMessage \
  -X POST \
  -H "Authorization: Bot $BUKO_BOT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "spc_abc123",
    "text": "Hello from Buko Bot API"
  }'

Response envelope

Successful responses use:

{
  "ok": true,
  "result": {}
}

Errors use:

{
  "ok": false,
  "error_code": 403,
  "code": "CHAT_FORBIDDEN",
  "description": "User has not started this bot."
}