Layers 8–216
E2E 90 constructors 0 methods

How it fits in

Secret chats derive a shared auth_key via Diffie–Hellman. Every secret-chat message is serialised as a DecryptedMessageLayer wrapping a DecryptedMessage, then AES-256-IGE encrypted and shipped via messages.sendEncrypted.

Each abstract type below is a tagged union; the constructor id selects the variant. Source: core.telegram.org/schema/end-to-end-json.

DecryptedMessage — 6 constructors · layer 8–73

The encrypted-payload counterpart to messages.Message inside a secret chat.

decryptedMessage #528568095 · layer 8
NameTypeNotes
random_idlongPer-message client-generated nonce used to deduplicate retransmissions.
random_bytesbytesRandom padding so that two identical plaintexts encrypt to different ciphertexts.
messagestringPlaintext of the message.
mediaDecryptedMessageMediaOptional attachment carried in the message.
decryptedMessageService #-1438109059 · layer 8
NameTypeNotes
random_idlongPer-message client-generated nonce used to deduplicate retransmissions.
random_bytesbytesRandom padding so that two identical plaintexts encrypt to different ciphertexts.
actionDecryptedMessageAction
decryptedMessage #541931640 · layer 17
NameTypeNotes
random_idlongPer-message client-generated nonce used to deduplicate retransmissions.
ttlintSelf-destruct timer in seconds. 0 means the message is permanent.
messagestringPlaintext of the message.
mediaDecryptedMessageMediaOptional attachment carried in the message.
decryptedMessageService #1930838368 · layer 17
NameTypeNotes
random_idlongPer-message client-generated nonce used to deduplicate retransmissions.
actionDecryptedMessageAction
decryptedMessage #917541342 · layer 45
NameTypeNotes
flags#
random_idlongPer-message client-generated nonce used to deduplicate retransmissions.
ttlintSelf-destruct timer in seconds. 0 means the message is permanent.
messagestringPlaintext of the message.
mediaflags.9?DecryptedMessageMediaOptional attachment carried in the message.
entitiesflags.7?Vector<MessageEntity>Inline formatting spans (bold, italic, mention, etc.).
via_bot_nameflags.11?stringUsername of the inline bot that produced this message.
reply_to_random_idflags.3?longrandom_id of the message this one replies to.
decryptedMessage #-1848883596 · layer 73
NameTypeNotes
flags#
random_idlongPer-message client-generated nonce used to deduplicate retransmissions.
ttlintSelf-destruct timer in seconds. 0 means the message is permanent.
messagestringPlaintext of the message.
mediaflags.9?DecryptedMessageMediaOptional attachment carried in the message.
entitiesflags.7?Vector<MessageEntity>Inline formatting spans (bold, italic, mention, etc.).
via_bot_nameflags.11?stringUsername of the inline bot that produced this message.
reply_to_random_idflags.3?longrandom_id of the message this one replies to.
grouped_idflags.17?longAlbum group id — messages sharing this id are rendered as one media group.

DecryptedMessageAction — 13 constructors · layer 8–20

Out-of-band actions inside a secret chat (typing notifications, key rekey, screenshot flagged, etc.).

decryptedMessageActionSetMessageTTL #-1586283796 · layer 8
NameTypeNotes
ttl_secondsint
decryptedMessageActionReadMessages #206520510 · layer 8
NameTypeNotes
random_idsVector<long>
decryptedMessageActionDeleteMessages #1700872964 · layer 8
NameTypeNotes
random_idsVector<long>
decryptedMessageActionScreenshotMessages #-1967000459 · layer 8
NameTypeNotes
random_idsVector<long>
decryptedMessageActionFlushHistory #1729750108 · layer 8

No parameters.

