Call protocol (ops)
An operation is the value of the op key in a request. The Python SDK wraps them in methods; Rust and C use the same names. Below are all operations used by the Python SDK, with permissions.
Messages
Section titled “Messages”| Operation | Key arguments | Permissions |
|---|---|---|
messages.send |
chat, text, reply_to, topic, silent, schedule, format, entities, custom_emoji |
messages.send |
messages.send_media |
chat, data (bytes), name, caption, kind, spoiler, duration |
messages.send |
messages.send_poll |
chat, question, options, anonymous, multiple, quiz, correct, explanation, close_period |
messages.send |
messages.edit |
chat, id, text, format, entities |
messages.edit |
messages.edit_media |
chat, id, data, name, caption, kind |
messages.edit |
messages.delete |
chat, ids, everyone |
messages.delete |
messages.react |
chat, id, emoji or custom_emoji |
messages.react |
messages.reactions |
chat, id, emoji, limit |
messages.read |
messages.forward |
from_chat, ids, to_chat, silent |
messages.send, messages.read |
messages.history |
chat, limit, before, topic, from_user |
messages.history |
messages.search / messages.get / messages.reply_chain / messages.pinned / messages.scheduled |
see the Python API | messages.history |
messages.scheduled_delete |
chat, ids |
messages.delete |
messages.pin / messages.unpin |
chat, id |
chats.manage |
messages.set_outgoing |
text, format, silent, schedule, reply_to, topic, entities |
messages.transform_outgoing |
messages.drop_outgoing |
reason |
messages.transform_outgoing |
messages.set_incoming / messages.hide_incoming |
text, entities, format / reason |
messages.transform_incoming |
Chats, users, channels
Section titled “Chats, users, channels”chats.list, chat.info, chats.mark_read, chats.action, chats.members, chats.admins, chats.ban, chats.unban, chats.mute, chats.archive, chats.pin; users.info, users.resolve, users.photo, users.block, users.unblock; channels.info, channels.resolve, channels.photo; contacts.list, contacts.add; folders.list; stickers.send/search/recent (permission messages.send); bots.inline_query, bots.send_inline_result, bots.press_button.
Storage and time
Section titled “Storage and time”storage.get, storage.set, storage.delete, storage.list (prefix, limit), storage.usage; time.now; time.sleep (ms; async only, a synchronous call returns invalid); timers.set (id, delay in ms, repeat), timers.clear, timers.list.
Network
Section titled “Network”net.fetch (url, method, headers, body, timeout), net.tcp.connect, net.udp.connect, net.socket.send/recv/close, net.ws.connect/send/recv/close.
Interface
Section titled “Interface”ui.toast, ui.open_settings, ui.settings.set, ui.dialog.show, ui.dialog.close, ui.window.show, ui.window.update, ui.window.close, badges.set, badges.clear, notify.show, clipboard.read/write, composer.draft, composer.set_draft, composer.insert.
Files and media
Section titled “Files and media”files.pick, files.save, fs.list/stat/read/write/mkdir/remove/rename (all async only), media.get, media.list, image.info/resize/convert/crop.
Service
Section titled “Service”| Operation | Purpose |
|---|---|
meta.info |
API version, plugin id, permissions |
log |
write to the log (text) |
plugin.unload |
unload the plugin |
plugins.send, plugins.peers |
messages between plugins |
translate.reply, ai.reply |
answers to translate.request / ai.request (ticket, items/text, error, format) |
account.info, stars.balance, settings.read |
account and settings information |
ghost.get, ghost.set |
ghost mode (permission ghost.control) |
notify.show |
system notification (permission notifications) |
