Available methods #

Accepting the Terms of Service #

NameDescription
help.getTermsOfServiceUpdateLook for updates of telegram's terms of service
help.acceptTermsOfServiceAccept the new terms of service

Dealing with spam and ToS violations #

NameDescription
account.reportPeerReport a peer for violation of telegram's Terms of Service
account.reportProfilePhotoReport a profile photo of a dialog
channels.reportSpamReports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup
messages.reportReport a message in a chat for violation of telegram's Terms of Service
messages.reportSpamReport a new incoming chat for spam, if the peer settings of the chat allow us to do that
messages.reportEncryptedSpamReport a secret chat for spam

Fetching configuration #

NameDescription
help.getAppConfigGet app-specific configuration, see client configuration for more info on the result.
help.getAppUpdateReturns information on update availability for the current application.
help.getConfigReturns current configuration, including data center configuration.
help.getInviteTextReturns localized text of a text message with an invitation.
help.getNearestDcReturns info on data center nearest to the user.
help.getSupportReturns the support user for the "ask a question" feature.
help.getSupportNameGet localized name of the telegram support user
help.getCountriesListGet name, ISO code, localized name and phone codes/patterns of all available countries
help.dismissSuggestionDismiss a suggestion, see here for more info ».

Login via QR code #

NameDescription
auth.exportLoginTokenGenerate a login token, for login via QR code.
The generated login token should be encoded using base64url, then shown as a tg://login?token=base64encodedtoken deep link » in the QR code.

For more info, see login via QR code.
auth.acceptLoginTokenAccept QR code login token, logging in the app that generated it.

Returns info about the new session.

For more info, see login via QR code.
auth.importLoginTokenLogin using a redirected login token, generated in case of DC mismatch during QR code login.

For more info, see login via QR code.

Miscellaneous #

NameDescription
help.saveAppLogSaves logs of application on the server.
initConnectionInitialize connection
invokeAfterMsgInvokes a query after successful completion of one of the previous queries.
invokeAfterMsgsInvokes a query after a successful completion of previous queries
invokeWithLayerInvoke the specified query using the specified API layer
invokeWithoutUpdatesInvoke a request without subscribing the used connection for updates (this is enabled by default for file queries).
invokeWithGooglePlayIntegrityOfficial clients only, invoke with Google Play Integrity token.
invokeWithApnsSecretOfficial clients only, invoke with Apple push verification.
invokeWithReCaptchaOfficial clients only: re-execute a method call that required reCAPTCHA verification via a RECAPTCHA_CHECK_%s__%s, where the first placeholder is the action, and the second one is the reCAPTCHA key ID.

Registration/Authorization #

NameDescription
auth.bindTempAuthKeyBinds a temporary authorization key temp_auth_key_id to the permanent authorization key perm_auth_key_id.

For more information, see Perfect Forward Secrecy.
auth.cancelCodeCancel the login verification code
account.sendVerifyEmailCodeSend an email verification code.
account.verifyEmailVerify an email address.
auth.resetLoginEmailReset the login email ».
auth.checkPasswordTry logging to an account protected by a 2FA password.
account.resetPasswordInitiate a 2FA password reset: can only be used if the user is already logged-in, see here for more info »
auth.checkRecoveryPasswordCheck if the 2FA recovery code sent using auth.requestPasswordRecovery is valid, before passing it to auth.recoverPassword.
auth.dropTempAuthKeysDelete all temporary authorization keys except for the ones specified
auth.exportAuthorizationReturns data for copying authorization to another data-center.
auth.importAuthorizationLogs in a user using a key transmitted from his native data-center.
auth.importBotAuthorizationLogin as a bot
account.changeAuthorizationSettingsChange settings related to a session.
account.setAuthorizationTTLSet time-to-live of current session
auth.logOutLogs out the user.
auth.recoverPasswordReset the 2FA password using the recovery code sent using auth.requestPasswordRecovery.
auth.requestPasswordRecoveryRequest recovery code of a 2FA password, only for accounts with a recovery email configured.
auth.resendCodeResend the login code via another medium, the phone code type is determined by the return value of the previous auth.sendCode/auth.resendCode: see login for more info.
auth.resetAuthorizationsTerminates all user's authorized sessions except for the current one.

After calling this method it is necessary to reregister the current device using the method account.registerDevice
auth.sendCodeSend the verification code for login
auth.reportMissingCodeOfficial apps only, reports that the SMS authentication code wasn't delivered.
auth.signInSigns in a user with a validated phone number.
auth.signUpRegisters a validated phone number in the system.
auth.requestFirebaseSmsRequest an SMS code via Firebase.
auth.importWebTokenAuthorizationLogin by importing an authorization token
account.invalidateSignInCodesInvalidate the specified login codes, see here » for more info.
auth.checkPaidAuthChecks the status of a login payment.

Working with SMS jobs #

NameDescription
smsjobs.isEligibleToJoinCheck if we can process SMS jobs (official clients only).
smsjobs.joinEnable SMS jobs (official clients only).
smsjobs.leaveDisable SMS jobs (official clients only).
smsjobs.updateSettingsUpdate SMS job settings (official clients only).
smsjobs.getStatusGet SMS jobs status (official clients only).
smsjobs.getSmsJobGet info about an SMS job (official clients only).
smsjobs.finishJobFinish an SMS job (official clients only).

Working with TSF (internal use only) #

NameDescription
help.editUserInfoInternal use
help.getUserInfoCan only be used by TSF members to obtain internal information.

Working with Telegram Gateway verification messages #

NameDescription
messages.reportMessagesDeliveryUsed for Telegram Gateway verification messages »: indicate to the server that one or more messages were received by the client, if requested by the message.report_delivery_until_date flag or the equivalent flag in push notifications.

Working with Telegram Premium #

NameDescription
help.getPremiumPromoGet Telegram Premium promotion information
payments.assignAppStoreTransactionInforms server about a purchase made through the App Store: for official applications only.
payments.assignPlayMarketTransactionInforms server about a purchase made through the Play Store: for official applications only.
payments.canPurchaseStoreChecks whether a purchase is possible. Must be called before in-store purchase, official apps only.

Working with 2FA login #

NameDescription
account.confirmPasswordEmailVerify an email to use as 2FA recovery method.
account.resendPasswordEmailResend the code to verify an email to use as 2FA recovery method.
account.cancelPasswordEmailCancel the code that was sent to verify an email to use as 2FA recovery method.
account.getPasswordObtain configuration for two-factor authorization with password
account.getPasswordSettingsGet private info associated to the password info (recovery email, telegram passport info & so on)
account.updatePasswordSettingsSet a new 2FA password
account.declinePasswordResetAbort a pending 2FA password reset, see here for more info »

Working with E2E conference calls » #

NameDescription
phone.createConferenceCallCreate and optionally join a new conference call ».
phone.deleteConferenceCallParticipantsRemove participants from a conference call ».

Exactly one of the only_left and kick flags must be set.
phone.sendConferenceCallBroadcastSubmit a verification message to conference call subchain 1, see subchains ».
phone.sendGroupCallEncryptedMessageSend an E2E-encrypted message or emoji reaction to all participants of a conference call. This method can only be used with conferences; see here » for the serialization and encryption process.
phone.inviteConferenceCallParticipantInvite a user to a conference call.
phone.declineConferenceCallInviteDecline a conference call invite.
phone.getGroupCallChainBlocksFetch blocks from a conference call subchain »; handle the returned updateGroupCallChainBlocks as specified here ».

If the number of blocks returned by any call to this method is equal to limit, this method must be re-invoked immediately after processing the returned updateGroupCallChainBlocks, with the newly committed offset (usually equal to the returned next_offset).

Working with Fragment collectibles #

NameDescription
fragment.getCollectibleInfoFetch information about a fragment collectible, see here » for more info on the full flow.

Working with GIFs » #

NameDescription
messages.getSavedGifsGet saved GIFs.
messages.saveGifAdd GIF to saved gifs list

Working with Main Mini Bot Apps » and the Mini App Store #

NameDescription
bots.getPopularAppBotsFetch popular Main Mini Apps, to be used in the apps tab of global search ».
bots.addPreviewMediaAdd a main mini app preview, see here » for more info.

Only owners of bots with a configured Main Mini App can use this method, see see here » for more info on how to check if you can invoke this method.
bots.editPreviewMediaEdit a main mini app preview, see here » for more info.

Only owners of bots with a configured Main Mini App can use this method, see see here » for more info on how to check if you can invoke this method.
bots.deletePreviewMediaDelete a main mini app preview, see here » for more info.

Only owners of bots with a configured Main Mini App can use this method, see see here » for more info on how to check if you can invoke this method.
bots.reorderPreviewMediasReorder a main mini app previews, see here » for more info.

Only owners of bots with a configured Main Mini App can use this method, see see here » for more info on how to check if you can invoke this method.
bots.getPreviewInfoBot owners only, fetch main mini app preview information, see here » for more info.

Note: technically non-owners may also invoke this method, but it will always behave exactly as bots.getPreviewMedias, returning only previews for the current language and an empty lang_codes array, regardless of the passed lang_code, so please only use bots.getPreviewMedias if you're not the owner of the bot.
bots.getPreviewMediasFetch main mini app previews, see here » for more info.
messages.requestMainWebViewOpen a Main Mini App.

Working with Mini Bot Apps » #

NameDescription
messages.requestWebViewOpen a bot mini app, sending over user information after user confirmation.

After calling this method, until the user closes the webview, messages.prolongWebView must be called every 60 seconds.
messages.prolongWebViewIndicate to the server (from the user side) that the user is still using a web app.

If the method returns a QUERY_ID_INVALID error, the webview must be closed.
messages.requestSimpleWebViewOpen a bot mini app.
messages.sendWebViewResultMessageTerminate webview interaction started with messages.requestWebView, sending the specified message to the chat on behalf of the user.
messages.sendWebViewDataUsed by the user to relay data from an opened reply keyboard bot mini app to the bot that owns it.
messages.requestAppWebViewOpen a bot mini app from a direct Mini App deep link, sending over user information after user confirmation.

