Download OpenAPI specification:Download
TypeScript http client
Generated from official Telegram documentation
Use this method to send answers to callback queries sent from inline keyboards
The answer will be displayed to the user as a notification at the top of the chat screen or as an alert
Alternatively, the user can be redirected to the specified Game URL
For this option to work, you must first create a game for your bot via @BotFather and accept the terms
Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
callback_query_id required | string Unique identifier for the query to be answered |
text | string Text of the notification |
show_alert | boolean If True, an alert will be shown by the client instead of a notification at the top of the chat screen |
url | string URL that will be opened by the user's client |
cache_time | number The maximum amount of time in seconds that the result of the callback query may be cached client-side |
"boolean"
Use this method to approve a chat join request
The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
user_id required | number Unique identifier of the target user |
"boolean"
Use this method to ban a user in a group, a supergroup or a channel
In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first
The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights
required | number or string Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) |
user_id required | number Unique identifier of the target user |
until_date | number Date when the user will be unbanned; Unix time |
revoke_messages | boolean Pass True to delete all messages from the chat for the user that is being removed |
"boolean"
Use this method to ban a channel chat in a supergroup or a channel
Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels
The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
sender_chat_id required | number Unique identifier of the target sender chat |
"boolean"
Use this method to close the bot instance before moving it from one local server to another
You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart
The method will return error 429 in the first 10 minutes after the bot is launched
Requires no parameters.
"boolean"
Use this method to close an open topic in a forum supergroup chat
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
message_thread_id required | number Unique identifier for the target message thread of the forum topic |
"boolean"
Use this method to close an open 'General' topic in a forum supergroup chat
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
"boolean"
Use this method to copy messages of any kind
Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied
A quiz poll can be copied only if the value of the field correct_option_id is known to the bot
The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | number or string Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) |
message_id required | number Message identifier in the chat specified in from_chat_id |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
caption | string New caption for media, 0-1024 characters after entities parsing |
string Mode for parsing entities in the new caption | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode | |
show_caption_above_media | boolean Pass True, if the caption must be shown above the message media |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"MessageId"
Use this method to copy messages of any kind
If some of the specified messages can't be found or copied, they are skipped
Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied
A quiz poll can be copied only if the value of the field correct_option_id is known to the bot
The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message
Album grouping is kept for copied messages
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | number or string Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) |
message_ids required | Array of numbers A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
disable_notification | boolean Sends the messages silently |
protect_content | boolean Protects the contents of the sent messages from forwarding and saving |
remove_caption | boolean Pass True to copy the messages without their captions |
"MessageId[]"
Use this method to create an additional invite link for a chat
The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights
The link can be revoked using the method revokeChatInviteLink
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
name | string Invite link name; 0-32 characters |
expire_date | number Point in time (Unix timestamp) when the link will expire |
member_limit | number The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 |
creates_join_request | boolean True, if users joining the chat via the link need to be approved by chat administrators |
"ChatInviteLink"
Use this method to create a subscription invite link for a channel chat
The bot must have the can_invite_users administrator rights
The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink
required | number or string Unique identifier for the target channel chat or username of the target channel (in the format @channelusername) |
subscription_period required | number The number of seconds the subscription will be active for before the next payment |
subscription_price required | number The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500 |
name | string Invite link name; 0-32 characters |
"ChatInviteLink"
Use this method to create a topic in a forum supergroup chat
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
name required | string Topic name, 1-128 characters |
icon_color | number Color of the topic icon in RGB format |
icon_custom_emoji_id | string Unique identifier of the custom emoji shown as the topic icon |
"ForumTopic"
Use this method to decline a chat join request
The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
user_id required | number Unique identifier of the target user |
"boolean"
Use this method to delete a chat photo
Photos can't be changed for private chats
The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
"boolean"
Use this method to delete a group sticker set from a supergroup
The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights
Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
"boolean"
Use this method to delete a forum topic along with all its messages in a forum supergroup chat
The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
message_thread_id required | number Unique identifier for the target message thread of the forum topic |
"boolean"
Use this method to delete the list of the bot's commands for the given scope and user language
After deletion, higher level commands will be shown to affected users
object or object or object or object or object or object or object (BotCommandScope) | |
language_code | string A two-letter ISO 639-1 language code |
"boolean"
Use this method to edit a non-primary invite link created by the bot
The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
invite_link required | string The invite link to edit |
name | string Invite link name; 0-32 characters |
expire_date | number Point in time (Unix timestamp) when the link will expire |
member_limit | number The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 |
creates_join_request | boolean True, if users joining the chat via the link need to be approved by chat administrators |
"ChatInviteLink"
Use this method to edit a subscription invite link created by the bot
The bot must have the can_invite_users administrator rights
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
invite_link required | string The invite link to edit |
name | string Invite link name; 0-32 characters |
"ChatInviteLink"
Use this method to edit name and icon of a topic in a forum supergroup chat
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
message_thread_id required | number Unique identifier for the target message thread of the forum topic |
name | string New topic name, 0-128 characters |
icon_custom_emoji_id | string New unique identifier of the custom emoji shown as the topic icon |
"boolean"
Use this method to edit the name of the 'General' topic in a forum supergroup chat
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
name required | string New topic name, 1-128 characters |
"boolean"
Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked
The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
"string"
Use this method to forward messages of any kind
Service messages and messages with protected content can't be forwarded
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | number or string Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) |
message_id required | number Message identifier in the chat specified in from_chat_id |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the forwarded message from forwarding and saving |
"Message"
Use this method to forward multiple messages of any kind
If some of the specified messages can't be found or forwarded, they are skipped
Service messages and messages with protected content can't be forwarded
Album grouping is kept for forwarded messages
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | number or string Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) |
message_ids required | Array of numbers A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
disable_notification | boolean Sends the messages silently |
protect_content | boolean Protects the contents of the forwarded messages from forwarding and saving |
"MessageId[]"
Use this method to get information about the connection of the bot with a business account
business_connection_id required | string Unique identifier of the business connection |
"BusinessConnection"
Use this method to get up-to-date information about the chat
required | number or string Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
"ChatFullInfo"
Use this method to get a list of administrators in a chat, which aren't bots
required | number or string Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
"ChatMember[]"
Use this method to get information about a member of a chat
The method is only guaranteed to work for other users if the bot is an administrator in the chat
required | number or string Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
user_id required | number Unique identifier of the target user |
"ChatMember"
Use this method to get the number of members in a chat
required | number or string Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
"number"
Use this method to get the current value of the bot's menu button in a private chat, or the default menu button
chat_id | number Unique identifier for the target private chat |
"MenuButton"
Use this method to get basic information about a file and prepare it for downloading
For the moment, bots can download files of up to 20MB in size
The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response
It is guaranteed that the link will be valid for at least 1 hour
When the link expires, a new one can be requested by calling getFile again.
file_id required | string File identifier to get information about |
"File"
Use this method to get the current list of the bot's commands for the given scope and user language
If commands aren't set, an empty list is returned.
object or object or object or object or object or object or object (BotCommandScope) | |
language_code | string A two-letter ISO 639-1 language code or an empty string |
"BotCommand[]"
Use this method to get the current default administrator rights of the bot
for_channels | boolean Pass True to get default administrator rights of the bot in channels |
"ChatAdministratorRights"
Use this method to get the current bot short description for the given user language
language_code | string A two-letter ISO 639-1 language code or an empty string |
"BotShortDescription"
Use this method to get the list of boosts added to a chat by a user
Requires administrator rights in the chat
required | number or string Unique identifier for the chat or username of the channel (in the format @channelusername) |
user_id required | number Unique identifier of the target user |
"UserChatBoosts"
Use this method to get a list of profile pictures for a user
user_id required | number Unique identifier of the target user |
offset | number Sequential number of the first photo to be returned |
limit | number Limits the number of photos to be retrieved |
"UserProfilePhotos"
Use this method to hide the 'General' topic in a forum supergroup chat
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
The topic will be automatically closed if it was open
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
"boolean"
Use this method for your bot to leave a group, supergroup or channel
required | number or string Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
"boolean"
Use this method to log out from the cloud Bot API server before launching the bot locally
You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates
After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes
Requires no parameters.
"boolean"
Use this method to add a message to the list of pinned messages in a chat
If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
message_id required | number Identifier of a message to pin |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be pinned |
disable_notification | boolean Pass True if it is not necessary to send a notification to all chat members about the new pinned message |
"boolean"
Use this method to promote or demote a user in a supergroup or a channel
The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights
Pass False for all boolean parameters to demote a user
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
user_id required | number Unique identifier of the target user |
is_anonymous | boolean Pass True if the administrator's presence in the chat is hidden |
can_manage_chat | boolean Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode |
can_delete_messages | boolean Pass True if the administrator can delete messages of other users |
can_manage_video_chats | boolean Pass True if the administrator can manage video chats |
can_restrict_members | boolean Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics |
can_promote_members | boolean Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him) |
can_change_info | boolean Pass True if the administrator can change chat title, photo and other settings |
can_invite_users | boolean Pass True if the administrator can invite new users to the chat |
can_post_stories | boolean Pass True if the administrator can post stories to the chat |
can_edit_stories | boolean Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive |
can_delete_stories | boolean Pass True if the administrator can delete stories posted by other users |
can_post_messages | boolean Pass True if the administrator can post messages in the channel, or access channel statistics; for channels only |
can_edit_messages | boolean Pass True if the administrator can edit messages of other users and can pin messages; for channels only |
can_pin_messages | boolean Pass True if the administrator can pin messages; for supergroups only |
can_manage_topics | boolean Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only |
"boolean"
Use this method to reopen a closed topic in a forum supergroup chat
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
message_thread_id required | number Unique identifier for the target message thread of the forum topic |
"boolean"
Use this method to reopen a closed 'General' topic in a forum supergroup chat
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
The topic will be automatically unhidden if it was hidden
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
"boolean"
Use this method to restrict a user in a supergroup
The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights
Pass True for all permissions to lift restrictions from a user
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
user_id required | number Unique identifier of the target user |
required | object (ChatPermissions) A JSON-serialized object for new user permissions |
use_independent_chat_permissions | boolean Pass True if chat permissions are set independently |
until_date | number Date when restrictions will be lifted for the user; Unix time |
"boolean"
Use this method to revoke an invite link created by the bot
If the primary link is revoked, a new link is automatically generated
The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights
required | number or string Unique identifier of the target chat or username of the target channel (in the format @channelusername) |
invite_link required | string The invite link to revoke |
"ChatInviteLink"
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound)
Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | InputFile (string) or string Animation to send |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
duration | number Duration of sent animation in seconds |
width | number Animation width |
height | number Animation height |
InputFile (string) or string Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side | |
caption | string Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing |
string Mode for parsing entities in the animation caption | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode | |
show_caption_above_media | boolean Pass True, if the caption must be shown above the message media |
has_spoiler | boolean Pass True if the animation needs to be covered with a spoiler animation |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to send audio files, if you want Telegram clients to display them in the music player
Your audio must be in the .MP3 or .M4A format
Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
For sending voice messages, use the sendVoice method instead.
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | InputFile (string) or string Audio file to send |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
caption | string Audio caption, 0-1024 characters after entities parsing |
string Mode for parsing entities in the audio caption | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode | |
duration | number Duration of the audio in seconds |
performer | string Performer |
title | string Track name |
InputFile (string) or string Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side | |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method when you need to tell the user that something is happening on the bot's side
The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status)
Example: The ImageBot needs some time to process a request and upload the image
Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo
The user will see a “sending photo” status for the bot.
We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
action required | string Type of action to broadcast |
business_connection_id | string Unique identifier of the business connection on behalf of which the action will be sent |
message_thread_id | number Unique identifier for the target message thread; for supergroups only |
"boolean"
Use this method to send phone contacts
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
phone_number required | string Contact's phone number |
first_name required | string Contact's first name |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
last_name | string Contact's last name |
vcard | string Additional data about the contact in the form of a vCard, 0-2048 bytes |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to send an animated emoji that will display a random value
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
emoji | string Enum: "🎲" "🎯" "🏀" "⚽" "🎳" "🎰" Emoji on which the dice throw animation is based |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to send general files
Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | InputFile (string) or string File to send |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
InputFile (string) or string Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side | |
caption | string Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing |
string Mode for parsing entities in the document caption | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode | |
disable_content_type_detection | boolean Disables automatic server-side content type detection for files uploaded using multipart/form-data |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to send point on the map
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
latitude required | number Latitude of the location |
longitude required | number Longitude of the location |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
horizontal_accuracy | number The radius of uncertainty for the location, measured in meters; 0-1500 |
live_period | number Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. |
heading | number For live locations, a direction in which the user is moving, in degrees |
proximity_alert_radius | number For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to send a group of photos, videos, documents or audios as an album
Documents and audio files can be only grouped in an album with messages of the same type
On success, an array of Messages that were sent is returned.
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | Array of InputMediaAudio (object) or InputMediaDocument (object) or InputMediaPhoto (object) or InputMediaVideo (object) A JSON-serialized array describing messages to be sent, must include 2-10 items |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
disable_notification | boolean Sends messages silently |
protect_content | boolean Protects the contents of the sent messages from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to |
"Message[]"
Use this method to send text messages
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
text required | string Text of the message to be sent, 1-4096 characters after entities parsing |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
string Mode for parsing entities in the message text | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode | |
object (LinkPreviewOptions) Link preview generation options for the message | |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to send paid media
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
star_count required | number The number of Telegram Stars that must be paid to buy access to the media; 1-2500 |
required | Array of InputPaidMediaPhoto (object) or InputPaidMediaVideo (object) (InputPaidMedia) A JSON-serialized array describing the media to be sent; up to 10 items |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
payload | string Bot-defined paid media payload, 0-128 bytes |
caption | string Media caption, 0-1024 characters after entities parsing |
string Mode for parsing entities in the media caption | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode | |
show_caption_above_media | boolean Pass True, if the caption must be shown above the message media |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to send photos
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | InputFile (string) or string Photo to send |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
caption | string Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing |
string Mode for parsing entities in the photo caption | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode | |
show_caption_above_media | boolean Pass True, if the caption must be shown above the message media |
has_spoiler | boolean Pass True if the photo needs to be covered with a spoiler animation |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to send a native poll
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
question required | string Poll question, 1-300 characters |
required | Array of objects (InputPollOption) A JSON-serialized list of 2-10 answer options |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
string Mode for parsing entities in the question | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in the poll question | |
is_anonymous | boolean True, if the poll needs to be anonymous, defaults to True |
type | string Poll type, “quiz” or “regular”, defaults to “regular” |
allows_multiple_answers | boolean True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False |
correct_option_id | number 0-based identifier of the correct answer option, required for polls in quiz mode |
explanation | string Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing |
string Mode for parsing entities in the explanation | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in the poll explanation | |
open_period | number Amount of time in seconds the poll will be active after creation, 5-600 |
close_date | number Point in time (Unix timestamp) when the poll will be automatically closed |
is_closed | boolean Pass True if the poll needs to be immediately closed |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to send information about a venue
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
latitude required | number Latitude of the venue |
longitude required | number Longitude of the venue |
title required | string Name of the venue |
address required | string Address of the venue |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
foursquare_id | string Foursquare identifier of the venue |
foursquare_type | string Foursquare type of the venue, if known |
google_place_id | string Google Places identifier of the venue |
google_place_type | string Google Places type of the venue |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document)
Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | InputFile (string) or string Video to send |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
duration | number Duration of sent video in seconds |
width | number Video width |
height | number Video height |
InputFile (string) or string Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side | |
caption | string Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing |
string Mode for parsing entities in the video caption | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode | |
show_caption_above_media | boolean Pass True, if the caption must be shown above the message media |
has_spoiler | boolean Pass True if the video needs to be covered with a spoiler animation |
supports_streaming | boolean Pass True if the uploaded video is suitable for streaming |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long
Use this method to send video messages
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | InputFile (string) or string Video note to send |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
duration | number Duration of sent video in seconds |
length | number Video width and height, i.e |
InputFile (string) or string Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side | |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message
For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document)
Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | InputFile (string) or string Audio file to send |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
caption | string Voice message caption, 0-1024 characters after entities parsing |
string Mode for parsing entities in the voice message caption | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode | |
duration | number Duration of the voice message in seconds |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to set a custom title for an administrator in a supergroup promoted by the bot
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
user_id required | number Unique identifier of the target user |
custom_title required | string New custom title for the administrator; 0-16 characters, emoji are not allowed |
"boolean"
Use this method to change the description of a group, a supergroup or a channel
The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
description | string New chat description, 0-255 characters |
"boolean"
Use this method to change the bot's menu button in a private chat, or the default menu button
chat_id | number Unique identifier for the target private chat |
object or object or object (MenuButton) |
"boolean"
Use this method to set default chat permissions for all members
The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
required | object (ChatPermissions) A JSON-serialized object for new default chat permissions |
use_independent_chat_permissions | boolean Pass True if chat permissions are set independently |
"boolean"
Use this method to set a new profile photo for the chat
Photos can't be changed for private chats
The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
photo required | string <binary> (InputFile) New chat photo, uploaded using multipart/form-data |
"boolean"
Use this method to set a new group sticker set for a supergroup
The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights
Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
sticker_set_name required | string Name of the sticker set to be set as the group sticker set |
"boolean"
Use this method to change the title of a chat
Titles can't be changed for private chats
The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
title required | string New chat title, 1-128 characters |
"boolean"
Use this method to change the chosen reactions on a message
Service messages can't be reacted to
Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel
Bots can't use paid reactions
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
message_id required | number Identifier of the target message |
Array of ReactionTypeEmoji (object) or ReactionTypeCustomEmoji (object) or ReactionTypePaid (object) (ReactionType) A JSON-serialized list of reaction types to set on the message | |
is_big | boolean Pass True to set the reaction with a big animation |
"boolean"
Use this method to change the list of the bot's commands
See this manual for more details about bot commands
required | Array of objects (BotCommand) A JSON-serialized list of bot commands to be set as the list of the bot's commands |
object or object or object or object or object or object or object (BotCommandScope) | |
language_code | string A two-letter ISO 639-1 language code |
"boolean"
Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels
These rights will be suggested to users, but they are free to modify the list before adding the bot
object (ChatAdministratorRights) A JSON-serialized object describing new default administrator rights | |
for_channels | boolean Pass True to change the default administrator rights of the bot in channels |
"boolean"
Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty
description | string New bot description; 0-512 characters |
language_code | string A two-letter ISO 639-1 language code |
"boolean"
Use this method to change the bot's name
name | string New bot name; 0-64 characters |
language_code | string A two-letter ISO 639-1 language code |
"boolean"
Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot
short_description | string New short description for the bot; 0-120 characters |
language_code | string A two-letter ISO 639-1 language code |
"boolean"
Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess
user_id required | number Unique identifier of the target user |
emoji_status_custom_emoji_id | string Custom emoji identifier of the emoji status to set |
emoji_status_expiration_date | number Expiration date of the emoji status, if any |
"boolean"
Use this method to unban a previously banned user in a supergroup or channel
The user will not return to the group or channel automatically, but will be able to join via link, etc
The bot must be an administrator for this to work
By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it
So if the user is a member of the chat they will also be removed from the chat
If you don't want this, use the parameter only_if_banned
required | number or string Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) |
user_id required | number Unique identifier of the target user |
only_if_banned | boolean Do nothing if the user is not banned |
"boolean"
Use this method to unban a previously banned channel chat in a supergroup or channel
The bot must be an administrator for this to work and must have the appropriate administrator rights
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
sender_chat_id required | number Unique identifier of the target sender chat |
"boolean"
Use this method to unhide the 'General' topic in a forum supergroup chat
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
"boolean"
Use this method to clear the list of pinned messages in a chat
If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
"boolean"
Use this method to clear the list of pinned messages in a forum topic
The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
message_thread_id required | number Unique identifier for the target message thread of the forum topic |
"boolean"
Use this method to clear the list of pinned messages in a General forum topic
The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup
required | number or string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
"boolean"
Use this method to remove a message from the list of pinned messages in a chat
If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be unpinned |
message_id | number Identifier of the message to unpin |
"boolean"
Use this method to get data for high score tables
Will return the score of the specified user and several of their neighbors in a game
This method will currently return scores for the target user, plus two of their closest neighbors on each side
Will also return the top three users if the user and their neighbors are not among them
Please note that this behavior is subject to change.
user_id required | number Target user id |
chat_id | number Required if inline_message_id is not specified |
message_id | number Required if inline_message_id is not specified |
inline_message_id | string Required if chat_id and message_id are not specified |
"GameHighScore[]"
Use this method to send a game
chat_id required | number Unique identifier for the target chat |
game_short_name required | string Short name of the game, serves as the unique identifier for the game |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
object (InlineKeyboardMarkup) A JSON-serialized object for an inline keyboard |
"Message"
Use this method to set the score of the specified user in a game message
user_id required | number User identifier |
score required | number New score, must be non-negative |
force | boolean Pass True if the high score is allowed to decrease |
disable_edit_message | boolean Pass True if the game message should not be automatically edited to include the current scoreboard |
chat_id | number Required if inline_message_id is not specified |
message_id | number Required if inline_message_id is not specified |
inline_message_id | string Required if chat_id and message_id are not specified |
"Message | boolean"
Use this method to receive incoming updates using long polling (wiki)
offset | number Identifier of the first update to be returned |
limit | number Limits the number of updates to be retrieved |
timeout | number Timeout in seconds for long polling |
allowed_updates | Array of strings A JSON-serialized list of the update types you want your bot to receive |
"Update[]"
Use this method to specify a URL and receive incoming updates via an outgoing webhook
Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update
In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts
If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token
If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
url required | string HTTPS URL to send updates to |
certificate | string <binary> (InputFile) Upload your public key certificate so that the root certificate in use can be checked |
ip_address | string The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS |
max_connections | number The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100 |
allowed_updates | Array of strings A JSON-serialized list of the update types you want your bot to receive |
drop_pending_updates | boolean Pass True to drop all pending updates |
secret_token | string A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request, 1-256 characters |
"boolean"
Use this method to send answers to an inline query
.
No more than 50 results per query are allowed.
inline_query_id required | string Unique identifier for the answered query |
required | Array of InlineQueryResultCachedAudio (object) or InlineQueryResultCachedDocument (object) or InlineQueryResultCachedGif (object) or InlineQueryResultCachedMpeg4Gif (object) or InlineQueryResultCachedPhoto (object) or InlineQueryResultCachedSticker (object) or InlineQueryResultCachedVideo (object) or InlineQueryResultCachedVoice (object) or InlineQueryResultArticle (object) or InlineQueryResultAudio (object) or InlineQueryResultContact (object) or InlineQueryResultGame (object) or InlineQueryResultDocument (object) or InlineQueryResultGif (object) or InlineQueryResultLocation (object) or InlineQueryResultMpeg4Gif (object) or InlineQueryResultPhoto (object) or InlineQueryResultVenue (object) or InlineQueryResultVideo (object) or InlineQueryResultVoice (object) (InlineQueryResult) A JSON-serialized array of results for the inline query |
cache_time | number The maximum amount of time in seconds that the result of the inline query may be cached on the server |
is_personal | boolean Pass True if results may be cached on the server side only for the user that sent the query |
next_offset | string Pass the offset that a client should send in the next query with the same text to receive more results |
object (InlineQueryResultsButton) A JSON-serialized object describing a button to be shown above inline query results |
"boolean"
Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated
web_app_query_id required | string Unique identifier for the query to be answered |
required | object or object or object or object or object or object or object or object or object or object or object or object or object or object or object or object or object or object or object or object (InlineQueryResult) |
"SentWebAppMessage"
Stores a message that can be sent by a user of a Mini App
user_id required | number Unique identifier of the target user that can use the prepared message |
required | object or object or object or object or object or object or object or object or object or object or object or object or object or object or object or object or object or object or object or object (InlineQueryResult) |
allow_user_chats | boolean Pass True if the message can be sent to private chats with users |
allow_bot_chats | boolean Pass True if the message can be sent to private chats with bots |
allow_group_chats | boolean Pass True if the message can be sent to group and supergroup chats |
allow_channel_chats | boolean Pass True if the message can be sent to channel chats |
"PreparedInlineMessage"
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query
Use this method to respond to such pre-checkout queries
Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
pre_checkout_query_id required | string Unique identifier for the query to be answered |
ok required | boolean Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order |
error_message | string Required if ok is False |
"boolean"
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot
Use this method to reply to shipping queries
shipping_query_id required | string Unique identifier for the query to be answered |
ok required | boolean Pass True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible) |
Array of objects (ShippingOption) Required if ok is True | |
error_message | string Required if ok is False |
"boolean"
Use this method to create a link for an invoice
title required | string Product name, 1-32 characters |
description required | string Product description, 1-255 characters |
payload required | string Bot-defined invoice payload, 1-128 bytes |
currency required | string Three-letter ISO 4217 currency code, see more on currencies |
required | Array of objects (LabeledPrice) Price breakdown, a JSON-serialized list of components (e.g |
business_connection_id | string Unique identifier of the business connection on behalf of which the link will be created |
provider_token | string Payment provider token, obtained via @BotFather |
subscription_period | number The number of seconds the subscription will be active for before the next payment |
max_tip_amount | number The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double) |
suggested_tip_amounts | Array of numbers A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double) |
provider_data | string JSON-serialized data about the invoice, which will be shared with the payment provider |
photo_url | string URL of the product photo for the invoice |
photo_size | number Photo size in bytes |
photo_width | number Photo width |
photo_height | number Photo height |
need_name | boolean Pass True if you require the user's full name to complete the order |
need_phone_number | boolean Pass True if you require the user's phone number to complete the order |
need_email | boolean Pass True if you require the user's email address to complete the order |
need_shipping_address | boolean Pass True if you require the user's shipping address to complete the order |
send_phone_number_to_provider | boolean Pass True if the user's phone number should be sent to the provider |
send_email_to_provider | boolean Pass True if the user's email address should be sent to the provider |
is_flexible | boolean Pass True if the final price depends on the shipping method |
"string"
Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars
user_id required | number Identifier of the user whose subscription will be edited |
telegram_payment_charge_id required | string Telegram payment identifier for the subscription |
is_canceled required | boolean Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period |
"boolean"
Returns the bot's Telegram Star transactions in chronological order
offset | number Number of transactions to skip in the response |
limit | number The maximum number of transactions to be retrieved |
"StarTransactions"
Refunds a successful payment in Telegram Stars
user_id required | number Identifier of the user whose payment will be refunded |
telegram_payment_charge_id required | string Telegram payment identifier |
"boolean"
Use this method to send invoices
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
title required | string Product name, 1-32 characters |
description required | string Product description, 1-255 characters |
payload required | string Bot-defined invoice payload, 1-128 bytes |
currency required | string Three-letter ISO 4217 currency code, see more on currencies |
required | Array of objects (LabeledPrice) Price breakdown, a JSON-serialized list of components (e.g |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
provider_token | string Payment provider token, obtained via @BotFather |
max_tip_amount | number The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double) |
suggested_tip_amounts | Array of numbers A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double) |
start_parameter | string Unique deep-linking parameter |
provider_data | string JSON-serialized data about the invoice, which will be shared with the payment provider |
photo_url | string URL of the product photo for the invoice |
photo_size | number Photo size in bytes |
photo_width | number Photo width |
photo_height | number Photo height |
need_name | boolean Pass True if you require the user's full name to complete the order |
need_phone_number | boolean Pass True if you require the user's phone number to complete the order |
need_email | boolean Pass True if you require the user's email address to complete the order |
need_shipping_address | boolean Pass True if you require the user's shipping address to complete the order |
send_phone_number_to_provider | boolean Pass True if the user's phone number should be sent to the provider |
send_email_to_provider | boolean Pass True if the user's email address should be sent to the provider |
is_flexible | boolean Pass True if the final price depends on the shipping method |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
object (InlineKeyboardMarkup) A JSON-serialized object for an inline keyboard |
"Message"
Use this method to add a new sticker to a set created by the bot
Emoji sticker sets can have up to 200 stickers
Other sticker sets can have up to 120 stickers
user_id required | number User identifier of sticker set owner |
name required | string Sticker set name |
required | object (InputSticker) A JSON-serialized object with information about the added sticker |
"boolean"
Use this method to create a new sticker set owned by a user
The bot will be able to edit the sticker set thus created
user_id required | number User identifier of created sticker set owner |
name required | string Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals) |
title required | string Sticker set title, 1-64 characters |
required | Array of objects (InputSticker) A JSON-serialized list of 1-50 initial stickers to be added to the sticker set |
sticker_type | string Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji” |
needs_repainting | boolean Pass True if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only |
"boolean"
Use this method to get information about custom emoji stickers by their identifiers
custom_emoji_ids required | Array of strings A JSON-serialized list of custom emoji identifiers |
"Sticker[]"
Removes verification from a chat that is currently verified on behalf of the organization represented by the bot
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
"boolean"
Removes verification from a user who is currently verified on behalf of the organization represented by the bot
user_id required | number Unique identifier of the target user |
"boolean"
Use this method to replace an existing sticker in a sticker set with a new one
The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet
user_id required | number User identifier of the sticker set owner |
name required | string Sticker set name |
old_sticker required | string File identifier of the replaced sticker |
required | object (InputSticker) A JSON-serialized object with information about the added sticker |
"boolean"
Sends a gift to the given user
The gift can't be converted to Telegram Stars by the user
user_id required | number Unique identifier of the target user that will receive the gift |
gift_id required | string Identifier of the gift |
pay_for_upgrade | boolean Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver |
text | string Text that will be shown along with the gift; 0-255 characters |
string Mode for parsing entities in the text | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in the gift text |
"boolean"
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
required | InputFile (string) or string Sticker to send |
business_connection_id | string Unique identifier of the business connection on behalf of which the message will be sent |
message_thread_id | number Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
emoji | string Emoji associated with the sticker; only for just uploaded stickers |
disable_notification | boolean Sends the message silently |
protect_content | boolean Protects the contents of the sent message from forwarding and saving |
allow_paid_broadcast | boolean Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message |
message_effect_id | string Unique identifier of the message effect to be added to the message; for private chats only |
object (ReplyParameters) Description of the message to reply to | |
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object) Additional interface options |
"Message"
Use this method to set the thumbnail of a custom emoji sticker set
name required | string Sticker set name |
custom_emoji_id | string Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail. |
"boolean"
Use this method to change the list of emoji assigned to a regular or custom emoji sticker
The sticker must belong to a sticker set created by the bot
sticker required | string File identifier of the sticker |
emoji_list required | Array of strings A JSON-serialized list of 1-20 emoji associated with the sticker |
"boolean"
Use this method to change search keywords assigned to a regular or custom emoji sticker
The sticker must belong to a sticker set created by the bot
sticker required | string File identifier of the sticker |
keywords | Array of strings A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters |
"boolean"
Use this method to change the mask position of a mask sticker
The sticker must belong to a sticker set that was created by the bot
sticker required | string File identifier of the sticker |
object (MaskPosition) A JSON-serialized object with the position where the mask should be placed on faces |
"boolean"
Use this method to move a sticker in a set created by the bot to a specific position
sticker required | string File identifier of the sticker |
position required | number New sticker position in the set, zero-based |
"boolean"
Use this method to set the thumbnail of a regular or mask sticker set
The format of the thumbnail file must match the format of the stickers in the set
name required | string Sticker set name |
user_id required | number User identifier of the sticker set owner |
format required | string Enum: "static" "animated" "video" Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a .WEBM video |
InputFile (string) or string A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animation-requirements for animated sticker technical requirements), or a .WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-requirements for video sticker technical requirements |
"boolean"
Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times)
user_id required | number User identifier of sticker file owner |
sticker required | string <binary> (InputFile) A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format |
sticker_format required | string Enum: "static" "animated" "video" Format of the sticker, must be one of “static”, “animated”, “video” |
"File"
Verifies a chat on behalf of the organization which is represented by the bot
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
custom_description | string Custom description for the verification; 0-70 characters |
"boolean"
Verifies a user on behalf of the organization which is represented by the bot
user_id required | number Unique identifier of the target user |
custom_description | string Custom description for the verification; 0-70 characters |
"boolean"
Informs a user that some of the Telegram Passport elements they provided contains errors
The user will not be able to re-submit their Passport 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.
user_id required | number User identifier |
required | Array of PassportElementErrorDataField (object) or PassportElementErrorFrontSide (object) or PassportElementErrorReverseSide (object) or PassportElementErrorSelfie (object) or PassportElementErrorFile (object) or PassportElementErrorFiles (object) or PassportElementErrorTranslationFile (object) or PassportElementErrorTranslationFiles (object) or PassportElementErrorUnspecified (object) (PassportElementError) A JSON-serialized array describing the errors |
"boolean"
Use this method to delete a message, including service messages, with the following limitations:- A message can only be deleted if it was sent less than 48 hours ago
.
- Service messages about a supergroup, channel, or forum topic creation can't be deleted
.
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago
.
- Bots can delete outgoing messages in private chats, groups, and supergroups
.
- Bots can delete incoming messages in private chats
.
- Bots granted can_post_messages permissions can delete outgoing messages in channels
.
- If the bot is an administrator of a group, it can delete any message there
.
- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there
.
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
message_id required | number Identifier of the message to delete |
"boolean"
Use this method to delete multiple messages simultaneously
If some of the specified messages can't be found, they are skipped
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
message_ids required | Array of numbers A JSON-serialized list of 1-100 identifiers of messages to delete |
"boolean"
Use this method to edit captions of messages
Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
business_connection_id | string Unique identifier of the business connection on behalf of which the message to be edited was sent |
number or string Required if inline_message_id is not specified | |
message_id | number Required if inline_message_id is not specified |
inline_message_id | string Required if chat_id and message_id are not specified |
caption | string New caption of the message, 0-1024 characters after entities parsing |
string Mode for parsing entities in the message caption | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode | |
show_caption_above_media | boolean Pass True, if the caption must be shown above the message media |
object (InlineKeyboardMarkup) A JSON-serialized object for an inline keyboard. |
"Message | boolean"
Use this method to edit live location messages
A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation
latitude required | number Latitude of new location |
longitude required | number Longitude of new location |
business_connection_id | string Unique identifier of the business connection on behalf of which the message to be edited was sent |
number or string Required if inline_message_id is not specified | |
message_id | number Required if inline_message_id is not specified |
inline_message_id | string Required if chat_id and message_id are not specified |
live_period | number New period in seconds during which the location can be updated, starting from the message send date |
horizontal_accuracy | number The radius of uncertainty for the location, measured in meters; 0-1500 |
heading | number Direction in which the user is moving, in degrees |
proximity_alert_radius | number The maximum distance for proximity alerts about approaching another chat member, in meters |
object (InlineKeyboardMarkup) A JSON-serialized object for a new inline keyboard. |
"Message | boolean"
Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages
If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise
When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL
Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
required | object or object or object or object or object (InputMedia) |
business_connection_id | string Unique identifier of the business connection on behalf of which the message to be edited was sent |
number or string Required if inline_message_id is not specified | |
message_id | number Required if inline_message_id is not specified |
inline_message_id | string Required if chat_id and message_id are not specified |
object (InlineKeyboardMarkup) A JSON-serialized object for a new inline keyboard. |
"Message | boolean"
Use this method to edit only the reply markup of messages
Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
business_connection_id | string Unique identifier of the business connection on behalf of which the message to be edited was sent |
number or string Required if inline_message_id is not specified | |
message_id | number Required if inline_message_id is not specified |
inline_message_id | string Required if chat_id and message_id are not specified |
object (InlineKeyboardMarkup) A JSON-serialized object for an inline keyboard. |
"Message | boolean"
Use this method to edit text and game messages
Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
text required | string New text of the message, 1-4096 characters after entities parsing |
business_connection_id | string Unique identifier of the business connection on behalf of which the message to be edited was sent |
number or string Required if inline_message_id is not specified | |
message_id | number Required if inline_message_id is not specified |
inline_message_id | string Required if chat_id and message_id are not specified |
string Mode for parsing entities in the message text | |
Array of objects (MessageEntity) A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode | |
object (LinkPreviewOptions) Link preview generation options for the message | |
object (InlineKeyboardMarkup) A JSON-serialized object for an inline keyboard. |
"Message | boolean"
Use this method to stop updating a live location message before live_period expires
business_connection_id | string Unique identifier of the business connection on behalf of which the message to be edited was sent |
number or string Required if inline_message_id is not specified | |
message_id | number Required if inline_message_id is not specified |
inline_message_id | string Required if chat_id and message_id are not specified |
object (InlineKeyboardMarkup) A JSON-serialized object for a new inline keyboard. |
"Message | boolean"
Use this method to stop a poll which was sent by the bot
required | number or string Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
message_id required | number Identifier of the original message with the poll |
business_connection_id | string Unique identifier of the business connection on behalf of which the message to be edited was sent |
object (InlineKeyboardMarkup) A JSON-serialized object for a new message inline keyboard. |
"Poll"