Sign in
Sign in with an existing Volt account to get a session token.
curl https://app.volt.im/api/auth \
--json '{"username":"YOUR_USERNAME","password":"YOUR_PASSWORD"}'
Use the returned token as VOLT_SESSION in requests that use the __Host-volt-token session cookie.
Bot API
Users type @examplebot hello in the web composer. Your bot receives the search query and returns results for the user to choose and send. The update contains the sender’s identity, query, and pagination offset.
The /bot/ endpoints use Authorization: Bearer <bot token>. Their JSON responses contain ok and result on success, or ok, error_code, and description on failure.
Register a bot
Choose a unique username of 5–32 characters ending in bot. Letters, digits, underscores, and hyphens are allowed.
curl https://app.volt.im/api/bots \
--cookie "__Host-volt-token=$VOLT_SESSION" \
--json '{"username":"examplebot","first_name":"Example"}'
The response contains a bot object and a token. Use the returned token as VOLT_BOT_TOKEN in the following examples.
Get bot identity
curl https://app.volt.im/bot/getMe \
--header "Authorization: Bearer $VOLT_BOT_TOKEN"
The result includes id, username, first_name, is_bot, and supports_inline_queries.
Poll for updates
curl https://app.volt.im/bot/getUpdates \
--header "Authorization: Bearer $VOLT_BOT_TOKEN" \
--json '{"offset":0,"limit":20}'
Each entry in result contains an update_id and one of message, callback_query, and inline_query. All three use the same offset. The limit accepts 1–100. Poll about once per second when idle. For the next call, use the highest processed update_id plus one as the offset to acknowledge those updates.
Answer a query
An inline_query contains id, from, query, and offset. Use its id as inline_query_id. The example uses "123" as a placeholder.
curl https://app.volt.im/bot/answerInlineQuery \
--header "Authorization: Bearer $VOLT_BOT_TOKEN" \
--json '{
"inline_query_id": "123",
"results": [{
"type": "article",
"id": "hello",
"title": "Say hello",
"input_message_content": {"message_text": "Hello from Volt"}
}],
"next_offset": ""
}'
Return up to 50 results with unique IDs. An optional HTTPS thumbnail_url previews a result.
article- Set
titleandinput_message_content.message_text. gif- Set
gif_urlto a direct HTTPS GIF URL. video- Set
titleand an HTTPSvideo_url.
For media, input_message_content.message_text can override the sent link. Set next_offset to offer another page. Queries expire after two minutes. A successful answer returns {"ok":true,"result":true} and can be retried with the same payload.
Rotate a token
The bot owner can issue a new token using their Volt session. The old token expires immediately.
curl https://app.volt.im/api/bots/examplebot/token \
--cookie "__Host-volt-token=$VOLT_SESSION" \
--request POST
Built-in bots
Type @vid search terms to look up YouTube videos or @gif search terms to look up GIFs. Availability depends on whether the Volt instance has the corresponding search provider configured.
Direct bot chats
Share https://app.volt.im/bots/examplebot. When a signed-in user presses Start chat, Volt opens a private conversation and sends /start to the bot. The bot receives text written in that conversation. Deleting the chat closes it to the bot until the user opens it again.
Poll getUpdates for a message with message_id, date, from, chat, and text. Unacknowledged message updates expire after one day. Use message.chat.id as chat_id when replying.
curl https://app.volt.im/bot/sendMessage \
--header "Authorization: Bearer $VOLT_BOT_TOKEN" \
--json '{
"chat_id": 42,
"text": "Hello from Volt",
"reply_parameters": {"message_id": 123}
}'
Replace 42 and 123 with the IDs in your update. The reply is optional. Messages support plain text up to 4096 characters. Supply an optional client_id to retry a send without posting a second copy.
POST /bot/getChat- Pass
chat_idto look up an open conversation with your bot. POST /bot/editMessageText- Pass
chat_id,message_id, and the newtextto edit a message sent by your bot. POST /bot/deleteMessage- Pass
chat_idandmessage_idto remove a message sent by your bot.
A signed-in Volt API client can open the same conversation with POST /api/bots/examplebot/chat, then send text through the regular messaging API.