After calling this method, until the user closes the webview, messages.prolongWebView must be called every 60 seconds.
messages.getBotAppObtain information about a direct link Mini App
bots.canSendMessageCheck whether the specified bot can send us messages
bots.allowSendMessageAllow the specified bot to send us messages
bots.invokeWebViewCustomMethodSend a custom request from a mini bot app, triggered by a web_app_invoke_custom_method event ».

The response should be sent using a custom_method_invoked event, see here » for more info on the flow.
bots.checkDownloadFileParamsCheck if a mini app can request the download of a specific file: called when handling web_app_request_file_download events »

Working with OAuth login #

NameDescription
messages.requestUrlAuthGet more info about a Seamless Telegram Login authorization request, for more info click here »
messages.acceptUrlAuthUse this to accept a Seamless Telegram Login authorization request, for more info click here »
account.getWebAuthorizationsGet web login widget authorizations
account.resetWebAuthorizationLog out an active web telegram login session
account.resetWebAuthorizationsReset all active web telegram login sessions
messages.declineUrlAuthDecline an incoming OAuth authorization request », notifying the server that the user refused the login request.
messages.checkUrlAuthMatchCodeValidate the match code selected by the user against the code shown on the login page, as part of the OAuth authorization flow ».

Only usable when both match_codes and match_codes_first are set in the urlAuthResultRequest returned by messages.requestUrlAuth.
If boolTrue is returned, proceed with the login flow and pass the verified code to messages.acceptUrlAuth.match_code.

Working with Public Service Announcements, MTProxy channels and suggestions » #

NameDescription
help.hidePromoDataHide MTProxy/Public Service Announcement information
help.getPromoDataReturns a set of useful suggestions and PSA/MTProxy sponsored peers, see here » for more info.
NameDescription
account.createBusinessChatLinkCreate a business chat deep link ».
account.editBusinessChatLinkEdit a created business chat deep link ».
account.deleteBusinessChatLinkDelete a business chat deep link ».
account.getBusinessChatLinksList all created business chat deep links ».
account.resolveBusinessChatLinkResolve a business chat deep link ».

Working with Telegram Business connected bots » #

NameDescription
account.updateConnectedBotConnect a business bot » to the current account, or to change the current connection settings.
account.getConnectedBotsList all currently connected business bots »
account.toggleConnectedBotPausedPause or unpause a specific chat, temporarily disconnecting it from all business bots ».
account.disablePeerConnectedBotPermanently disconnect a specific chat from all business bots » (equivalent to specifying it in recipients.exclude_users during initial configuration with account.updateConnectedBot »); to reconnect of a chat disconnected using this method the user must reconnect the entire bot by invoking account.updateConnectedBot ».
account.getBotBusinessConnectionBots may invoke this method to re-fetch the updateBotBusinessConnect constructor associated with a specific business connection_id, see here » for more info on connected business bots.
This is needed for example for freshly logged in bots that are receiving some updateBotNewBusinessMessage, etc. updates because some users have already connected to the bot before it could login.
In this case, the bot is receiving messages from the business connection, but it hasn't cached the associated updateBotBusinessConnect with info about the connection (can it reply to messages? etc.) yet, and cannot receive the old ones because they were sent when the bot wasn't logged into the session yet.
This method can be used to fetch info about a not-yet-cached business connection, and should not be invoked if the info is already cached or to fetch changes, as eventual changes will automatically be sent as new updateBotBusinessConnect updates to the bot using the usual update delivery methods ».
invokeWithBusinessConnectionInvoke a method using a Telegram Business Bot connection, see here » for more info, including a list of the methods that can be wrapped in this constructor.

Make sure to always send queries wrapped in a invokeWithBusinessConnection to the datacenter ID, specified in the dc_id field of the botBusinessConnection that is being used.

Working with Telegram Business greeting and away messages #

NameDescription
account.updateBusinessGreetingMessageSet a list of Telegram Business greeting messages.
account.updateBusinessAwayMessageSet a list of Telegram Business away messages.

Working with Telegram Business opening hours » #

NameDescription
account.updateBusinessWorkHoursSpecify a set of Telegram Business opening hours.
This info will be contained in userFull.business_work_hours.

To remove all opening hours, invoke the method without setting the business_work_hours field.

Note that the opening hours specified by the user must be appropriately validated and transformed before invoking the method, as specified here ».

Working with Telegram Business quick reply shortcuts » #

NameDescription
messages.getQuickRepliesFetch basic info about all existing quick reply shortcuts.
messages.reorderQuickRepliesReorder quick reply shortcuts.

This will emit an updateQuickReplies update to other logged-in sessions.
messages.checkQuickReplyShortcutBefore offering the user the choice to add a message to a quick reply shortcut, to make sure that none of the limits specified here » were reached.
messages.editQuickReplyShortcutRename a quick reply shortcut.
This will emit an updateQuickReplies update to other logged-in sessions.
messages.deleteQuickReplyShortcutCompletely delete a quick reply shortcut.
This will also emit an updateDeleteQuickReply update to other logged-in sessions (and no updateDeleteQuickReplyMessages updates, even if all the messages in the shortcuts are also deleted by this method).
messages.getQuickReplyMessagesFetch (a subset or all) messages in a quick reply shortcut ».
messages.sendQuickReplyMessagesSend a quick reply shortcut ».
messages.deleteQuickReplyMessagesDelete one or more messages from a quick reply shortcut. This will also emit an updateDeleteQuickReplyMessages update.

Working with Telegram Gifts and collectible gifts #

NameDescription
payments.getStarGiftsGet a list of available gifts, see here » for more info.
payments.saveStarGiftDisplay or remove a received or hosted gift » from our profile.
payments.convertStarGiftConvert a received gift » into Telegram Stars: this will permanently destroy the gift, converting it into starGift.convert_stars Telegram Stars, added to the user's balance.