decryptedMessageActionResend #1360072880 · layer 17
NameTypeNotes
start_seq_nointFirst sequence number of the rekey/handshake window.
end_seq_nointLast sequence number of the rekey/handshake window.
decryptedMessageActionNotifyLayer #-217806717 · layer 17
NameTypeNotes
layerintTL schema layer the encrypted message was generated against.
decryptedMessageActionTyping #-860719551 · layer 17
NameTypeNotes
actionSendMessageAction
decryptedMessageActionRequestKey #-204906213 · layer 20
NameTypeNotes
exchange_idlongIdentifier of the in-progress Diffie–Hellman rekey.
g_abytesSender side of the Diffie–Hellman exchange (g^a).
decryptedMessageActionAcceptKey #1877046107 · layer 20
NameTypeNotes
exchange_idlongIdentifier of the in-progress Diffie–Hellman rekey.
g_bbytesReceiver side of the Diffie–Hellman exchange (g^b).
key_fingerprintlongFingerprint of the AES-256 key used to encrypt the file payload.
decryptedMessageActionAbortKey #-586814357 · layer 20
NameTypeNotes
exchange_idlongIdentifier of the in-progress Diffie–Hellman rekey.
decryptedMessageActionCommitKey #-332526693 · layer 20
NameTypeNotes
exchange_idlongIdentifier of the in-progress Diffie–Hellman rekey.
key_fingerprintlongFingerprint of the AES-256 key used to encrypt the file payload.
decryptedMessageActionNoop #-1473258141 · layer 20

No parameters.

DecryptedMessageLayer — 1 constructor · layer 17–17

Wrapper that stamps a DecryptedMessage with the schema layer both peers agreed on.

decryptedMessageLayer #467867529 · layer 17
NameTypeNotes
random_bytesbytesRandom padding so that two identical plaintexts encrypt to different ciphertexts.
layerintTL schema layer the encrypted message was generated against.
in_seq_nointNumber of incoming messages (peer→self) the sender has acknowledged.
out_seq_nointNumber of outgoing messages (self→peer) the sender has sent so far.
messageDecryptedMessagePlaintext of the message.

DecryptedMessageMedia — 16 constructors · layer 8–143

Attachments (photo, video, document, geo, contact, etc.) carried inside a DecryptedMessage.

decryptedMessageMediaEmpty #144661578 · layer 8

No parameters.

