Skip to content

Objects ​

Fields that are empty are usually left out of the JSON.

User ​

FieldType
idstringAccount id.
namestringDisplay name.
botboolThe account is a bot.

Chat ​

FieldType
idstringFor a private chat — the other person's id.
typestringdirect or group.
titlestringThe person's name or the group's title.
membersstring[]Group members' ids.
ownerstringThe group's owner.
requestboolNot accepted yet: a chat request or an invitation.
botboolA private chat with another bot.
expire_secintDisappearing-messages timer, seconds.

Message ​

FieldType
idstring
chat_idstring
fromUserThe sender; absent on the bot's own messages.
tsintSent at, ms.
statusstringOwn messages only: pending, sent, delivered, read, failed.
textstring
mentionsMention[]
reply_tostringId of the quoted message.
attachmentAttachment
pollPoll
reactions{from, emoji}[]from is empty for the bot's own reaction.
edited_tsintLast edit, ms.
expire_secintThe message disappears after this many seconds.
buttonsButton[][]

Mention ​

{user, offset, length}: the account id and where the mention is in text, in UTF-16 code units.

Attachment ​

FieldType
kindstringphoto, video, voice, file.
mimestring
namestringFile name.
sizeintBytes.
captionstring
width, heightintPhoto and video.
duration_msintVideo and voice.

The content is not in the update: download it with GET …/messages/{msg}/file.

Poll ​

FieldType
questionstring
options{text, voters}[]voters — account ids.
multipleboolSeveral options may be chosen.
close_tsintCloses automatically at, ms.
closedbool

Button ​

{text, data} or {text, url}. See buttons.

Update ​

FieldType
idintGrows by one; pass id + 1 as offset.
typestringmessage, edited, deleted, reaction, poll, chat, notice, expired, button.
chat_idstring
messageMessagemessage, edited, poll.
chatChatchat.
deleted{message_id, from}deleted.
reaction{message_id, from, emoji}reaction; empty emoji — removed.
noticeNoticenotice.
expiredstring[]expired: ids of erased messages.
button{message_id, from, data, press_id}button.

from in deleted, reaction and button is a User.

Notice ​

{from, code}, where code is one of:

code
expire_timer:<sec>The disappearing-messages timer changed (0 — off).
message_pinned:<preview>A message was pinned.
group_renamed:<name>
group_photo_changed, group_photo_removed
safety_number_changedThe person's keys changed (a new device or a reinstall).