Note that starGift.convert_stars will be less than the buying price (starGift.stars) of the gift if it was originally bought using Telegram Stars bought a long time ago.
payments.getStarGiftUpgradePreviewObtain a preview of the possible attributes (chosen randomly) a gift » can receive after upgrading it to a collectible gift », see here » for more info.
payments.upgradeStarGiftUpgrade a gift to a collectible gift: can only be used if the upgrade was already paid by the gift sender; see here » for more info on the full flow (including the different flow to use in case the upgrade was not paid by the gift sender).
payments.transferStarGiftTransfer a collectible gift to another user or channel: can only be used if transfer is free (i.e. messageActionStarGiftUnique.transfer_stars is not set); see here » for more info on the full flow (including the different flow to use in case the transfer isn't free).
payments.getUniqueStarGiftObtain info about a collectible gift » using a slug obtained from a collectible gift link ».
payments.getSavedStarGiftsFetch the full list of gifts » owned, received or hosted » by a peer.

Note that unlike what the name suggests, the method can be used to fetch both "saved" and "unsaved" gifts (aka gifts both pinned and not pinned) to the profile, depending on the passed flags.
payments.getSavedStarGiftFetch info about specific gifts owned by a peer we control.

Note that unlike what the name suggests, the method can be used to fetch both "saved" and "unsaved" gifts (aka gifts both pinned and not pinned to the profile).
payments.getStarGiftWithdrawalUrlConvert a collectible gift » to an NFT on the TON blockchain.
payments.toggleChatStarGiftNotificationsEnables or disables the reception of notifications every time a gift » is received by the specified channel, can only be invoked by admins with post_messages admin rights.
payments.toggleStarGiftsPinnedToTopPins a received gift on top of the profile of the user or owned channels by using payments.toggleStarGiftsPinnedToTop.
payments.getResaleStarGiftsGet collectible gifts of a specific type currently on resale, see here » for more info.

sort_by_price and sort_by_num are mutually exclusive, if neither are set results are sorted by the unixtime (descending) when their resell price was last changed.

See here » for detailed documentation on this method.
payments.updateStarGiftPriceA collectible gift we own » can be put up for sale on the gift marketplace » with this method, see here » for more info.
payments.getUniqueStarGiftValueInfoGet information about the value of a collectible gift ».
payments.checkCanSendGiftCheck if the specified gift » can be sent.
payments.resolveStarGiftOfferAccept or decline a previously received collectible gift purchase offer », see here » for the full flow.
payments.sendStarGiftOfferSend an offer to purchase a collectible gift », see here » for the full flow.
payments.getStarGiftUpgradeAttributesObtains the full list of just the collectible attributes that may appear for a gift type once it's upgraded to a collectible gift ».

The result may also include starGiftAttributeModel constructors with the crafted flag set: these models are reserved for crafting » and should be filtered out from regular upgrade previews (and vice versa).
payments.getCraftStarGiftsObtain owned collectible gifts » of a specific type that can be used for crafting ».
payments.craftStarGiftCraft a new collectible gift » by combining 1 to 4 owned collectible gifts of the same base gift type.

The passed gifts must all have the same starGiftUnique.gift_id, must be usable for crafting, and must not be blocked by a future can_craft_at timestamp.

The first passed gift must not be located on the TON blockchain.

Working with Telegram Star subscriptions » #

NameDescription
payments.getStarsSubscriptionsObtain a list of active, expired or cancelled Telegram Star subscriptions ».
payments.changeStarsSubscriptionActivate or deactivate a Telegram Star subscription ».
payments.fulfillStarsSubscriptionRe-join a private channel associated to an active Telegram Star subscription ».
payments.botCancelStarsSubscriptionCancel a bot subscription

Working with Telegram Stars #

NameDescription
payments.getStarsTopupOptionsObtain a list of Telegram Stars topup options » as starsTopupOption constructors.
payments.getStarsStatusGet the current Telegram Stars balance of the current account (with peer=inputPeerSelf), or the stars balance of the bot or channel specified in peer.
payments.getStarsTransactionsFetch Telegram Stars transactions.

The inbound and outbound flags are mutually exclusive: if none of the two are set, both incoming and outgoing transactions are fetched.
payments.sendStarsFormMake a payment using Telegram Stars, see here » for more info.
payments.refundStarsChargeRefund a Telegram Stars transaction, see here » for more info.
payments.getStarsRevenueStatsGet Telegram Star revenue statistics ».
payments.getStarsRevenueWithdrawalUrlWithdraw funds from a channel or bot's star balance ».
payments.getStarsRevenueAdsAccountUrlReturns a URL for a Telegram Ad platform account that can be used to set up advertisements for channel/bot in peer, paid using the Telegram Stars owned by the specified peer, see here » for more info.
payments.getStarsTransactionsByIDObtain info about Telegram Star transactions » using specific transaction IDs.
payments.getStarsGiftOptionsObtain a list of Telegram Stars gift options » as starsGiftOption constructors.

Working with VoIP calls #

NameDescription
phone.acceptCallAccept incoming call, see here » for more info on the full flow.
phone.confirmCallComplete phone call E2E encryption key exchange », see here » for more info on the full flow.
phone.discardCallRefuse or end running call, see here » for more info on the full flow.
phone.getCallConfigDEPRECATED: Get phone call configuration to be passed to the libtgvoip (deprecated) shared config.
phone.receivedCallOptional: notify the server that the user is currently busy in a call: this will automatically refuse all incoming phone calls until the current phone call is ended, see here » for more info on the full flow.
phone.requestCallStart a telegram phone call, see here » for more info on the full flow.
phone.saveCallDebugSend phone call debug data to server.
phone.sendSignalingDataSend VoIP signaling data for an ongoing phone call.
phone.setCallRatingRate a call, returns info about the rating message sent to the official VoIP bot, see here » for more info on the full flow.
phone.saveCallLogDeprecated: send libtgvoip phone call debug information
messages.deletePhoneCallHistoryDelete the entire phone call history.

Working with accent colors » #

NameDescription
help.getPeerColorsGet the set of accent color palettes » that can be used for message accents.
help.getPeerProfileColorsGet the set of accent color palettes » that can be used in profile page backgrounds.
account.updateColorUpdate the accent color and background custom emoji » of the current account.
channels.updateColorUpdate the accent color and background custom emoji » of a channel.
account.getDefaultBackgroundEmojisGet a set of suggested custom emoji stickers that can be used in an accent color pattern.

Working with affiliate programs #

NameDescription
payments.getConnectedStarRefBotsFetch all affiliations we have created for a certain peer
payments.getConnectedStarRefBotFetch info about a specific bot affiliation »
payments.getSuggestedStarRefBotsObtain a list of suggested mini apps with available affiliate programs

order_by_revenue and order_by_date are mutually exclusive: if neither is set, results are sorted by profitability.
payments.connectStarRefBotJoin a bot's affiliate program, becoming an affiliate »
payments.editConnectedStarRefBotLeave a bot's affiliate program »
bots.updateStarRefProgramCreate, edit or delete the affiliate program of a bot we own

Working with animated dice » #

NameDescription
messages.getEmojiGameInfoFetch dice game information.

Working with boosts » #

NameDescription
premium.getBoostsListObtains info about the boosts that were applied to a certain channel or supergroup (admins only)
premium.getMyBoostsObtain which peers are we currently boosting, and how many boost slots we have left.
premium.applyBoostApply one or more boosts » to a peer.
premium.getBoostsStatusGets the current number of boosts of a channel/supergroup.
premium.getUserBoostsReturns the lists of boost that were applied to a channel/supergroup by a specific user (admins only)
channels.setBoostsToUnblockRestrictionsAdmins with ban_users admin rights » may allow users that apply a certain number of booosts » to the group to bypass slow mode » and other » supergroup restrictions, see here » for more info.

Working with bot verification icons #

NameDescription
bots.setCustomVerificationVerify a user or chat on behalf of an organization ».
bots.getBotRecommendationsObtain a list of similarly themed bots, selected based on similarities in their subscriber bases, see here » for more info.

Working with channel recommendations » #

NameDescription
channels.getChannelRecommendationsObtain a list of similarly themed public channels, selected based on similarities in their subscriber bases.

Working with channels/supergroups/geogroups #

NameDescription
channels.createChannelCreate a supergroup/channel.
channels.getInactiveChannelsGet inactive channels and supergroups
channels.deleteChannelDelete a channel/supergroup
channels.deleteHistoryDelete the history of a supergroup
channels.deleteMessagesDelete messages in a channel/supergroup
channels.deleteParticipantHistoryDelete all messages sent by a specific participant of a given supergroup
channels.editAdminModify the admin rights of a user in a supergroup/channel.
channels.editBannedBan/unban/kick a user in a supergroup/channel.
channels.editLocationEdit location of geogroup, see here » for more info on geogroups.
channels.editPhotoChange the photo of a channel/supergroup
channels.editTitleEdit the name of a channel/supergroup
channels.exportMessageLinkGet link and embed info of a message in a channel/supergroup
channels.getAdminLogGet the admin log of a channel/supergroup
channels.getAdminedPublicChannelsGet channels/supergroups/geogroups we're admin in. Usually called when the user exceeds the limit for owned public channels/supergroups/geogroups, and the user is given the choice to remove one of his channels/supergroups/geogroups.
channels.getChannelsGet info about channels/supergroups
channels.getFullChannelGet full info about a supergroup, gigagroup or channel
channels.getGroupsForDiscussionGet all groups that can be used as discussion groups.

Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group.
To set a returned supergroup as a discussion group, access to its old messages must be enabled using channels.togglePreHistoryHidden, first.
channels.getMessagesGet channel/supergroup messages
channels.getParticipantGet info about a channel/supergroup participant
channels.getParticipantsGet the participants of a supergroup/channel
channels.inviteToChannelInvite users to a channel/supergroup
channels.joinChannelJoin a channel/supergroup
channels.leaveChannelLeave a channel/supergroup
channels.readHistoryMark channel/supergroup history as read
channels.readMessageContentsMark channel/supergroup message contents as read, emitting an updateChannelReadMessagesContents.
channels.setDiscussionGroupAssociate a group to a channel as discussion group for that channel
channels.setStickersAssociate a stickerset to the supergroup
channels.togglePreHistoryHiddenHide/unhide message history for new channel/supergroup users
channels.toggleSignaturesEnable/disable message signatures in channels
channels.toggleSlowModeToggle supergroup slow mode: if enabled, users will only be able to send one message every seconds seconds
channels.toggleParticipantsHiddenHide or display the participants list in a supergroup.

The supergroup must have at least hidden_members_group_size_min participants in order to use this method, as specified by the client configuration parameters ».

Working with chat invites and join requests #

NameDescription
messages.exportChatInviteExport an invite link for a chat
messages.getExportedChatInviteGet info about a chat invite
messages.getExportedChatInvitesGet info about the chat invites of a specific chat
messages.editExportedChatInviteEdit an exported chat invite
messages.deleteRevokedExportedChatInvitesDelete all revoked chat invites
messages.deleteExportedChatInviteDelete a chat invite
messages.getAdminsWithInvitesGet info about chat invites generated by admins.
messages.getChatInviteImportersGet info about the users that joined the chat using a specific chat invite
messages.checkChatInviteCheck the validity of a chat invite link and get basic info about it
messages.importChatInviteImport a chat invite and join a private chat/supergroup/channel
messages.hideChatJoinRequestDismiss or approve a chat join request related to a specific chat or channel.
messages.hideAllChatJoinRequestsDismiss or approve all join requests related to a specific chat or channel.
channels.toggleJoinToSendSet whether all users should join a discussion group in order to comment on a post »
channels.toggleJoinRequestSet whether all users should request admin approval to join the group ».

Working with chats/supergroups/channels #

NameDescription
messages.getMessageReadParticipantsGet which users read a specific message: only available for groups and supergroups with less than chat_read_mark_size_threshold members, read receipts will be stored for chat_read_mark_expire_period seconds after the message was sent, see client configuration for more info ».
messages.addChatUserAdds a user to a chat and sends a service message on it.
messages.createChatCreates a new chat.
messages.deleteChatUserDeletes a user from a chat and sends a service message on it.
messages.editChatAboutEdit the description of a group/supergroup/channel.
messages.editChatAdminMake a user admin in a basic group.
messages.editChatDefaultBannedRightsEdit the default banned rights of a channel/supergroup/group.
messages.editChatPhotoChanges chat photo and sends a service message on it
messages.editChatTitleChanges chat name and sends a service message on it.
messages.getChatsReturns chat basic info on their IDs.
messages.deleteChatDelete a chat
messages.getCommonChatsGet chats in common with a user
messages.getFullChatGet full info about a basic group.
messages.migrateChatTurn a basic group into a supergroup
channels.convertToGigagroupConvert a supergroup to a gigagroup, when requested by channel suggestions.
channels.setEmojiStickersSet a custom emoji stickerset for supergroups. Only usable after reaching at least the boost level » specified in the group_emoji_stickers_level_min » config parameter.
messages.editChatCreatorTransfer the ownership of a basic group, supergroup or channel to another user, see here » for the full flow.
messages.getFutureChatCreatorAfterLeaveGroup/channel owners only: returns the ID of the user that will become the new owner of the group if we decide to leave the group, see here » for more info on the full flow.

Working with cloud themes #

NameDescription
account.updateThemeUpdate theme
account.uploadThemeUpload theme
account.getThemesGet installed themes
account.createThemeCreate a theme
account.installThemeInstall a theme
account.saveThemeSave a theme
account.getThemeGet theme information
account.getChatThemesGet all available chat themes ».
account.getUniqueGiftChatThemesObtain all chat themes » associated to owned or hosted collectible gifts ».
messages.setChatThemeChange the chat theme of a certain chat, see here » for more info.

Working with collectible gift auctions » #

NameDescription
payments.getStarGiftAuctionStateReturns info about a collectible gift auction »; also subscribes the user to auction updates, see here » for more info on the full flow.
payments.getStarGiftAuctionAcquiredGiftsFetches all the gifts that the current user won in an auction.
payments.getStarGiftActiveAuctionsFetches all currently active gift auctions the user has ever bid on (including auctions where the user was outbid and their bid was returned), as long as the auction hasn't ended yet.

This method is primarily used to display an auction badge in the chat list immediately on app startup, without waiting for real-time updateStarGiftAuctionState updates to arrive: the client calls it to discover which auctions the user is participating in and show the badge proactively.

To instead fetch the full state of a single auction, subscribe to its real-time updates and render the detailed auction UI (typically when the user opens a specific auction), use payments.getStarGiftAuctionState.

Working with content protection » #

NameDescription
messages.toggleNoForwardsEnable or disable content protection on a channel, group or private chat.

Working with custom animated emojis #

NameDescription
messages.getCustomEmojiDocumentsFetch custom emoji stickers ».

Returns a list of documents with the animated custom emoji in TGS format, and a documentAttributeCustomEmoji attribute with the original emoji and info about the emoji stickerset this custom emoji belongs to.
messages.getEmojiStickersGets the list of currently installed custom emoji stickersets.
messages.getFeaturedEmojiStickersGets featured custom emoji stickersets.
messages.searchCustomEmojiLook for custom emojis associated to a UTF8 emoji
account.getDefaultProfilePhotoEmojisGet a set of suggested custom emoji stickers that can be used as profile picture
account.getDefaultGroupPhotoEmojisGet a set of suggested custom emoji stickers that can be used as group picture
NameDescription
messages.startBotStart a conversation with a bot using a deep linking parameter
help.getDeepLinkInfoGet info about an unsupported deep link, see here for more info ».
help.getRecentMeUrlsGet recently used t.me links.

When installing official applications from "Download Telegram" buttons present in t.me pages, a referral parameter is passed to applications after installation.
If, after downloading the application, the user creates a new account (instead of logging into an existing one), the referral parameter should be imported using this method, which returns the t.me pages the user recently opened, before installing Telegram.

Working with drafts #

NameDescription
messages.clearAllDraftsClear all drafts.
messages.getAllDraftsReturn all message drafts.
Returns all the latest updateDraftMessage updates related to all chats with drafts.
messages.saveDraftSave a message draft associated to a chat.

Working with emoji categories #

NameDescription
messages.getEmojiStickerGroupsRepresents a list of emoji categories, to be used when choosing a sticker.
messages.getEmojiGroupsRepresents a list of emoji categories.
messages.getEmojiStatusGroupsRepresents a list of emoji categories, to be used when selecting custom emojis to set as custom emoji status.
messages.getEmojiProfilePhotoGroupsRepresents a list of emoji categories, to be used when selecting custom emojis to set as profile picture.

Working with emoji keywords #

NameDescription
messages.getEmojiKeywordsGet localized emoji keywords ».
messages.getEmojiKeywordsDifferenceGet changed emoji keywords ».
messages.getEmojiKeywordsLanguagesObtain a list of related languages that must be used when fetching emoji keyword lists ».

Usually the method will return the passed language codes (if localized) + en + some language codes for similar languages (if applicable).
messages.getEmojiURLReturns an HTTP URL which can be used to automatically log in into translation platform and suggest new emoji keywords ». The URL will be valid for 30 seconds after generation.

Working with emoji statuses #

NameDescription
account.updateEmojiStatusSet an emoji status
channels.updateEmojiStatusSet an emoji status for a channel or supergroup.
account.getDefaultEmojiStatusesGet a list of default suggested emoji statuses
account.getCollectibleEmojiStatusesObtain a list of emoji statuses » for owned or hosted collectible gifts ».
account.getChannelDefaultEmojiStatusesGet a list of default suggested channel emoji statuses.
account.getChannelRestrictedStatusEmojisReturns fetch the full list of custom emoji IDs » that cannot be used in channel emoji statuses ».
account.getRecentEmojiStatusesGet recently used emoji statuses
account.clearRecentEmojiStatusesClears list of recently used emoji statuses
bots.updateUserEmojiStatusChange the emoji status of a user (invoked by bots, see here » for more info on the full flow)
bots.toggleUserEmojiStatusPermissionAllow or prevent a bot from changing our emoji status »

Working with fact-checks #

NameDescription
messages.editFactCheckEdit/create a fact-check on a message.

Can only be used by independent fact-checkers as specified by the appConfig.can_edit_factcheck configuration flag.
messages.deleteFactCheckDelete a fact-check from a message.

Can only be used by independent fact-checkers as specified by the appConfig.can_edit_factcheck configuration flag.
messages.getFactCheckFetch one or more factchecks, see here » for the full flow.

Working with files #

NameDescription
help.getCdnConfigGet configuration for CDN file downloads.
upload.getCdnFileDownload a CDN file.
upload.getCdnFileHashesGet SHA256 hashes for verifying downloaded CDN files
upload.reuploadCdnFileRequest a reupload of a certain file to a CDN DC.
upload.getFileReturns content of a whole file or its part.
upload.getFileHashesGet SHA256 hashes for verifying downloaded files
upload.getWebFileReturns content of a web file, by proxying the request through telegram, see the webfile docs for more info.

Note: the query must be sent to the DC specified in the webfile_dc_id MTProto configuration field.
upload.saveBigFilePartSaves a part of a large file (over 10 MB in size) to be later passed to one of the methods.
upload.saveFilePartSaves a part of file for further sending to one of the methods.
messages.uploadEncryptedFileUpload encrypted file and associate it to a secret chat (without actually sending it to the chat).
messages.uploadMediaUpload a file and associate it to a chat (without actually sending it to the chat)

May also be used in a business connection, not by wrapping the query in invokeWithBusinessConnection », but rather by specifying the business connection ID in the business_connection_id parameter.
messages.getDocumentByHashGet a document by its SHA256 hash, mainly used for gifs

Working with folder tags #

NameDescription
messages.toggleDialogFilterTagsEnable or disable folder tags ».

Working with folders #

NameDescription
messages.updateDialogFiltersOrderReorder folders
messages.getDialogFiltersGet folders
messages.getSuggestedDialogFiltersGet suggested folders
messages.updateDialogFilterUpdate folder
folders.editPeerFoldersEdit peers in peer folder
chatlists.exportChatlistInviteExport a folder », creating a chat folder deep link ».
chatlists.deleteExportedInviteDelete a previously created chat folder deep link ».
chatlists.editExportedInviteEdit a chat folder deep link ».
chatlists.getExportedInvitesList all chat folder deep links » associated to a folder
chatlists.checkChatlistInviteObtain information about a chat folder deep link ».
chatlists.joinChatlistInviteImport a chat folder deep link », joining some or all the chats in the folder.
chatlists.getChatlistUpdatesFetch new chats associated with an imported chat folder deep link ». Must be invoked at most every chatlist_update_period seconds (as per the related client configuration parameter »).
chatlists.joinChatlistUpdatesJoin channels and supergroups recently added to a chat folder deep link ».
chatlists.hideChatlistUpdatesDismiss new pending peers recently added to a chat folder deep link ».
chatlists.getLeaveChatlistSuggestionsReturns identifiers of pinned or always included chats from a chat folder imported using a chat folder deep link », which are suggested to be left when the chat folder is deleted.
chatlists.leaveChatlistDelete a folder imported using a chat folder deep link »

Working with forums #

NameDescription
channels.toggleForumEnable or disable forum functionality in a supergroup.
channels.toggleViewForumAsMessagesUsers may also choose to display messages from all topics of a forum as if they were sent to a normal group, using a "View as messages" setting in the local client: this setting only affects the current account, and is synced to other logged in sessions using this method.

Invoking this method will update the value of the view_forum_as_messages flag of channelFull or dialog and emit an updateChannelViewForumAsMessages.
messages.getForumTopicsGet topics of a forum
messages.getForumTopicsByIDGet forum topics by their ID
messages.editForumTopicEdit forum topic.
messages.updatePinnedForumTopicPin or unpin forum topics
messages.reorderPinnedForumTopicsReorder pinned forum topics
messages.createForumTopicCreate a forum topic.
messages.deleteTopicHistoryDelete message history of a forum topic

Working with fragment.com usernames #

NameDescription
account.reorderUsernamesReorder usernames associated with the currently logged-in user.
account.toggleUsernameActivate or deactivate a purchased fragment.com username associated to the currently logged-in user.
bots.reorderUsernamesReorder usernames associated to a bot we own.
bots.toggleUsernameActivate or deactivate a purchased fragment.com username associated to a bot we own.
channels.reorderUsernamesReorder active usernames
channels.toggleUsernameActivate or deactivate a purchased fragment.com username associated to a supergroup or channel we own.
channels.deactivateAllUsernamesDisable all purchased usernames of a supergroup or channel

Working with games #

NameDescription
messages.getGameHighScoresGet highscores of a game
messages.getInlineGameHighScoresGet highscores of a game sent using an inline bot
messages.setGameScoreUse this method to set the score of the specified user in a game sent as a normal message (bots only).
messages.setInlineGameScoreUse this method to set the score of the specified user in a game sent as an inline message (bots only).

Working with gift codes #

NameDescription
payments.checkGiftCodeObtain information about a Telegram Premium giftcode »
payments.applyGiftCodeApply a Telegram Premium giftcode »

Working with gift collections #

NameDescription
payments.createStarGiftCollectionCreate a star gift collection ».
payments.updateStarGiftCollectionAdd or remove gifts from a star gift collection », or rename the collection.
payments.reorderStarGiftCollectionsReorder the star gift collections » on an owned peer's profile.
payments.deleteStarGiftCollectionDelete a star gift collection ».
payments.getStarGiftCollectionsFetches all star gift collections » of a peer.

Working with giveaways & gifts #

NameDescription
payments.getPremiumGiftCodeOptionsObtain a list of Telegram Premium giveaway/gift code » options.
payments.getGiveawayInfoObtain information about a Telegram Premium giveaway ».
payments.launchPrepaidGiveawayLaunch a prepaid giveaway ».
payments.getStarsGiveawayOptionsFetch a list of star giveaway options ».

Working with group calls » #

NameDescription
phone.exportGroupCallInviteGet an invite link for a public video chat/livestream ».

Non-admin members or subscribers may export a link with can_self_unmute omitted. Only group call admins may set can_self_unmute to export a link that allows users to speak.

Cannot be used for video chats/livestreams associated with private groups/channels, conference calls » or live stories ».
phone.getGroupCallJoinAsGet a list of peers that can be used to join a video chat or livestream », presenting yourself as a specific user/channel.

This method cannot be used for live stories or conference calls. To comment or react in a live story as another peer, use channels.getSendAs with for_live_stories set and pass one of the returned peers to phone.sendGroupCallMessage.send_as.
phone.editGroupCallParticipantEdit information about a participant of a non-RTMP video chat/livestream or conference. The raise_hand field is only supported in video chats/livestreams, see here » for more info.

Note: flags.N?Bool parameters can have three possible values:

- If the TL flag is not set, the previous value will not be changed.
- If the TL flag is set and contains a boolTrue, the previous value will be overwritten to true.
- If the TL flag is set and contains a boolFalse, the previous value will be overwritten to false.
phone.toggleGroupCallRecordStart or stop recording a video chat/livestream, see here » for more info. The recorded audio and video streams will be automatically sent to Saved Messages (the chat with ourselves).
phone.editGroupCallTitleEdit the title of a video chat or livestream. This method cannot be used with live stories or conferences, see here » for more info.
phone.getGroupParticipantsGet group call participants.
phone.checkGroupCallCheck which of the specified source IDs the server still recognizes as joined to a group call. This method can be used with all group call types, see here » for more info.

After joining the main connection with phone.joinGroupCall, pass its non-zero SSRC/source ID to this method periodically. If a presentation connection is also active, include the separate source registered using phone.joinGroupCallPresentation.

The method returns the subset of the supplied sources that are still joined. A missing source means that the corresponding connection must be recreated and joined again; it does not indicate whether media packets are currently flowing. If the method returns GROUPCALL_JOIN_MISSING, the main connection must be rejoined.
phone.createGroupCallCreate a video chat or livestream, see here » for the full flow.
phone.toggleGroupCallStartSubscriptionSubscribe or unsubscribe to a scheduled group call.
phone.leaveGroupCallLeave a group call without ending it for other participants. This method can be used with all group call types, see here » for more info.
phone.toggleGroupCallSettingsChange group call settings. Each setting supports different group call types, see here » for more info.
phone.inviteToGroupCallInvite a set of users to a video chat/livestream »; cannot be used for live stories » or conference calls ».
phone.getGroupCallGet info about a group call and its participants.
phone.joinGroupCallJoin any group call type ». Conference calls additionally require the E2E joining flow ».

The params field must contain a join payload generated by the local tgcalls group-call engine. It contains a random non-zero audio ssrc, ICE ufrag and pwd, DTLS fingerprints, and, when publishing video, ssrc-groups.

For example, a join payload without published video has the following shape:

json<br>{<br> "ssrc": 123456789,<br> "ufrag": "...",<br> "pwd": "...",<br> "fingerprints": [{<br> "hash": "sha-256",<br> "fingerprint": "...",<br> "setup": "passive"<br> }]<br>}<br>

When joining an RTMP-mode call, generate the payload without published video source groups.
phone.leaveGroupCallPresentationStop screen sharing in a non-RTMP video chat/livestream or conference. Presentations are not supported in live stories or RTMP-mode video chats/livestreams, see here » for more info.
phone.discardGroupCallTerminate a group call, ending the room for all participants. This method can be used with all group call types, see here » for more info.
phone.joinGroupCallPresentationStart screen sharing in a non-RTMP video chat/livestream or conference. Presentations are not supported in live stories or RTMP-mode video chats/livestreams, see here » for more info.
phone.startScheduledGroupCallStart a scheduled group call.
phone.saveDefaultGroupCallJoinAsSet the default peer used to join a video chat/livestream » associated with a specific dialog.
phone.getGroupCallStreamChannelsGet the available stream channels and current playback timestamp of an RTMP-mode video chat, livestream or live story, see here » for the full flow.
The group call must be joined before invoking this method. Send the request to the media DC specified by groupCall.stream_dc_id.
phone.getGroupCallStreamRtmpUrlGet the RTMP URL and stream key used by the single external streamer that publishes all audio and video for an RTMP-mode video chat, livestream or live story.

See here » for the full flow.
phone.sendGroupCallMessageSend an in-call message to all participants of a video chat/livestream or live story, including in RTMP mode, see here » for more info.

The send_as field can only be populated for live stories, where it optionally selects the displayed author. If omitted, the server automatically selects the appropriate author. Do not populate it for video chats/livestreams.

Video chats/livestreams and live stories support animated emoji reactions », encoded as messages containing only a standard available reaction emoji or a single custom emoji entity.

For a paid live story comment, pass the user-confirmed donation amount in allow_paid_stars. For commenters other than the live story owner, this amount must be at least the current groupCall.send_paid_messages_stars minimum. A higher amount may be donated to highlight the comment. The live story owner may comment without populating allow_paid_stars. To send a standalone paid live story donation, pass a positive allow_paid_stars value and an empty message, see here » for the full flow.
phone.deleteGroupCallMessagesDelete specific messages from the in-call message overlay » of a video chat/livestream or live story, including in RTMP mode.

Non-admin participants may delete messages they sent; admins may delete any message.
phone.deleteGroupCallParticipantMessagesAs an admin, delete all messages from a specific participant in the in-call message overlay » of a video chat/livestream or live story, including in RTMP mode.
phone.saveDefaultSendAsSave the default peer displayed as the author of live story comments and reactions, see in-call messages ».

It cannot be used for normal video chats/livestreams, where in-call messages are sent as the peer used to join the call (join_as).

Working with group member/admin tags » #

NameDescription
messages.editChatParticipantRankEdit a group participant's tag ».

Working with guest mode for bots » #

NameDescription
messages.setBotGuestChatResultBots may use this method to answer a guest mode » query received via an updateBotGuestChatQuery update, providing the message to post into the chat as a guest, see here » for more info.

Working with instant view pages #

NameDescription
messages.getWebPageGet instant view page
messages.getWebPagePreviewGet preview of webpage

Working with live stories » #

NameDescription
stories.startLiveStart a live story, optionally using RTMP livestream mode, see here » for the full flow.
phone.getGroupCallStarsFetch a live story's total donations and top donors, see paid live story donations ».

Working with managed bots » #

NameDescription
bots.checkUsernameCheck whether a username is available and valid for use when creating a managed bot ».
bots.createBotCreate a managed bot » owned by the current user and controlled by the specified manager bot.
bots.exportBotTokenExport the bot token of a managed bot »; can only be called by the manager bot.
bots.getAccessSettingsGet the access restriction settings » of a managed bot; can only be called by the manager bot.
bots.editAccessSettingsEdit the access restriction settings » of a managed bot; can only be called by the manager bot.

Working with message effects #

NameDescription
messages.getAvailableEffectsFetch the full list of usable animated message effects ».

Working with message reactions #

NameDescription
messages.setDefaultReactionChange default emoji reaction to use in the quick reaction menu: the value is synced across devices and can be fetched using help.getConfig, reactions_default field.
messages.getMessagesReactionsGet message reactions »
messages.sendReactionReact to message.

Starting from layer 159, the reaction will be sent from the peer specified using messages.saveDefaultSendAs.
messages.getAvailableReactionsObtain available message reactions »
messages.getUnreadReactionsGet unread reactions to messages you sent
messages.readReactionsMark message reactions » as read
messages.setChatAvailableReactionsChange the set of message reactions » that can be used in a certain group, supergroup or channel
messages.getMessageReactionsListGet message reaction list, along with the sender of each reaction.
messages.reportReactionReport a message reaction
messages.getTopReactionsGot popular message reactions
messages.getRecentReactionsGet recently used message reactions
messages.clearRecentReactionsClear recently used message reactions
messages.sendPaidReactionSends one or more paid Telegram Star reactions », transferring Telegram Stars » to a channel's balance.
messages.togglePaidReactionPrivacyChanges the privacy of already sent paid reactions on a specific message.
messages.getPaidReactionPrivacyFetches an updatePaidReactionPrivacy update with the current default paid reaction privacy, see here » for more info.
messages.deleteParticipantReactionsAs an admin, remove all of a specific participant's reactions from every message in a group or channel.
messages.deleteParticipantReactionAs an admin, remove all of a specific participant's reactions from a single message.

Working with message translation #

NameDescription
messages.translateTextTranslate a given text.

Styled text entities will only be preserved for Telegram Premium users.
messages.togglePeerTranslationsShow or hide the real-time chat translation popup for a certain chat
channels.toggleAutotranslationToggle autotranslation in a channel, for all users: see here » for more info.

Working with message views and read metrics » #

NameDescription
messages.reportReadMetricsReport viewport read metrics for visible messages, indicating how long each message stayed in the chat viewport, see here » for more info on the full flow.
messages.reportMusicListenReport the listening duration of a music track (audio document without the voice flag), see here » for more info on the full flow.

Working with paid media #

NameDescription
messages.getExtendedMediaFetch updated information about paid media, see here » for the full flow.

This method will return an array of updateMessageExtendedMedia updates, only for messages containing already bought paid media.
No information will be returned for messages containing not yet bought paid media.

Working with paid messages #

NameDescription
account.getPaidMessagesRevenueGet the number of stars we have received from the specified user thanks to paid messages »; the received amount will be equal to the sent amount multiplied by stars_paid_message_commission_permille divided by 1000.
account.toggleNoPaidMessagesExceptionAllow a user to send us messages without paying if paid messages » are enabled.
channels.updatePaidMessagesPriceEnable or disable paid messages » in this supergroup or monoforum.

Also used to enable or disable monoforums aka direct messages in a channel.

Note that passing the ID of the monoforum itself to channel will return a CHANNEL_MONOFORUM_UNSUPPORTED error: pass the ID of the associated channel to edit the settings of the associated monoforum, instead.

Working with passkeys » #

NameDescription
auth.initPasskeyLoginInitialize login with a passkey over an unauthenticated connection, see here » for more info.
auth.finishPasskeyLoginComplete login with a passkey over an unauthenticated connection, see here » for more info.

Must be sent to the user's native DC, as specified by the user_handle (dcId:userId) returned in the passkey assertion, see here » for the full flow.
account.initPasskeyRegistrationInitialize passkey registration for the current account, see here » for more info on the full flow.
account.registerPasskeyComplete passkey registration for the current account, see here » for more info on the full flow.
account.getPasskeysList the passkeys associated to the current account that can be used to log in, see here » for more info on passkeys.
account.deletePasskeyDelete a passkey associated to the current account, see here » for more info.

Working with prepared inline messages #

NameDescription
messages.savePreparedInlineMessageSave a prepared inline message, to be shared by the user of the mini app using a web_app_send_prepared_message event
messages.getPreparedInlineMessageObtain a prepared inline message generated by a mini app: invoked when handling web_app_send_prepared_message events

Working with reaction notification settings » #

NameDescription
account.getReactionsNotifySettingsGet the current reaction notification settings ».
account.setReactionsNotifySettingsChange the reaction notification settings ».

Working with saved message dialogs » or monoforums » #

NameDescription
messages.getSavedDialogsReturns the current saved dialog list » or monoforum topic list ».
messages.getSavedHistoryFetch saved messages » forwarded from a specific peer, or fetch messages from a monoforum topic ».
messages.deleteSavedHistoryDeletes messages from a monoforum topic », or deletes messages forwarded from a specific peer to saved messages ».
messages.getPinnedSavedDialogsGet pinned saved dialogs, see here » for more info.
messages.toggleSavedDialogPinPin or unpin a saved message dialog ».
messages.reorderPinnedSavedDialogsReorder pinned saved message dialogs ».
messages.getSavedDialogsByIDObtain information about specific saved message dialogs » or monoforum topics ».
messages.readSavedHistoryMark messages as read in a monoforum topic ».
channels.getMessageAuthorCan only be invoked by non-bot admins of a monoforum », obtains the original sender of a message sent by other monoforum admins to the monoforum, on behalf of the channel associated to the monoforum.

Working with saved message tags » #

NameDescription
messages.getSavedReactionTagsFetch the full list of saved message tags created by the user.
messages.updateSavedReactionTagUpdate the description of a saved message tag ».
messages.getDefaultTagReactionsFetch a default recommended list of saved message tag reactions.

Working with secret chats #

NameDescription
messages.setEncryptedTypingSend typing event by the current user to a secret chat.
messages.readEncryptedHistoryMarks message history within a secret chat as read.
messages.acceptEncryptionConfirms creation of a secret chat
messages.discardEncryptionCancels a request for creation and/or delete info on secret chat.
messages.requestEncryptionSends a request to start a secret chat to the user.
messages.sendEncryptedSends a text message to a secret chat.
messages.sendEncryptedFileSends a message with a file attachment to a secret chat
messages.sendEncryptedServiceSends a service message to a secret chat.
messages.getDhConfigReturns configuration parameters for Diffie-Hellman key generation. Can also return a random sequence of bytes of required length.
messages.receivedQueueConfirms receipt of messages in a secret chat by client, cancels push notifications.
The method returns a list of random_ids of messages for which push notifications were cancelled.

Working with sponsored messages and sponsored peers #

NameDescription
channels.restrictSponsoredMessagesDisable ads on the specified channel, for all users.

Available only after reaching at least the boost level » specified in the channel_restrict_sponsored_level_min » config parameter.
account.toggleSponsoredMessagesDisable or re-enable Telegram ads for the current Premium account.

Useful for business owners that may want to launch and view their own Telegram ads via the Telegram ad platform ».
messages.viewSponsoredMessageMark a specific sponsored message » as read
messages.clickSponsoredMessageInforms the server that the user has interacted with a sponsored message in one of the ways listed here ».
messages.reportSponsoredMessageReport a sponsored message », see here » for more info on the full flow.
messages.getSponsoredMessagesGet a list of sponsored messages for a peer, see here » for more info.
contacts.getSponsoredPeersObtain a list of sponsored peer search results for a given query

Working with statistics #

NameDescription
stats.loadAsyncGraphLoad channel statistics graph asynchronously
stats.getBroadcastStatsGet channel statistics
stats.getMessagePublicForwardsObtains a list of messages, indicating to which other public channels was a channel message forwarded.
Will return a list of messages with peer_id equal to the public channel to which this message was forwarded.
stats.getMegagroupStatsGet supergroup statistics
stats.getMessageStatsGet message statistics
stats.getStoryStatsGet statistics for a certain story.
stats.getStoryPublicForwardsObtain forwards of a story as a message to public chats and reposts by public channels.
stats.getPollStatsGet statistics for a poll sent in a message.

Working with stickers » #

NameDescription
messages.getOldFeaturedStickersMethod for fetching previously featured stickers
messages.toggleStickerSetsApply changes to multiple stickersets
stickers.suggestShortNameSuggests a short name for a given stickerpack name
stickers.replaceStickerReplace a sticker in a stickerset ».
stickers.checkShortNameCheck whether the given short name is available
stickers.setStickerSetThumbSet stickerset thumbnail
stickers.addStickerToSetAdd a sticker to a stickerset. The sticker set must have been created by the current user/bot.
stickers.changeStickerPositionChanges the absolute position of a sticker in the set to which it belongs. The sticker set must have been created by the current user/bot.
stickers.createStickerSetCreate a stickerset.
stickers.changeStickerUpdate the keywords, emojis or mask coordinates of a sticker.
stickers.renameStickerSetRenames a stickerset.
stickers.deleteStickerSetDeletes a stickerset we created.
messages.getMyStickersFetch all stickersets » owned by the current user.
stickers.removeStickerFromSetRemove a sticker from the set where it belongs. The sticker set must have been created by the current user/bot.
messages.clearRecentStickersClear recent stickers
messages.faveStickerMark or unmark a sticker as favorite
messages.getAllStickersGet all installed stickers
messages.getArchivedStickersGet all archived stickers
messages.getAttachedStickersGet stickers attached to a photo or video
messages.getFavedStickersGet faved stickers
messages.getFeaturedStickersGet featured stickers
messages.getMaskStickersGet installed mask stickers
messages.getRecentStickersGet recent stickers
messages.getStickerSetGet info about a stickerset
messages.getStickersGet stickers by emoji
messages.saveRecentStickerAdd/remove sticker from recent stickers list
messages.installStickerSetInstall a stickerset
messages.readFeaturedStickersMark new featured stickers as read
messages.reorderStickerSetsReorder installed stickersets
messages.searchStickerSetsSearch for stickersets
messages.searchStickersSearch for stickers using AI-powered keyword search
messages.searchEmojiStickerSetsSearch for custom emoji stickersets »
messages.uninstallStickerSetUninstall a stickerset

Working with stories #

NameDescription
stories.searchPostsGlobally search for stories using a hashtag or a location media area, see here » for more info on the full flow.

Either hashtag or area must be set when invoking the method.
stories.canSendStoryCheck whether we can post stories as the specified peer.
stories.sendStoryUploads a Telegram Story.

May also be used in a business connection, not by wrapping the query in invokeWithBusinessConnection », but rather by specifying the ID of a controlled business user in peer.
stories.editStoryEdit an uploaded story

May also be used in a business connection, not by wrapping the query in invokeWithBusinessConnection », but rather by specifying the ID of a controlled business user in peer: in this context, the method can only be used to edit stories posted by the same business bot on behalf of the user with stories.sendStory.
stories.deleteStoriesDeletes some posted stories.
stories.togglePinnedToTopPin some stories to the top of the profile, see here » for more info.
stories.togglePinnedPin or unpin one or more stories
stories.getAllStoriesFetch the List of active (or active and hidden) stories, see here » for more info on watching stories.
stories.getPinnedStoriesFetch the stories pinned on a peer's profile.
stories.getStoriesArchiveFetch the story archive » of a peer we control.
stories.getStoriesByIDObtain full info about a set of stories by their IDs.
stories.toggleAllStoriesHiddenHide the active stories of a specific peer, preventing them from being displayed on the action bar on the homescreen.
stories.readStoriesMark all stories up to a certain ID as read, for a given peer; will emit an updateReadStories update to all logged-in sessions.
stories.incrementStoryViewsIncrement the view counter of one or more stories.
stories.getStoryViewsListObtain the list of users that have viewed a specific story we posted
stories.getStoryReactionsListGet the reaction and interaction list of a story posted to a channel, along with the sender of each reaction.

Can only be used by channel admins.
stories.getStoriesViewsObtain info about the view count, forward count, reactions and recent viewers of one or more stories.
stories.exportStoryLinkGenerate a story deep link for a specific story
stories.reportReport a story.
stories.activateStealthModeActivates stories stealth mode, see here » for more info.

Will return an updateStoriesStealthMode.
stories.getPeerStoriesFetch the full active story list of a specific peer.
stories.getAllReadPeerStoriesObtain the latest read story ID for all peers when first logging in, returned as a list of updateReadStories updates, see here » for more info.
stories.getPeerMaxIDsGet compact active story summaries » for a set of peers.
stories.getChatsToSendObtain a list of channels where the user can post stories
stories.togglePeerStoriesHiddenHide the active stories of a user, preventing them from being displayed on the action bar on the homescreen, see here » for more info.
stories.sendReactionReact to a story.
stories.createAlbumCreates a story album.
stories.updateAlbumRename a story albums », or add, delete or reorder stories in it.
stories.reorderAlbumsReorder story albums on a profile ».
stories.deleteAlbumDelete a story album.
stories.getAlbumsGet story albums created by a peer.
stories.getAlbumStoriesGet stories in a story album ».

Working with suggested posts #

NameDescription
messages.toggleSuggestedPostApprovalApprove or reject a suggested post ».

Working with telegram passport #

NameDescription
account.sendVerifyPhoneCodeSend the verification phone code for telegram passport.
account.verifyPhoneVerify a phone number for telegram passport.
account.acceptAuthorizationSends a Telegram Passport authorization form, effectively sharing data with the service
account.getAuthorizationFormReturns a Telegram Passport authorization form for sharing data with a service
account.getAuthorizationsGet logged-in sessions
account.deleteSecureValueDelete stored Telegram Passport documents, for more info see the passport docs »
account.getAllSecureValuesGet all saved Telegram Passport documents, for more info see the passport docs »
account.getSecureValueGet saved Telegram Passport document, for more info see the passport docs »
account.saveSecureValueSecurely save Telegram Passport document, for more info see the passport docs »
help.getPassportConfigGet passport configuration
users.setSecureValueErrorsNotify the user that the sent passport data contains some errors The user will not be able to re-submit their Passport data to you until the errors are fixed (the contents of the field for which you returned the error must change).

Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
NameDescription
contacts.exportContactTokenGenerates a temporary profile link for the currently logged-in user.
contacts.importContactTokenObtain user info from a temporary profile link.

Working with todo lists #

NameDescription
messages.toggleTodoCompletedMark one or more items of a todo list » as completed or not completed.
messages.appendTodoListAppends one or more items to a todo list ».

Working with updates #

NameDescription
updates.getChannelDifferenceReturns the difference between the current state of updates of a certain channel and transmitted.
updates.getDifferenceGet new updates.
updates.getStateReturns a current state of updates.

Working with user/channel profiles #

NameDescription
channels.setMainProfileTabChanges the main profile tab of a channel, see here » for more info.
account.setMainProfileTabChanges the main profile tab of the current user, see here » for more info.
photos.deletePhotosDeletes profile photos. The method returns a list of successfully deleted photo IDs.
photos.getUserPhotosReturns the list of user photos.
photos.updateProfilePhotoInstalls a previously uploaded photo as a profile photo.
photos.uploadProfilePhotoUpdates current user profile photo.

The file, video and video_emoji_markup flags are mutually exclusive.
photos.uploadContactProfilePhotoUpload a custom profile picture for a contact, or suggest a new profile picture to a contact.

The file, video and video_emoji_markup flags are mutually exclusive.
account.updateProfileUpdates user profile.
account.updateBirthdayUpdate our birthday, see here » for more info.
contacts.updateContactNoteUpdate the private note associated to a contact; see here » for more info.
contacts.getBirthdaysFetch all users with birthdays that fall within +1/-1 days, relative to the current day: this method should be invoked by clients every 6-8 hours, and if the result is non-empty, it should be used to appropriately update locally cached birthday information in user.birthday.

See here » for more info.
account.updatePersonalChannelAssociate (or remove) a personal channel », that will be listed on our personal profile page ».

Changing it will emit an updateUser update.
account.updateStatusUpdates online user status.
users.getSavedMusicGet songs pinned to the user's profile, see here » for more info.
users.getSavedMusicByIDCheck if the passed songs are still pinned to the user's profile, or refresh the file references of songs pinned on a user's profile see here » for more info.
account.saveMusicAdds or removes a song from the current user's profile see here » for more info on the music tab of the profile page.
account.getSavedMusicIdsFetch the full list of only the IDs of songs currently added to the profile, see here » for more info.
users.suggestBirthdaySuggest a birthday to another user, see here » for more info on birthdays in the API.
messages.getPersonalChannelHistoryFetch the message history of a user's personal channel ».

Working with voice message transcription #

NameDescription
messages.transcribeAudioTranscribe voice message
messages.rateTranscribedAudioRate transcribed voice message

Working with wallpapers » #

NameDescription
account.getMultiWallPapersGet info about multiple wallpapers
account.getWallPaperGet info about a certain wallpaper
account.getWallPapersReturns a list of available wallpapers.
account.installWallPaperInstall wallpaper
account.resetWallPapersDelete all installed wallpapers, reverting to the default wallpaper set.
account.saveWallPaperInstall/uninstall wallpaper
account.uploadWallPaperCreate and upload a new wallpaper
messages.setChatWallPaperSet a custom wallpaper » in a specific private chat with another user.

Working with bot admin right suggestions #

NameDescription
bots.setBotBroadcastDefaultAdminRightsSet the default suggested admin rights for bots being added as admins to channels, see here for more info on how to handle them ».
bots.setBotGroupDefaultAdminRightsSet the default suggested admin rights for bots being added as admins to groups, see here for more info on how to handle them ».

Working with bot inline queries and callback buttons #

NameDescription
messages.getInlineBotResultsQuery an inline bot
messages.setInlineBotResultsAnswer an inline query, for bots only
messages.sendInlineBotResultSend a result obtained using messages.getInlineBotResults.
messages.getBotCallbackAnswerPress an inline callback button and get a callback answer from the bot
messages.setBotCallbackAnswerSet the callback answer to a user button press (bots only)
messages.editInlineBotMessageEdit an inline bot message
messages.sendBotRequestedPeerSend one or more chosen peers, as requested by a keyboardButtonRequestPeer button.
bots.requestWebViewButtonBots may use this method to prepare a peer request button for a Mini App, see here » for more info.
bots.getRequestedWebViewButtonFetch the peer request button a bot prepared for a Mini App with bots.requestWebViewButton, invoked when the Mini App emits a web_app_request_chat event, see here » for more info.

Working with bots #

NameDescription
bots.resetBotCommandsClear bot commands for the specified bot scope and language code
bots.getBotCommandsObtain a list of bot commands for the specified bot scope and language code
bots.setBotCommandsSet bot command list
bots.setBotInfoSet localized name, about text and description of a bot (or of the current account, if called by a bot).
bots.getBotInfoGet localized name, about text and description of a bot (or of the current account, if called by a bot).
bots.getAdminedBotsGet a list of bots owned by the current user

Working with bots (internal bot API use) #

NameDescription
bots.answerWebhookJSONQueryAnswers a custom query; for bots only
bots.sendCustomRequestSends a custom request; for bots only
help.setBotUpdatesStatusInforms the server about the number of pending bot updates if they haven't been processed for a long time; for bots only

Working with contacts and top peers #

NameDescription
account.getContactSignUpNotificationWhether the user will receive notifications when contacts sign up
account.setContactSignUpNotificationToggle contact sign up notifications
contacts.acceptContactIf the add contact action bar is active, add that user as contact
contacts.addContactAdd an existing telegram user as contact.

Use contacts.importContacts to add contacts by phone number, without knowing their Telegram ID.
contacts.blockAdds a peer to a blocklist, see here » for more info.
contacts.deleteByPhonesDelete contacts by phone number
contacts.deleteContactsDeletes several contacts from the list.
contacts.getBlockedReturns the list of blocked users.
contacts.getContactIDsGet the telegram IDs of all contacts.
Returns an array of Telegram user IDs for all contacts (0 if a contact does not have an associated Telegram account or have hidden their account using privacy settings).
contacts.getContactsReturns the current user's contact list.
contacts.getLocatedGet users and geochats near you, see here » for more info.
contacts.getSavedGet all contacts, requires a takeout session, see here » for more info.
contacts.getStatusesUse this method to obtain the online statuses of all contacts with an accessible Telegram account.
contacts.getTopPeersGet most used peers
contacts.importContactsImports contacts: saves a full list on the server, adds already registered contacts to the contact list, returns added contacts and their info.

Use contacts.addContact to add Telegram contacts without actually using their phone number.
contacts.resetSavedRemoves all contacts without an associated Telegram account.
contacts.resetTopPeerRatingReset rating of top peer
contacts.searchReturns users found by username substring.
contacts.toggleTopPeersEnable/disable top peers
contacts.unblockDeletes a peer from a blocklist, see here » for more info.
contacts.setBlockedReplace the contents of an entire blocklist, see here for more info ».
contacts.editCloseFriendsEdit the close friends list, see here » for more info.

Working with dialogs #

NameDescription
messages.getDialogsReturns the current user dialog list.
messages.getPeerDialogsGet dialog info of specified peers
messages.getPinnedDialogsGet pinned dialogs
messages.toggleDialogPinPin/unpin a dialog
messages.reorderPinnedDialogsReorder pinned dialogs
messages.getDialogUnreadMarksGet dialogs manually marked as unread
messages.markDialogUnreadManually mark dialog as unread
messages.getPeerSettingsGet peer settings
messages.hidePeerSettingsBarShould be called after the user hides the report spam/add as contact bar of a new chat, effectively prevents the user from executing the actions specified in the action bar ».
messages.getOnlinesGet count of online users in a chat
messages.sendScreenshotNotificationNotify the other user in a private chat that a screenshot of the chat was taken
messages.setTypingSends a current user typing event (see SendMessageAction for all event types) to a conversation partner or group.
messages.setHistoryTTLSet maximum Time-To-Live of all messages in the specified chat

Working with imported chats #

NameDescription
messages.uploadImportedMediaUpload a media file associated with an imported chat, click here for more info ».
messages.startHistoryImportComplete the history import process, importing all messages into the chat.
To be called only after initializing the import with messages.initHistoryImport and uploading all files using messages.uploadImportedMedia.
messages.checkHistoryImportPeerCheck whether chat history exported from another chat app can be imported into a specific Telegram chat, click here for more info ».

If the check succeeds, and no RPC errors are returned, a messages.CheckedHistoryImportPeer constructor will be returned, with a confirmation text to be shown to the user, before actually initializing the import.
messages.checkHistoryImportObtains information about a chat export file, generated by a foreign chat app, click here for more info about imported chats ».
messages.initHistoryImportImport chat history from a foreign chat app into a specific Telegram chat, click here for more info about imported chats ».

Working with localization packs #

NameDescription
langpack.getDifferenceGet new strings in language pack
langpack.getLangPackGet localization pack strings
langpack.getLanguageGet information about a language in a localization pack
langpack.getLanguagesGet information about all languages in a localization pack
langpack.getStringsGet strings from a language pack

Working with media autodownload settings #

NameDescription
account.getAutoDownloadSettingsGet media autodownload settings
account.saveAutoDownloadSettingsChange media autodownload settings

Working with media autosave settings #

NameDescription
account.getAutoSaveSettingsGet autosave settings
account.saveAutoSaveSettingsModify autosave settings
account.deleteAutoSaveExceptionsClear all peer-specific autosave settings.

Working with message threads #

NameDescription
messages.getRepliesGet messages in a reply thread
contacts.blockFromRepliesStop getting notifications about discussion replies of a certain user in @replies
messages.getDiscussionMessageGet discussion message from the associated discussion group of a channel to show it on top of the comment section, without actually joining the group
messages.readDiscussionMark a thread as read

Working with messages #

NameDescription
messages.deleteHistoryDeletes communication history.
messages.deleteMessagesDeletes messages by their identifiers.
messages.editMessageEdit message
messages.forwardMessagesForwards messages by their IDs.
messages.getHistoryReturns the message history in a peer.

Results are ordered by date (descending).
messages.getSearchResultsPositionsReturns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation.

Returns the results in reverse chronological order (i.e., in order of decreasing message_id).
messages.getMessageEditDataFind out if a media message's caption can be edited
messages.getOutboxReadDateGet the exact read date of one of our messages, sent to a private chat with another user.

Can be only done for private outgoing messages not older than appConfig.pm_read_date_expire_period ».

If the peer's userFull.read_dates_private flag is set, we will not be able to fetch the exact read date of messages we send to them, and a USER_PRIVACY_RESTRICTED RPC error will be emitted.
The exact read date of messages might still be unavailable for other reasons, see here » for more info.
To set userFull.read_dates_private for ourselves invoke account.setGlobalPrivacySettings, setting the settings.hide_read_marks flag.
messages.getMessagesReturns the list of messages by their IDs.
messages.getMessagesViewsGet and increase the view counter of a message sent or forwarded from a channel
messages.getRecentLocationsGet all recent live locations sent to a specific chat: returns up to 1 location message (messageMediaGeoLive) per chat participant.
messages.getSearchCountersGet the number of results that would be found by a messages.search call with the same parameters
messages.getUnreadMentionsGet unread messages where we were mentioned
messages.readHistoryMarks message history as read.
messages.readMentionsMark mentions as read; can be used in forums but cannot be used in monoforums.
messages.readMessageContentsNotifies the sender about the recipient having listened a voice message or watched a video, emitting an updateReadMessagesContents.
messages.receivedMessagesConfirms receipt of messages by a client, cancels PUSH-notification sending.
messages.searchSearch for messages.
messages.getSearchResultsCalendarReturns information about the next messages of the specified type in the chat split by days.

Returns the results in reverse chronological order.
Can return partial results for the last returned day.
messages.searchGlobalSearch for messages and peers globally
messages.searchSentMediaView and search recently sent media.
This method does not support pagination.
channels.checkSearchPostsFloodCheck if the specified global post search » requires payment.
channels.searchPostsGlobally search for posts from public channels » (including those we aren't a member of) containing either a specific hashtag, or a full text query.

Exactly one of query and hashtag must be set.
messages.sendMediaSend a media
messages.sendMessageSends a message to a chat
messages.sendMultiMediaSend an album or grouped media
messages.updatePinnedMessagePin a message
messages.unpinAllMessagesUnpin all pinned messages
messages.saveDefaultSendAsChange the default peer that should be used when sending messages, reactions, poll votes to a specific group
channels.getSendAsObtains a list of peers that can be displayed as the sender in a specific context. With for_live_stories, returns peers that may author live story in-call messages ».

Working with notification settings #

NameDescription
account.registerDeviceRegister device to receive PUSH notifications
account.unregisterDeviceDeletes a device by its token, stops sending PUSH-notifications to it.
account.updateDeviceLockedWhen client-side passcode lock feature is enabled, will not show message texts in incoming PUSH notifications.
account.getNotifyExceptionsReturns list of chats with non-default notification settings
account.getNotifySettingsGets current notification settings for a given user/group, from all users/all groups.
account.updateNotifySettingsEdits notification settings from a given user/group, from all users/all groups.
account.resetNotifySettingsResets all notification settings from users and groups.

Working with notification sounds #

NameDescription
account.getSavedRingtonesFetch saved notification sounds
account.saveRingtoneSave or remove saved notification sound.

If the notification sound is already in MP3 format, account.savedRingtone will be returned.
Otherwise, it will be automatically converted and a account.savedRingtoneConverted will be returned, containing a new document object that should be used to refer to the ringtone from now on (ie when deleting it using the unsave parameter, or when downloading it).
account.uploadRingtoneUpload notification sound, use account.saveRingtone to convert it and add it to the list of saved notification sounds.

Working with other users #

NameDescription
users.getFullUserReturns extended user info by ID.
users.getUsersReturns basic user info according to their identifiers.
contacts.resolvePhoneResolve a phone number to get user info, if their privacy settings allow it.

Make sure to implement client-side ratelimiting/debounce for this method, allowing at most 1 call every 3 seconds.

Working with payments #

NameDescription
payments.getSavedInfoGet saved payment information
payments.clearSavedInfoClear saved payment information
payments.getPaymentFormGet a payment form
payments.validateRequestedInfoSubmit requested order information for validation
messages.setBotShippingResultsIf you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the bot will receive an updateBotShippingQuery update. Use this method to reply to shipping queries.
account.getTmpPasswordGet temporary payment password
payments.sendPaymentFormSend compiled payment form
messages.setBotPrecheckoutResultsOnce the user has confirmed their payment and shipping details, the bot receives an updateBotPrecheckoutQuery update.
Use this method to respond to such pre-checkout queries.
Note: Telegram must receive an answer within 10 seconds after the pre-checkout query was sent.
payments.getPaymentReceiptGet payment receipt
payments.exportInvoiceGenerate an invoice deep link
payments.getBankCardDataGet info about a credit card

Working with polls #

NameDescription
messages.getPollResultsGet poll results
messages.getPollVotesGet poll results for non-anonymous polls
messages.sendVoteVote in a poll

Starting from layer 159, the vote will be sent from the peer specified using messages.saveDefaultSendAs.

Before voting, clients should check that the user is actually allowed to vote: voting is not possible if the poll is closed, if it is subscriber-only » and the user is not an eligible subscriber, or if it is country-restricted » and the user's phone_country_iso2 » is not in the poll's allowed country list. See vote restrictions » for the full list of conditions.
messages.addPollAnswerAdd an answer option to an open-answer poll »
messages.deletePollAnswerRemove an answer option from an open-answer poll »
messages.getUnreadPollVotesGet messages containing polls with unread votes »
messages.readPollVotesMark all unread poll votes » in a chat as read

Working with scheduled messages #

NameDescription
messages.sendScheduledMessagesSend scheduled messages right away
messages.getScheduledHistoryGet scheduled messages
messages.deleteScheduledMessagesDelete scheduled messages
messages.getScheduledMessagesGet scheduled messages

Working with sensitive content (NSFW) #

NameDescription
account.getContentSettingsGet sensitive content settings
account.setContentSettingsSet sensitive content settings (for viewing or hiding NSFW content)

Working with the AI features » #

NameDescription
messages.composeMessageWithAIInvokes telegram's AI Editor that can translate, transform, fixup and/or emojify your message in a number of different ways, privately powered by Cocoon, see here » for more info!

All of the modes specified below can be combined.
messages.summarizeTextSummarize the contents of a message with AI, see here » for more info.

Clients should use message.summary_from_language as a hint for showing a summarization button; its absence does not forbid invoking this method.
aicompose.createToneCreate a new custom AI composer tone ».
aicompose.updateToneEdit a custom AI composer tone » previously created by the current user. Only the fields whose flag is set will be modified.
aicompose.saveToneInstall or uninstall an AI composer tone », adding it to or removing it from the list of saved tones of the current user.

Non-Premium users may install up to aicompose_tone_saved_limit_default » tones, Premium users up to aicompose_tone_saved_limit_premium » tones.
aicompose.deleteTonePermanently delete a custom AI composer tone » created by the current user.
aicompose.getToneFetch information about a single AI composer tone », for example to resolve a shared tone deep link.
aicompose.getTonesFetch the list of saved AI composer tones » of the current user.
aicompose.getToneExampleFetch an example showing how an AI composer tone » rephrases a sample message, used as a preview in the tone picker.

Working with the Telegram Business intro » #

NameDescription
account.updateBusinessIntroSet or remove the Telegram Business introduction ».

Working with the Telegram Business location #

NameDescription
account.updateBusinessLocationBusinesses » may advertise their location using this method, see here » for more info.

To remove business location information invoke the method without setting any of the parameters.

Working with the attachment menu » of mini bot apps » #

NameDescription
messages.getAttachMenuBotsReturns installed attachment menu bot mini apps »
messages.getAttachMenuBotReturns attachment menu entry for a bot mini app that can be launched from the attachment menu »
messages.toggleBotInAttachMenuEnable or disable web bot attachment menu »

Working with the native anti-spam system #

NameDescription
channels.toggleAntiSpamEnable or disable the native antispam system.
channels.reportAntiSpamFalsePositiveReport a native antispam false positive

Working with the privacy settings #

NameDescription
account.getPrivacyGet privacy settings of current account
account.setPrivacyChange privacy settings of current account
account.setGlobalPrivacySettingsSet global privacy settings
account.getGlobalPrivacySettingsGet global privacy settings
messages.setDefaultHistoryTTLChanges the default value of the Time-To-Live setting, applied to all new chats.
messages.getDefaultHistoryTTLGets the default value of the Time-To-Live setting, applied to all new chats.
users.getRequirementsToContactCheck whether we can write to the specified users, used to implement bulk checks for Premium-only messages » and paid messages ».

For each input user, returns a RequirementToContact constructor (at the same offset in the vector) containing requirements to contact them.

Working with the takeout API, see here » for more info. #

NameDescription
account.initTakeoutSessionInitialize a takeout session, see here » for more info.
account.finishTakeoutSessionTerminate a takeout session, see here » for more info.
messages.getSplitRangesGet message ranges for saving the user's chat history
channels.getLeftChannelsGet a list of channels/supergroups we left, requires a takeout session, see here » for more info.
invokeWithMessagesRangeInvoke with the given message range
invokeWithTakeoutInvoke a method within a takeout session, see here » for more info.

Working with the bot menu button » #

NameDescription
bots.setBotMenuButtonSets the menu button action » for a given user or for all users
bots.getBotMenuButtonGets the menu button action for a given user or for all users, previously set using bots.setBotMenuButton; users can see this information in the botInfo constructor.

Working with the user's account #

NameDescription
account.changePhoneChange the phone number of the current account
account.confirmPhoneConfirm a phone number to cancel account deletion, for more info click here »
account.deleteAccountDelete the user's account from the telegram servers.

Can also be used to delete the account of a user that provided the login code, but forgot the 2FA password and no recovery method is configured, see here » for more info on password recovery, and here » for more info on account deletion.
account.getAccountTTLGet days to live of account
account.resetAuthorizationLog out an active authorized session by its hash
account.sendChangePhoneCodeVerify a new phone number to associate to the current account
account.sendConfirmPhoneCodeSend confirmation code to cancel account deletion, for more info click here »
account.setAccountTTLSet account self-destruction period

Working with timezones #

NameDescription
help.getTimezonesListReturns timezone information that may be used elsewhere in the API, such as to set Telegram Business opening hours ».

Working with usernames #

NameDescription
channels.checkUsernameCheck if a username is free and can be assigned to a channel/supergroup
channels.updateUsernameChange or remove the username of a supergroup/channel
account.updateUsernameChanges username for the current user.
account.checkUsernameValidates a username and checks availability.
contacts.resolveUsernameResolve a @username to get peer info