decryptedMessageMediaPhoto #846826124 · layer 8
NameTypeNotes
thumbbytesInline JPEG thumbnail (always sent in clear, downscaled for preview).
thumb_wintWidth of the inline thumbnail.
thumb_hintHeight of the inline thumbnail.
wintWidth in pixels.
hintHeight in pixels.
sizeintTotal ciphertext size in bytes.
keybytesAES-256 key for the encrypted payload.
ivbytesAES initialization vector for the encrypted payload.
decryptedMessageMediaVideo #1290694387 · layer 8
NameTypeNotes
thumbbytesInline JPEG thumbnail (always sent in clear, downscaled for preview).
thumb_wintWidth of the inline thumbnail.
thumb_hintHeight of the inline thumbnail.
durationintLength in seconds.
wintWidth in pixels.
hintHeight in pixels.
sizeintTotal ciphertext size in bytes.
keybytesAES-256 key for the encrypted payload.
ivbytesAES initialization vector for the encrypted payload.
decryptedMessageMediaGeoPoint #893913689 · layer 8
NameTypeNotes
latdouble
longdouble
decryptedMessageMediaContact #1485441687 · layer 8
NameTypeNotes
phone_numberstring
first_namestring
last_namestring
user_idint
decryptedMessageMediaDocument #-1332395189 · layer 8
NameTypeNotes
thumbbytesInline JPEG thumbnail (always sent in clear, downscaled for preview).
thumb_wintWidth of the inline thumbnail.
thumb_hintHeight of the inline thumbnail.
file_namestringOriginal file name as the sender supplied it.
mime_typestringIANA media type (e.g. image/jpeg, video/mp4).
sizeintTotal ciphertext size in bytes.
keybytesAES-256 key for the encrypted payload.
ivbytesAES initialization vector for the encrypted payload.
decryptedMessageMediaAudio #1619031439 · layer 8
NameTypeNotes
durationintLength in seconds.
sizeintTotal ciphertext size in bytes.
keybytesAES-256 key for the encrypted payload.
ivbytesAES initialization vector for the encrypted payload.
decryptedMessageMediaVideo #1380598109 · layer 17
NameTypeNotes
thumbbytesInline JPEG thumbnail (always sent in clear, downscaled for preview).
thumb_wintWidth of the inline thumbnail.
thumb_hintHeight of the inline thumbnail.
durationintLength in seconds.
mime_typestringIANA media type (e.g. image/jpeg, video/mp4).
wintWidth in pixels.
hintHeight in pixels.
sizeintTotal ciphertext size in bytes.
keybytesAES-256 key for the encrypted payload.
ivbytesAES initialization vector for the encrypted payload.
decryptedMessageMediaAudio #1474341323 · layer 17
NameTypeNotes
durationintLength in seconds.
mime_typestringIANA media type (e.g. image/jpeg, video/mp4).
sizeintTotal ciphertext size in bytes.
keybytesAES-256 key for the encrypted payload.
ivbytesAES initialization vector for the encrypted payload.
decryptedMessageMediaExternalDocument #-90853155 · layer 23
NameTypeNotes
idlong
access_hashlong
dateint
mime_typestringIANA media type (e.g. image/jpeg, video/mp4).
sizeintTotal ciphertext size in bytes.
thumbPhotoSizeInline JPEG thumbnail (always sent in clear, downscaled for preview).
dc_idintData-center where the encrypted file lives.
attributesVector<DocumentAttribute>Type-specific metadata (filename, animated, sticker info, …).
decryptedMessageMediaPhoto #-235238024 · layer 45
NameTypeNotes
thumbbytesInline JPEG thumbnail (always sent in clear, downscaled for preview).
thumb_wintWidth of the inline thumbnail.
thumb_hintHeight of the inline thumbnail.
wintWidth in pixels.
hintHeight in pixels.
sizeintTotal ciphertext size in bytes.
keybytesAES-256 key for the encrypted payload.
ivbytesAES initialization vector for the encrypted payload.
captionstringOptional caption shown under the media.
decryptedMessageMediaVideo #-1760785394 · layer 45
NameTypeNotes
thumbbytesInline JPEG thumbnail (always sent in clear, downscaled for preview).
thumb_wintWidth of the inline thumbnail.
thumb_hintHeight of the inline thumbnail.
durationintLength in seconds.
mime_typestringIANA media type (e.g. image/jpeg, video/mp4).
wintWidth in pixels.
hintHeight in pixels.
sizeintTotal ciphertext size in bytes.
keybytesAES-256 key for the encrypted payload.
ivbytesAES initialization vector for the encrypted payload.
captionstringOptional caption shown under the media.
decryptedMessageMediaDocument #2063502050 · layer 45
NameTypeNotes
thumbbytesInline JPEG thumbnail (always sent in clear, downscaled for preview).
thumb_wintWidth of the inline thumbnail.
thumb_hintHeight of the inline thumbnail.
mime_typestringIANA media type (e.g. image/jpeg, video/mp4).
sizeintTotal ciphertext size in bytes.
keybytesAES-256 key for the encrypted payload.
ivbytesAES initialization vector for the encrypted payload.
attributesVector<DocumentAttribute>Type-specific metadata (filename, animated, sticker info, …).
captionstringOptional caption shown under the media.
decryptedMessageMediaVenue #-1978796689 · layer 45
NameTypeNotes
latdouble
longdouble
titlestring
addressstring
providerstring
venue_idstring
decryptedMessageMediaWebPage #-452652584 · layer 45
NameTypeNotes
urlstring
decryptedMessageMediaDocument #1790809986 · layer 143
NameTypeNotes
thumbbytesInline JPEG thumbnail (always sent in clear, downscaled for preview).
thumb_wintWidth of the inline thumbnail.
thumb_hintHeight of the inline thumbnail.
mime_typestringIANA media type (e.g. image/jpeg, video/mp4).
sizelongTotal ciphertext size in bytes.
keybytesAES-256 key for the encrypted payload.
ivbytesAES initialization vector for the encrypted payload.
attributesVector<DocumentAttribute>Type-specific metadata (filename, animated, sticker info, …).
captionstringOptional caption shown under the media.

