Bots on Qivuna
A bot is a Qivuna account run by your server. People chat with it one to one, and room admins can add it to groups and channels with the rights they choose.
The API in one minute#
Every method is an HTTPS request to https://bots.qivuna.com/v1/<method> with the bot's token in the Authorization header:
curl -s https://bots.qivuna.com/v1/getMe \
-H "Authorization: Bot $QIVUNA_BOT_TOKEN"
{"ok":true,"result":{"id":7123456789,"is_bot":true,"first_name":"Weather","username":"weather_bot",
"can_join_groups":true,"can_join_channels":true,"privacy_mode":true,"e2ee_mode":"plain",
"api_version":"1.0","status":"development","tier":"new"}}
The bot receives updates — messages, button presses, being added to a room — by long polling getUpdates (a webhook option opens later), and answers with methods like sendMessage:
curl -s https://bots.qivuna.com/v1/sendMessage \
-H "Authorization: Bot $QIVUNA_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"chat_id": 4503600212045337, "text": "Hello!"}'
Where bots can be#
| Context | How the bot takes part |
|---|---|
| 1:1 chat with a plain bot | Server-readable messages. The app labels the chat: “Messages here are not end-to-end encrypted. Qivuna and the bot's developer can read them.” |
| 1:1 chat with an encrypted bot | End-to-end encrypted to the bot's key. Label: “Only the bot's developer can read what you send it.” |
| Public group | Added by an admin with rights (a server grant). Privacy mode decides what it reads. |
| Channel (public or private) | Added by the owner or an admin; receives every post; posts with can_post. |
| Private group, not yet encrypted | A server grant without “read all”. When the group becomes end-to-end encrypted, the grant is suspended at once. |
| Private group, end-to-end encrypted | Encrypted bots only, in addressed mode: the bot receives only what a member explicitly sends to it, and answers privately to that member. It never gets the group's key. |
| Secret chats and calls | Never. |
What bots never see#
- Phone numbers, e-mail addresses, last-seen times, contacts, or anyone's other chats and groups.
- Messages of other bots.
- End-to-end encrypted messages, except those sealed to the bot itself.
- Disappearing messages, secret chats, and the app's own system lines.
- In groups with privacy mode on: anything but commands, mentions of the bot and replies to it.
The app shows every person the same facts on the bot's profile (“What this bot can see”) and in each room's Bots section.
The lifecycle of a bot#
- Create it with @qivbot, in the Qivuna app. It starts in development mode: anyone with the link can start it, but it can join only your own small groups and does not appear in search.
- Build it against the API with your token.
- Publish it from QivBot when it has a description and at least one command. It then appears in search and any admin can add it.
- Optionally ask for the blue check.
A bot can be restricted (reads only), suspended or banned for abuse; see Reporting and abuse. Deleting a bot is permanent; its handle stays reserved for 30 days.
Coming from Telegram#
Method names, update shapes and keyboards follow the Telegram Bot API where that made sense. The differences that matter:
- Authentication is the header
Authorization: Bot <token>only. There is no/bot<token>/path; a token in a URL is revoked automatically (400token_in_url). - Errors are
{"ok": false, "error": {"code", "message", "retry_after", "parameter"}, "request_id"}with stable string codes and real HTTP statuses. See Errors. - Bots are not members. Admins grant named rights. Bots cannot add people to rooms;
createChatInviteLinkmakes a link people use themselves. - Ids are pseudonymous and differ between bot owners. Room ids are negative. See Ids.
- Start produces a
bot_startedupdate (withstart_param), not a/startmessage. Stopping the bot producesbot_blocked. - Formatting:
entities, orparse_mode: "HTML"with a small tag set. No Markdown modes. - Keyboards: inline keyboards with
callback_dataorurlbuttons only. No reply keyboards, no inline mode, no login or web-app buttons. - Media:
photois one File, not a list of sizes. Files are uploaded with multipart or reused byfile_id; sending by URL is not supported. - Moderation:
unbanChatMemberrestores membership;restrictChatMemberonly mutes or unmutes. - Webhooks must pass an ownership challenge and are signed with HMAC-SHA256 over the timestamp and the raw body. A webhook's response body is ignored (you cannot answer with a method call).
- Not in v1:
sendPoll,forwardMessage,copyMessage, inline mode, web apps, payments, and a Telegram-compatible token-in-path layer.