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
| Name | Type | Notes |
|---|
| random_id | long | Per-message client-generated nonce used to deduplicate retransmissions. |
| random_bytes | bytes | Random padding so that two identical plaintexts encrypt to different ciphertexts. |
| message | string | Plaintext of the message. |
| media | DecryptedMessageMedia | Optional attachment carried in the message. |
decryptedMessageService
#-1438109059 · layer 8
| Name | Type | Notes |
|---|
| random_id | long | Per-message client-generated nonce used to deduplicate retransmissions. |
| random_bytes | bytes | Random padding so that two identical plaintexts encrypt to different ciphertexts. |
| action | DecryptedMessageAction | |
decryptedMessage
#541931640 · layer 17
| Name | Type | Notes |
|---|
| random_id | long | Per-message client-generated nonce used to deduplicate retransmissions. |
| ttl | int | Self-destruct timer in seconds. 0 means the message is permanent. |
| message | string | Plaintext of the message. |
| media | DecryptedMessageMedia | Optional attachment carried in the message. |
decryptedMessageService
#1930838368 · layer 17
| Name | Type | Notes |
|---|
| random_id | long | Per-message client-generated nonce used to deduplicate retransmissions. |
| action | DecryptedMessageAction | |
decryptedMessage
#917541342 · layer 45
| Name | Type | Notes |
|---|
| flags | # | |
| random_id | long | Per-message client-generated nonce used to deduplicate retransmissions. |
| ttl | int | Self-destruct timer in seconds. 0 means the message is permanent. |
| message | string | Plaintext of the message. |
| media | flags.9?DecryptedMessageMedia | Optional attachment carried in the message. |
| entities | flags.7?Vector<MessageEntity> | Inline formatting spans (bold, italic, mention, etc.). |
| via_bot_name | flags.11?string | Username of the inline bot that produced this message. |
| reply_to_random_id | flags.3?long | random_id of the message this one replies to. |
decryptedMessage
#-1848883596 · layer 73
| Name | Type | Notes |
|---|
| flags | # | |
| random_id | long | Per-message client-generated nonce used to deduplicate retransmissions. |
| ttl | int | Self-destruct timer in seconds. 0 means the message is permanent. |
| message | string | Plaintext of the message. |
| media | flags.9?DecryptedMessageMedia | Optional attachment carried in the message. |
| entities | flags.7?Vector<MessageEntity> | Inline formatting spans (bold, italic, mention, etc.). |
| via_bot_name | flags.11?string | Username of the inline bot that produced this message. |
| reply_to_random_id | flags.3?long | random_id of the message this one replies to. |
| grouped_id | flags.17?long | Album 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
| Name | Type | Notes |
|---|
| ttl_seconds | int | |
decryptedMessageActionReadMessages
#206520510 · layer 8
| Name | Type | Notes |
|---|
| random_ids | Vector<long> | |
decryptedMessageActionDeleteMessages
#1700872964 · layer 8
| Name | Type | Notes |
|---|
| random_ids | Vector<long> | |
decryptedMessageActionScreenshotMessages
#-1967000459 · layer 8
| Name | Type | Notes |
|---|
| random_ids | Vector<long> | |
decryptedMessageActionFlushHistory
#1729750108 · layer 8
decryptedMessageActionResend
#1360072880 · layer 17
| Name | Type | Notes |
|---|
| start_seq_no | int | First sequence number of the rekey/handshake window. |
| end_seq_no | int | Last sequence number of the rekey/handshake window. |
decryptedMessageActionNotifyLayer
#-217806717 · layer 17
| Name | Type | Notes |
|---|
| layer | int | TL schema layer the encrypted message was generated against. |
decryptedMessageActionTyping
#-860719551 · layer 17
| Name | Type | Notes |
|---|
| action | SendMessageAction | |
decryptedMessageActionRequestKey
#-204906213 · layer 20
| Name | Type | Notes |
|---|
| exchange_id | long | Identifier of the in-progress Diffie–Hellman rekey. |
| g_a | bytes | Sender side of the Diffie–Hellman exchange (g^a). |
decryptedMessageActionAcceptKey
#1877046107 · layer 20
| Name | Type | Notes |
|---|
| exchange_id | long | Identifier of the in-progress Diffie–Hellman rekey. |
| g_b | bytes | Receiver side of the Diffie–Hellman exchange (g^b). |
| key_fingerprint | long | Fingerprint of the AES-256 key used to encrypt the file payload. |
decryptedMessageActionAbortKey
#-586814357 · layer 20
| Name | Type | Notes |
|---|
| exchange_id | long | Identifier of the in-progress Diffie–Hellman rekey. |
decryptedMessageActionCommitKey
#-332526693 · layer 20
| Name | Type | Notes |
|---|
| exchange_id | long | Identifier of the in-progress Diffie–Hellman rekey. |
| key_fingerprint | long | Fingerprint of the AES-256 key used to encrypt the file payload. |
decryptedMessageActionNoop
#-1473258141 · layer 20
DecryptedMessageLayer — 1 constructor · layer 17–17
Wrapper that stamps a DecryptedMessage with the schema layer both peers agreed on.
decryptedMessageLayer
#467867529 · layer 17
| Name | Type | Notes |
|---|
| random_bytes | bytes | Random padding so that two identical plaintexts encrypt to different ciphertexts. |
| layer | int | TL schema layer the encrypted message was generated against. |
| in_seq_no | int | Number of incoming messages (peer→self) the sender has acknowledged. |
| out_seq_no | int | Number of outgoing messages (self→peer) the sender has sent so far. |
| message | DecryptedMessage | Plaintext of the message. |
DocumentAttribute — 10 constructors · layer 23–66
Type-specific metadata attached to an E2E document (filename, animated, sticker, audio, video, …).
documentAttributeImageSize
#1815593308 · layer 23
| Name | Type | Notes |
|---|
| w | int | Width in pixels. |
| h | int | Height in pixels. |
documentAttributeAnimated
#297109817 · layer 23
documentAttributeSticker
#-83208409 · layer 23
documentAttributeVideo
#1494273227 · layer 23
| Name | Type | Notes |
|---|
| duration | int | Length in seconds. |
| w | int | Width in pixels. |
| h | int | Height in pixels. |
documentAttributeAudio
#85215461 · layer 23
| Name | Type | Notes |
|---|
| duration | int | Length in seconds. |
documentAttributeFilename
#358154344 · layer 23
| Name | Type | Notes |
|---|
| file_name | string | Original file name as the sender supplied it. |
documentAttributeSticker
#978674434 · layer 45
| Name | Type | Notes |
|---|
| alt | string | |
| stickerset | InputStickerSet | |
documentAttributeAudio
#-556656416 · layer 45
| Name | Type | Notes |
|---|
| duration | int | Length in seconds. |
| title | string | |
| performer | string | |
documentAttributeAudio
#-1739392570 · layer 46
| Name | Type | Notes |
|---|
| flags | # | |
| duration | int | Length in seconds. |
| title | flags.0?string | |
| performer | flags.1?string | |
| waveform | flags.2?bytes | |
documentAttributeVideo
#250621158 · layer 66
| Name | Type | Notes |
|---|
| flags | # | |
| duration | int | Length in seconds. |
| w | int | Width in pixels. |
| h | int | Height 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
| Name | Type | Notes |
|---|
| volume_id | long | File-location volume id (Telegram-internal storage routing). |
| local_id | int | File-location local id (within the volume). |
| secret | long | AES key half (combined with the auth key) used to decrypt the payload. |
fileLocation
#1406570614 · layer 23
| Name | Type | Notes |
|---|
| dc_id | int | Data-center where the encrypted file lives. |
| volume_id | long | File-location volume id (Telegram-internal storage routing). |
| local_id | int | File-location local id (within the volume). |
| secret | long | AES 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
| Name | Type | Notes |
|---|
| random_id | long | Per-message client-generated nonce used to deduplicate retransmissions. |
| message | TextWithEntities | Plaintext of the message. |
JSONObjectValue — 1 constructor · layer 216–216
Single name/value pair inside an E2E JSON object.
jsonObjectValue
#-1059185703 · layer 216
| Name | Type | Notes |
|---|
| key | string | AES-256 key for the encrypted payload. |
| value | JSONValue | |
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
jsonBool
#-952869270 · layer 216
jsonNumber
#736157604 · layer 216
jsonString
#-1222740358 · layer 216
jsonArray
#-146520221 · layer 216
| Name | Type | Notes |
|---|
| value | Vector<JSONValue> | |
jsonObject
#-1715350371 · layer 216
| Name | Type | Notes |
|---|
| value | Vector<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
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntityMention
#-100378723 · layer 45
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntityHashtag
#1868782349 · layer 45
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntityBotCommand
#1827637959 · layer 45
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntityUrl
#1859134776 · layer 45
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntityEmail
#1692693954 · layer 45
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntityBold
#-1117713463 · layer 45
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntityItalic
#-2106619040 · layer 45
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntityCode
#681706865 · layer 45
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntityPre
#1938967520 · layer 45
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
| language | string | |
messageEntityTextUrl
#1990644519 · layer 45
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
| url | string | |
messageEntityUnderline
#-1672577397 · layer 101
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntityStrike
#-1090087980 · layer 101
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntityBlockquote
#34469328 · layer 101
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntitySpoiler
#852137487 · layer 144
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
messageEntityCustomEmoji
#-925956616 · layer 144
| Name | Type | Notes |
|---|
| offset | int | |
| length | int | |
| document_id | long | |
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
photoSize
#2009052699 · layer 23
| Name | Type | Notes |
|---|
| type | string | |
| location | FileLocation | |
| w | int | Width in pixels. |
| h | int | Height in pixels. |
| size | int | Total ciphertext size in bytes. |
photoCachedSize
#-374917894 · layer 23
| Name | Type | Notes |
|---|
| type | string | |
| location | FileLocation | |
| w | int | Width in pixels. |
| h | int | Height in pixels. |
| bytes | bytes | |
SendMessageAction — 12 constructors · layer 17–66
Real-time activity hint (typing, recording, choosing sticker, …) inside a secret chat.
sendMessageTypingAction
#381645902 · layer 17
sendMessageCancelAction
#-44119819 · layer 17
sendMessageRecordVideoAction
#-1584933265 · layer 17
sendMessageUploadVideoAction
#-1845219337 · layer 17
sendMessageRecordAudioAction
#-718310409 · layer 17
sendMessageUploadAudioAction
#-424899985 · layer 17
sendMessageUploadPhotoAction
#-1727382502 · layer 17
sendMessageUploadDocumentAction
#-1884362354 · layer 17
sendMessageGeoLocationAction
#393186209 · layer 17
sendMessageRecordRoundAction
#-1997373508 · layer 66
sendMessageUploadRoundAction
#-1150187996 · layer 66
TextWithEntities — 1 constructor · layer 216–216
Plain text plus a list of formatting MessageEntity spans, used by newer E2E messages.
textWithEntities
#1964978502 · layer 216
| Name | Type | Notes |
|---|
| text | string | |
| entities | Vector<MessageEntity> | Inline formatting spans (bold, italic, mention, etc.). |