DocumentAttribute — 10 constructors · layer 23–66

Type-specific metadata attached to an E2E document (filename, animated, sticker, audio, video, …).

documentAttributeImageSize #1815593308 · layer 23
NameTypeNotes
wintWidth in pixels.
hintHeight in pixels.
documentAttributeAnimated #297109817 · layer 23

No parameters.

documentAttributeSticker #-83208409 · layer 23

No parameters.

documentAttributeVideo #1494273227 · layer 23
NameTypeNotes
durationintLength in seconds.
wintWidth in pixels.
hintHeight in pixels.
documentAttributeAudio #85215461 · layer 23
NameTypeNotes
durationintLength in seconds.
documentAttributeFilename #358154344 · layer 23
NameTypeNotes
file_namestringOriginal file name as the sender supplied it.
documentAttributeSticker #978674434 · layer 45
NameTypeNotes
altstring
stickersetInputStickerSet
documentAttributeAudio #-556656416 · layer 45
NameTypeNotes
durationintLength in seconds.
titlestring
performerstring
documentAttributeAudio #-1739392570 · layer 46
NameTypeNotes
flags#
durationintLength in seconds.
titleflags.0?string
performerflags.1?string
waveformflags.2?bytes
documentAttributeVideo #250621158 · layer 66
NameTypeNotes
flags#
durationintLength in seconds.
wintWidth in pixels.
hintHeight in pixels.

FileLocation — 2 constructors · layer 23–23

Pointer to an uploaded encrypted file (dc id + key + iv) needed to fetch the ciphertext.

fileLocationUnavailable #2086234950 · layer 23
NameTypeNotes
volume_idlongFile-location volume id (Telegram-internal storage routing).
local_idintFile-location local id (within the volume).
secretlongAES key half (combined with the auth key) used to decrypt the payload.
fileLocation #1406570614 · layer 23
NameTypeNotes
dc_idintData-center where the encrypted file lives.
volume_idlongFile-location volume id (Telegram-internal storage routing).
local_idintFile-location local id (within the volume).
secretlongAES key half (combined with the auth key) used to decrypt the payload.

GroupCallMessage — 1 constructor · layer 216–216

Group-call signaling message piggybacked on the E2E channel.

groupCallMessage #-1870862194 · layer 216
NameTypeNotes
random_idlongPer-message client-generated nonce used to deduplicate retransmissions.
messageTextWithEntitiesPlaintext of the message.

InputStickerSet — 2 constructors · layer 45–45

Reference to a sticker set used by an E2E sticker message.

inputStickerSetShortName #-2044933984 · layer 45
NameTypeNotes
short_namestring
inputStickerSetEmpty #-4838507 · layer 45

No parameters.

JSONObjectValue — 1 constructor · layer 216–216

Single name/value pair inside an E2E JSON object.

jsonObjectValue #-1059185703 · layer 216
NameTypeNotes
keystringAES-256 key for the encrypted payload.
valueJSONValue

JSONValue — 6 constructors · layer 216–216

Tagged union representing any JSON value (null, bool, number, string, array, object) for E2E payloads.

jsonNull #1064139624 · layer 216

No parameters.

jsonBool #-952869270 · layer 216
NameTypeNotes
valueBool
jsonNumber #736157604 · layer 216
NameTypeNotes
valuedouble
jsonString #-1222740358 · layer 216
NameTypeNotes
valuestring
jsonArray #-146520221 · layer 216
NameTypeNotes
valueVector<JSONValue>
jsonObject #-1715350371 · layer 216
NameTypeNotes
valueVector<JSONObjectValue>

MessageEntity — 16 constructors · layer 45–144

Inline formatting span (bold, italic, mention, url, etc.) inside the plaintext of a DecryptedMessage.

messageEntityUnknown #-1148011883 · layer 45
NameTypeNotes
offsetint
lengthint
messageEntityMention #-100378723 · layer 45
NameTypeNotes
offsetint
lengthint
messageEntityHashtag #1868782349 · layer 45
NameTypeNotes
offsetint
lengthint
messageEntityBotCommand #1827637959 · layer 45
NameTypeNotes
offsetint
lengthint
messageEntityUrl #1859134776 · layer 45
NameTypeNotes
offsetint
lengthint
messageEntityEmail #1692693954 · layer 45
NameTypeNotes
offsetint
lengthint
messageEntityBold #-1117713463 · layer 45
NameTypeNotes
offsetint
lengthint
messageEntityItalic #-2106619040 · layer 45
NameTypeNotes
offsetint
lengthint
messageEntityCode #681706865 · layer 45
NameTypeNotes
offsetint
lengthint
messageEntityPre #1938967520 · layer 45
NameTypeNotes
offsetint
lengthint
languagestring
messageEntityTextUrl #1990644519 · layer 45
NameTypeNotes
offsetint
lengthint
urlstring
messageEntityUnderline #-1672577397 · layer 101
NameTypeNotes
offsetint
lengthint
messageEntityStrike #-1090087980 · layer 101
NameTypeNotes
offsetint
lengthint
messageEntityBlockquote #34469328 · layer 101
NameTypeNotes
offsetint
lengthint
messageEntitySpoiler #852137487 · layer 144
NameTypeNotes
offsetint
lengthint
messageEntityCustomEmoji #-925956616 · layer 144
NameTypeNotes
offsetint
lengthint
document_idlong

PhotoSize — 3 constructors · layer 23–23

A single rendered size of a photo (thumb, mobile, full, etc.) inside an E2E photo media.

photoSizeEmpty #236446268 · layer 23
NameTypeNotes
typestring
photoSize #2009052699 · layer 23
NameTypeNotes
typestring
locationFileLocation
wintWidth in pixels.
hintHeight in pixels.
sizeintTotal ciphertext size in bytes.
photoCachedSize #-374917894 · layer 23
NameTypeNotes
typestring
locationFileLocation
wintWidth in pixels.
hintHeight in pixels.
bytesbytes

SendMessageAction — 12 constructors · layer 17–66

Real-time activity hint (typing, recording, choosing sticker, …) inside a secret chat.

sendMessageTypingAction #381645902 · layer 17

No parameters.

sendMessageCancelAction #-44119819 · layer 17

No parameters.

sendMessageRecordVideoAction #-1584933265 · layer 17

No parameters.

sendMessageUploadVideoAction #-1845219337 · layer 17

No parameters.

sendMessageRecordAudioAction #-718310409 · layer 17

No parameters.

sendMessageUploadAudioAction #-424899985 · layer 17

No parameters.

sendMessageUploadPhotoAction #-1727382502 · layer 17

No parameters.

sendMessageUploadDocumentAction #-1884362354 · layer 17

No parameters.

sendMessageGeoLocationAction #393186209 · layer 17

No parameters.

sendMessageChooseContactAction #1653390447 · layer 17

No parameters.

sendMessageRecordRoundAction #-1997373508 · layer 66

No parameters.

sendMessageUploadRoundAction #-1150187996 · layer 66

No parameters.

TextWithEntities — 1 constructor · layer 216–216

Plain text plus a list of formatting MessageEntity spans, used by newer E2E messages.

textWithEntities #1964978502 · layer 216
NameTypeNotes
textstring
entitiesVector<MessageEntity>Inline formatting spans (bold, italic, mention, etc.).