diff --git a/docs/telegram-bot-api/index.html b/docs/telegram-bot-api/index.html index a084656..eb0b577 100644 --- a/docs/telegram-bot-api/index.html +++ b/docs/telegram-bot-api/index.html @@ -12,344 +12,344 @@ margin: 0; } - -

Telegram bot api (8.1)

Download OpenAPI specification:Download

NPM Version TypeScript http client

+ " fill="currentColor">

Telegram bot api (8.2)

Download OpenAPI specification:Download

NPM Version TypeScript http client

Generated from official Telegram documentation

-

available-methods

answer_callback_query

Generated from official Telegram documentation

+

available-methods

answer_callback_query

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
+" class="sc-dODueM sc-eHKghg fhLETC hIcgHh">

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.

-
Request Body schema: application/json
callback_query_id
required
string

Unique identifier for the query to be answered

-
text
string

Text of the notification
If not specified, nothing will be shown to the user, 0-200 characters

-
show_alert
boolean

If True, an alert will be shown by the client instead of a notification at the top of the chat screen
Defaults to false.

-
url
string

URL that will be opened by the user's client
If you have created a Game and accepted the conditions via @BotFather, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button
.


Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.

-
cache_time
number

The maximum amount of time in seconds that the result of the callback query may be cached client-side
Telegram apps will support caching starting in version 3.14
Defaults to 0.

-

Responses

Response samples

Content type
application/json
"boolean"

approve_chat_join_request

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

ban_chat_member

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

-
Request Body schema: application/json
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
If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever
Applied for supergroups and channels only.

-
revoke_messages
boolean

Pass True to delete all messages from the chat for the user that is being removed
If False, the user will be able to see messages in the group that were sent before the user was removed
Always True for supergroups and channels.

-

Responses

Response samples

Content type
application/json
"boolean"

ban_chat_sender_chat

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

close

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.

-
Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
"boolean"

close_forum_topic

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

close_general_forum_topic

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

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

-

Responses

Response samples

Content type
application/json
"boolean"

copy_message

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

-
Request Body schema: application/json
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
If not specified, the original caption is kept

-
parse_mode
string

Mode for parsing entities in the new caption
See formatting options for more details.

-
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
Ignored if a new caption isn't specified.

-
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"MessageId"

copy_messages

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

-
Request Body schema: application/json
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
The identifiers must be specified in a strictly increasing order.

-
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
Users will receive a notification with no sound.

-
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

-

Responses

Response samples

Content type
application/json
"MessageId[]"

create_chat_invite_link

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

-
Request Body schema: application/json
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
If True, member_limit can't be specified

-

Responses

Response samples

Content type
application/json
"ChatInviteLink"

create_chat_subscription_invite_link

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

-
Request Body schema: application/json
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
Currently, it must always be 2592000 (30 days).

-
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

-

Responses

Response samples

Content type
application/json
"ChatInviteLink"

create_forum_topic

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

-
Request Body schema: application/json
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
Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)

-
icon_custom_emoji_id
string

Unique identifier of the custom emoji shown as the topic icon
Use getForumTopicIconStickers to get all allowed custom emoji identifiers.

-

Responses

Response samples

Content type
application/json
"ForumTopic"

decline_chat_join_request

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

delete_chat_photo

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

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

-

Responses

Response samples

Content type
application/json
"boolean"

delete_chat_sticker_set

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

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

-

Responses

Response samples

Content type
application/json
"boolean"

delete_forum_topic

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

delete_my_commands

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

-
Request Body schema: application/json
BotCommandScopeDefault (object) or BotCommandScopeAllPrivateChats (object) or BotCommandScopeAllGroupChats (object) or BotCommandScopeAllChatAdministrators (object) or BotCommandScopeChat (object) or BotCommandScopeChatAdministrators (object) or BotCommandScopeChatMember (object) (BotCommandScope)
language_code
string

A two-letter ISO 639-1 language code
If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands

-

Responses

Response samples

Content type
application/json
"boolean"

edit_chat_invite_link

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

-
Request Body schema: application/json
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
If True, member_limit can't be specified

-

Responses

Response samples

Content type
application/json
"ChatInviteLink"

edit_chat_subscription_invite_link

Use this method to edit a subscription invite link created by the bot
The bot must have the can_invite_users administrator rights

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"ChatInviteLink"

edit_forum_topic

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

-
Request Body schema: application/json
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
If not specified or empty, the current name of the topic will be kept

-
icon_custom_emoji_id
string

New unique identifier of the custom emoji shown as the topic icon
Use getForumTopicIconStickers to get all allowed custom emoji identifiers
Pass an empty string to remove the icon
If not specified, the current icon will be kept

-

Responses

Response samples

Content type
application/json
"boolean"

edit_general_forum_topic

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

export_chat_invite_link

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

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

-

Responses

Response samples

Content type
application/json
"string"

forward_message

Use this method to forward messages of any kind
Service messages and messages with protected content can't be forwarded

-
Request Body schema: application/json
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
Users will receive a notification with no sound.

-
protect_content
boolean

Protects the contents of the forwarded message from forwarding and saving

-

Responses

Response samples

Content type
application/json
"Message"

forward_messages

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

-
Request Body schema: application/json
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
The identifiers must be specified in a strictly increasing order.

-
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
Users will receive a notification with no sound.

-
protect_content
boolean

Protects the contents of the forwarded messages from forwarding and saving

-

Responses

Response samples

Content type
application/json
"MessageId[]"

get_business_connection

Use this method to get information about the connection of the bot with a business account

-
Request Body schema: application/json
business_connection_id
required
string

Unique identifier of the business connection

-

Responses

Response samples

Content type
application/json
"BusinessConnection"

get_chat

Use this method to get up-to-date information about the chat

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

-

Responses

Response samples

Content type
application/json
"ChatFullInfo"

get_chat_administrators

Use this method to get a list of administrators in a chat, which aren't bots

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

-

Responses

Response samples

Content type
application/json
"ChatMember[]"

get_chat_member

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"ChatMember"

get_chat_member_count

Use this method to get the number of members in a chat

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

-

Responses

Response samples

Content type
application/json
"number"

get_chat_menu_button

Use this method to get the current value of the bot's menu button in a private chat, or the default menu button

-
Request Body schema: application/json
chat_id
number

Unique identifier for the target private chat
If not specified, default bot's menu button will be returned

-

Responses

Response samples

Content type
application/json
"MenuButton"

get_file

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.

-
Request Body schema: application/json
file_id
required
string

File identifier to get information about

-

Responses

Response samples

Content type
application/json
"File"

get_forum_topic_icon_stickers

Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user
Requires no parameters

-
Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
"Sticker[]"

get_me

A simple method for testing your bot's authentication token
Requires no parameters

-
Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
"User"

get_my_commands

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.

-
Request Body schema: application/json
BotCommandScopeDefault (object) or BotCommandScopeAllPrivateChats (object) or BotCommandScopeAllGroupChats (object) or BotCommandScopeAllChatAdministrators (object) or BotCommandScopeChat (object) or BotCommandScopeChatAdministrators (object) or BotCommandScopeChatMember (object) (BotCommandScope)
language_code
string

A two-letter ISO 639-1 language code or an empty string

-

Responses

Response samples

Content type
application/json
"BotCommand[]"

get_my_default_administrator_rights

Use this method to get the current default administrator rights of the bot

-
Request Body schema: application/json
for_channels
boolean

Pass True to get default administrator rights of the bot in channels
Otherwise, default administrator rights of the bot for groups and supergroups will be returned.

-

Responses

Response samples

Content type
application/json
"ChatAdministratorRights"

get_my_description

Use this method to get the current bot description for the given user language

-
Request Body schema: application/json
language_code
string

A two-letter ISO 639-1 language code or an empty string

-

Responses

Response samples

Content type
application/json
"BotDescription"

get_my_name

Use this method to get the current bot name for the given user language

-
Request Body schema: application/json
language_code
string

A two-letter ISO 639-1 language code or an empty string

-

Responses

Response samples

Content type
application/json
"BotName"

get_my_short_description

Use this method to get the current bot short description for the given user language

-
Request Body schema: application/json
language_code
string

A two-letter ISO 639-1 language code or an empty string

-

Responses

Response samples

Content type
application/json
"BotShortDescription"

get_user_chat_boosts

Use this method to get the list of boosts added to a chat by a user
Requires administrator rights in the chat

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"UserChatBoosts"

get_user_profile_photos

Use this method to get a list of profile pictures for a user

-
Request Body schema: application/json
user_id
required
number

Unique identifier of the target user

-
offset
number

Sequential number of the first photo to be returned
By default, all photos are returned.

-
limit
number

Limits the number of photos to be retrieved
Values between 1-100 are accepted
Defaults to 100.

-

Responses

Response samples

Content type
application/json
"UserProfilePhotos"

hide_general_forum_topic

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

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

-

Responses

Response samples

Content type
application/json
"boolean"

leave_chat

Use this method for your bot to leave a group, supergroup or channel

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

-

Responses

Response samples

Content type
application/json
"boolean"

log_out

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.

-
Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
"boolean"

pin_chat_message

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

-
Request Body schema: application/json
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
Notifications are always disabled in channels and private chats.

-

Responses

Response samples

Content type
application/json
"boolean"

promote_chat_member

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

-
Request Body schema: application/json
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
Implied by any other administrator privilege.

-
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

-

Responses

Response samples

Content type
application/json
"boolean"

reopen_forum_topic

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

reopen_general_forum_topic

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

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

-

Responses

Response samples

Content type
application/json
"boolean"

restrict_chat_member

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

-
Request Body schema: application/json
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)
use_independent_chat_permissions
boolean

Pass True if chat permissions are set independently
Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.

-
until_date
number

Date when restrictions will be lifted for the user; Unix time
If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever

-

Responses

Response samples

Content type
application/json
"boolean"

revoke_chat_invite_link

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"ChatInviteLink"

send_animation

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.

-
Request Body schema: application/json
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
Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data
More information on Sending Files »

-
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
The thumbnail should be in JPEG format and less than 200 kB in size
A thumbnail's width and height should not exceed 320
Ignored if the file is not uploaded using multipart/form-data
Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
More information on Sending Files »

-
caption
string

Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing

-
parse_mode
string

Mode for parsing entities in the animation caption
See formatting options for more details.

-
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
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_audio

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.

-
Request Body schema: application/json
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
Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data
More information on Sending Files »

-
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

-
parse_mode
string

Mode for parsing entities in the audio caption
See formatting options for more details.

-
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
The thumbnail should be in JPEG format and less than 200 kB in size
A thumbnail's width and height should not exceed 320
Ignored if the file is not uploaded using multipart/form-data
Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
More information on Sending Files »

-
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_chat_action

Request Body schema: application/json
callback_query_id
required
string

Unique identifier for the query to be answered

+
text
string

Text of the notification
If not specified, nothing will be shown to the user, 0-200 characters

+
show_alert
boolean

If True, an alert will be shown by the client instead of a notification at the top of the chat screen
Defaults to false.

+
url
string

URL that will be opened by the user's client
If you have created a Game and accepted the conditions via @BotFather, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button
.
Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.

+
cache_time
number

The maximum amount of time in seconds that the result of the callback query may be cached client-side
Telegram apps will support caching starting in version 3.14
Defaults to 0.

+

Responses

Response samples

Content type
application/json
"boolean"

approve_chat_join_request

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

ban_chat_member

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

+
Request Body schema: application/json
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
If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever
Applied for supergroups and channels only.

+
revoke_messages
boolean

Pass True to delete all messages from the chat for the user that is being removed
If False, the user will be able to see messages in the group that were sent before the user was removed
Always True for supergroups and channels.

+

Responses

Response samples

Content type
application/json
"boolean"

ban_chat_sender_chat

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

close

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.

+
Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
"boolean"

close_forum_topic

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

close_general_forum_topic

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

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

+

Responses

Response samples

Content type
application/json
"boolean"

copy_message

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

+
Request Body schema: application/json
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
If not specified, the original caption is kept

+
string

Mode for parsing entities in the new caption
See formatting options for more details.

+
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
Ignored if a new caption isn't specified.

+
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
object (ReplyParameters)

Description of the message to reply to

+
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"MessageId"

copy_messages

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

+
Request Body schema: application/json
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
The identifiers must be specified in a strictly increasing order.

+
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
Users will receive a notification with no sound.

+
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

+

Responses

Response samples

Content type
application/json
"MessageId[]"

create_chat_invite_link

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

+
Request Body schema: application/json
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
If True, member_limit can't be specified

+

Responses

Response samples

Content type
application/json
"ChatInviteLink"

create_chat_subscription_invite_link

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

+
Request Body schema: application/json
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
Currently, it must always be 2592000 (30 days).

+
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

+

Responses

Response samples

Content type
application/json
"ChatInviteLink"

create_forum_topic

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

+
Request Body schema: application/json
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
Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)

+
icon_custom_emoji_id
string

Unique identifier of the custom emoji shown as the topic icon
Use getForumTopicIconStickers to get all allowed custom emoji identifiers.

+

Responses

Response samples

Content type
application/json
"ForumTopic"

decline_chat_join_request

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

delete_chat_photo

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

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

+

Responses

Response samples

Content type
application/json
"boolean"

delete_chat_sticker_set

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

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

+

Responses

Response samples

Content type
application/json
"boolean"

delete_forum_topic

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

delete_my_commands

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

+
Request Body schema: application/json
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
If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands

+

Responses

Response samples

Content type
application/json
"boolean"

edit_chat_invite_link

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

+
Request Body schema: application/json
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
If True, member_limit can't be specified

+

Responses

Response samples

Content type
application/json
"ChatInviteLink"

edit_chat_subscription_invite_link

Use this method to edit a subscription invite link created by the bot
The bot must have the can_invite_users administrator rights

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"ChatInviteLink"

edit_forum_topic

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

+
Request Body schema: application/json
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
If not specified or empty, the current name of the topic will be kept

+
icon_custom_emoji_id
string

New unique identifier of the custom emoji shown as the topic icon
Use getForumTopicIconStickers to get all allowed custom emoji identifiers
Pass an empty string to remove the icon
If not specified, the current icon will be kept

+

Responses

Response samples

Content type
application/json
"boolean"

edit_general_forum_topic

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

export_chat_invite_link

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

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

+

Responses

Response samples

Content type
application/json
"string"

forward_message

Use this method to forward messages of any kind
Service messages and messages with protected content can't be forwarded

+
Request Body schema: application/json
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
Users will receive a notification with no sound.

+
protect_content
boolean

Protects the contents of the forwarded message from forwarding and saving

+

Responses

Response samples

Content type
application/json
"Message"

forward_messages

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

+
Request Body schema: application/json
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
The identifiers must be specified in a strictly increasing order.

+
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
Users will receive a notification with no sound.

+
protect_content
boolean

Protects the contents of the forwarded messages from forwarding and saving

+

Responses

Response samples

Content type
application/json
"MessageId[]"

get_business_connection

Use this method to get information about the connection of the bot with a business account

+
Request Body schema: application/json
business_connection_id
required
string

Unique identifier of the business connection

+

Responses

Response samples

Content type
application/json
"BusinessConnection"

get_chat

Use this method to get up-to-date information about the chat

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

+

Responses

Response samples

Content type
application/json
"ChatFullInfo"

get_chat_administrators

Use this method to get a list of administrators in a chat, which aren't bots

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

+

Responses

Response samples

Content type
application/json
"ChatMember[]"

get_chat_member

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"ChatMember"

get_chat_member_count

Use this method to get the number of members in a chat

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

+

Responses

Response samples

Content type
application/json
"number"

get_chat_menu_button

Use this method to get the current value of the bot's menu button in a private chat, or the default menu button

+
Request Body schema: application/json
chat_id
number

Unique identifier for the target private chat
If not specified, default bot's menu button will be returned

+

Responses

Response samples

Content type
application/json
"MenuButton"

get_file

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.

+
Request Body schema: application/json
file_id
required
string

File identifier to get information about

+

Responses

Response samples

Content type
application/json
"File"

get_forum_topic_icon_stickers

Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user
Requires no parameters

+
Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
"Sticker[]"

get_me

A simple method for testing your bot's authentication token
Requires no parameters

+
Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
"User"

get_my_commands

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.

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"BotCommand[]"

get_my_default_administrator_rights

Use this method to get the current default administrator rights of the bot

+
Request Body schema: application/json
for_channels
boolean

Pass True to get default administrator rights of the bot in channels
Otherwise, default administrator rights of the bot for groups and supergroups will be returned.

+

Responses

Response samples

Content type
application/json
"ChatAdministratorRights"

get_my_description

Use this method to get the current bot description for the given user language

+
Request Body schema: application/json
language_code
string

A two-letter ISO 639-1 language code or an empty string

+

Responses

Response samples

Content type
application/json
"BotDescription"

get_my_name

Use this method to get the current bot name for the given user language

+
Request Body schema: application/json
language_code
string

A two-letter ISO 639-1 language code or an empty string

+

Responses

Response samples

Content type
application/json
"BotName"

get_my_short_description

Use this method to get the current bot short description for the given user language

+
Request Body schema: application/json
language_code
string

A two-letter ISO 639-1 language code or an empty string

+

Responses

Response samples

Content type
application/json
"BotShortDescription"

get_user_chat_boosts

Use this method to get the list of boosts added to a chat by a user
Requires administrator rights in the chat

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"UserChatBoosts"

get_user_profile_photos

Use this method to get a list of profile pictures for a user

+
Request Body schema: application/json
user_id
required
number

Unique identifier of the target user

+
offset
number

Sequential number of the first photo to be returned
By default, all photos are returned.

+
limit
number

Limits the number of photos to be retrieved
Values between 1-100 are accepted
Defaults to 100.

+

Responses

Response samples

Content type
application/json
"UserProfilePhotos"

hide_general_forum_topic

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

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

+

Responses

Response samples

Content type
application/json
"boolean"

leave_chat

Use this method for your bot to leave a group, supergroup or channel

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

+

Responses

Response samples

Content type
application/json
"boolean"

log_out

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.

+
Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
"boolean"

pin_chat_message

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

+
Request Body schema: application/json
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
Notifications are always disabled in channels and private chats.

+

Responses

Response samples

Content type
application/json
"boolean"

promote_chat_member

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

+
Request Body schema: application/json
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
Implied by any other administrator privilege.

+
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

+

Responses

Response samples

Content type
application/json
"boolean"

reopen_forum_topic

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

reopen_general_forum_topic

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

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

+

Responses

Response samples

Content type
application/json
"boolean"

restrict_chat_member

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

+
Request Body schema: application/json
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
Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.

+
until_date
number

Date when restrictions will be lifted for the user; Unix time
If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever

+

Responses

Response samples

Content type
application/json
"boolean"

revoke_chat_invite_link

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"ChatInviteLink"

send_animation

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.

+
Request Body schema: application/json
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
Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data
More information on Sending Files »

+
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
The thumbnail should be in JPEG format and less than 200 kB in size
A thumbnail's width and height should not exceed 320
Ignored if the file is not uploaded using multipart/form-data
Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
More information on Sending Files »

+
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
See formatting options for more details.

+
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
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_audio

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.

+
Request Body schema: application/json
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
Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data
More information on Sending Files »

+
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
See formatting options for more details.

+
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
The thumbnail should be in JPEG format and less than 200 kB in size
A thumbnail's width and height should not exceed 320
Ignored if the file is not uploaded using multipart/form-data
Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
More information on Sending Files »

+
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_chat_action

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)
+" class="sc-dODueM sc-eHKghg fhLETC hIcgHh">

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.

-
Request Body schema: application/json
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
Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.

-
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

-

Responses

Response samples

Content type
application/json
"boolean"

send_contact

Use this method to send phone contacts

-
Request Body schema: application/json
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
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_dice

Use this method to send an animated emoji that will display a random value

-
Request Body schema: application/json
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
Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”
Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”
Defaults to “🎲”

-
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_document

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.

-
Request Body schema: application/json
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
Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data
More information on Sending Files »

-
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
The thumbnail should be in JPEG format and less than 200 kB in size
A thumbnail's width and height should not exceed 320
Ignored if the file is not uploaded using multipart/form-data
Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
More information on Sending Files »

-
caption
string

Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing

-
parse_mode
string

Mode for parsing entities in the document caption
See formatting options for more details.

-
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
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_location

Use this method to send point on the map

-
Request Body schema: application/json
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
Must be between 1 and 360 if specified.

-
proximity_alert_radius
number

For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters
Must be between 1 and 100000 if specified.

-
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_media_group

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.

-
Request Body schema: application/json
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
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)

Responses

Response samples

Content type
application/json
"Message[]"

send_message

Use this method to send text messages

-
Request Body schema: application/json
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

-
parse_mode
string

Mode for parsing entities in the message text
See formatting options for more details.

-
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)
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_paid_media

Use this method to send paid media

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target channel (in the format @channelusername)
If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance
Otherwise, they will be credited to the bot's balance.

-
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
This will not be displayed to the user, use it for your internal processes.

-
caption
string

Media caption, 0-1024 characters after entities parsing

-
parse_mode
string

Mode for parsing entities in the media caption
See formatting options for more details.

-
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
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_photo

Use this method to send photos

-
Request Body schema: application/json
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
Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data
The photo must be at most 10 MB in size
The photo's width and height must not exceed 10000 in total
Width and height ratio must be at most 20
More information on Sending Files »

-
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

-
parse_mode
string

Mode for parsing entities in the photo caption
See formatting options for more details.

-
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
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_poll

Use this method to send a native poll

-
Request Body schema: application/json
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

-
question_parse_mode
string

Mode for parsing entities in the question
See formatting options for more details
Currently, only custom emoji entities are allowed

-
Array of objects (MessageEntity)

A JSON-serialized list of special entities that appear in the poll question
It can be specified instead of question_parse_mode

-
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

-
explanation_parse_mode
string

Mode for parsing entities in the explanation
See formatting options for more details.

-
Array of objects (MessageEntity)

A JSON-serialized list of special entities that appear in the poll explanation
It can be specified instead of explanation_parse_mode

-
open_period
number

Amount of time in seconds the poll will be active after creation, 5-600
Can't be used together with close_date.

-
close_date
number

Point in time (Unix timestamp) when the poll will be automatically closed
Must be at least 5 and no more than 600 seconds in the future
Can't be used together with open_period.

-
is_closed
boolean

Pass True if the poll needs to be immediately closed
This can be useful for poll preview.

-
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_venue

Use this method to send information about a venue

-
Request Body schema: application/json
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
(For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)

-
google_place_id
string

Google Places identifier of the venue

-
google_place_type
string

Google Places type of the venue
(See supported types.)

-
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_video

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.

-
Request Body schema: application/json
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
Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data
More information on Sending Files »

-
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
The thumbnail should be in JPEG format and less than 200 kB in size
A thumbnail's width and height should not exceed 320
Ignored if the file is not uploaded using multipart/form-data
Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
More information on Sending Files »

-
caption
string

Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing

-
parse_mode
string

Mode for parsing entities in the video caption
See formatting options for more details.

-
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
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_video_note

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

-
Request Body schema: application/json
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
Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data
More information on Sending Files »
Sending video notes by a URL is currently unsupported

-
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
diameter of the video message

-
InputFile (string) or string

Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side
The thumbnail should be in JPEG format and less than 200 kB in size
A thumbnail's width and height should not exceed 320
Ignored if the file is not uploaded using multipart/form-data
Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
More information on Sending Files »

-
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

send_voice

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.

-
Request Body schema: application/json
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
Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data
More information on Sending Files »

-
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

-
parse_mode
string

Mode for parsing entities in the voice message caption
See formatting options for more details.

-
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
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

set_chat_administrator_custom_title

Use this method to set a custom title for an administrator in a supergroup promoted by the bot

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

set_chat_description

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

set_chat_menu_button

Use this method to change the bot's menu button in a private chat, or the default menu button

-
Request Body schema: application/json
chat_id
number

Unique identifier for the target private chat
If not specified, default bot's menu button will be changed

-
MenuButtonCommands (object) or MenuButtonWebApp (object) or MenuButtonDefault (object) (MenuButton)

Responses

Response samples

Content type
application/json
"boolean"

set_chat_permissions

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

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

-
required
object (ChatPermissions)
use_independent_chat_permissions
boolean

Pass True if chat permissions are set independently
Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.

-

Responses

Response samples

Content type
application/json
"boolean"

set_chat_photo

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

-
Request Body schema: application/json
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)

Responses

Response samples

Content type
application/json
"boolean"

set_chat_sticker_set

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

set_chat_title

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

set_message_reaction

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

-
Request Body schema: application/json
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
If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead.

-
Array of ReactionTypeEmoji (object) or ReactionTypeCustomEmoji (object) or ReactionTypePaid (object) (ReactionType)

A JSON-serialized list of reaction types to set on the message
Currently, as non-premium users, bots can set up to one reaction per message
A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators
Paid reactions can't be used by bots.

-
is_big
boolean

Pass True to set the reaction with a big animation

-

Responses

Response samples

Content type
application/json
"boolean"

set_my_commands

Use this method to change the list of the bot's commands
See this manual for more details about bot commands

-
Request Body schema: application/json
required
Array of objects (BotCommand)

A JSON-serialized list of bot commands to be set as the list of the bot's commands
At most 100 commands can be specified.

-
BotCommandScopeDefault (object) or BotCommandScopeAllPrivateChats (object) or BotCommandScopeAllGroupChats (object) or BotCommandScopeAllChatAdministrators (object) or BotCommandScopeChat (object) or BotCommandScopeChatAdministrators (object) or BotCommandScopeChatMember (object) (BotCommandScope)
language_code
string

A two-letter ISO 639-1 language code
If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands

-

Responses

Response samples

Content type
application/json
"boolean"

set_my_default_administrator_rights

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

-
Request Body schema: application/json
object (ChatAdministratorRights)
for_channels
boolean

Pass True to change the default administrator rights of the bot in channels
Otherwise, the default administrator rights of the bot for groups and supergroups will be changed.

-

Responses

Response samples

Content type
application/json
"boolean"

set_my_description

Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty

-
Request Body schema: application/json
description
string

New bot description; 0-512 characters
Pass an empty string to remove the dedicated description for the given language.

-
language_code
string

A two-letter ISO 639-1 language code
If empty, the description will be applied to all users for whose language there is no dedicated description.

-

Responses

Response samples

Content type
application/json
"boolean"

set_my_name

Use this method to change the bot's name

-
Request Body schema: application/json
name
string

New bot name; 0-64 characters
Pass an empty string to remove the dedicated name for the given language.

-
language_code
string

A two-letter ISO 639-1 language code
If empty, the name will be shown to all users for whose language there is no dedicated name.

-

Responses

Response samples

Content type
application/json
"boolean"

set_my_short_description

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

-
Request Body schema: application/json
short_description
string

New short description for the bot; 0-120 characters
Pass an empty string to remove the dedicated short description for the given language.

-
language_code
string

A two-letter ISO 639-1 language code
If empty, the short description will be applied to all users for whose language there is no dedicated short description.

-

Responses

Response samples

Content type
application/json
"boolean"

set_user_emoji_status

Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess

-
Request Body schema: application/json
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
Pass an empty string to remove the status.

-
emoji_status_expiration_date
number

Expiration date of the emoji status, if any

-

Responses

Response samples

Content type
application/json
"boolean"

unban_chat_member

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

unban_chat_sender_chat

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

unhide_general_forum_topic

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

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

-

Responses

Response samples

Content type
application/json
"boolean"

unpin_all_chat_messages

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

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

-

Responses

Response samples

Content type
application/json
"boolean"

unpin_all_forum_topic_messages

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

unpin_all_general_forum_topic_messages

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

-
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

-

Responses

Response samples

Content type
application/json
"boolean"

unpin_chat_message

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

-
Request Body schema: application/json
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
Required if business_connection_id is specified
If not specified, the most recent pinned message (by sending date) will be unpinned.

-

Responses

Response samples

Content type
application/json
"boolean"

games

get_game_high_scores

Request Body schema: application/json
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
Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.

+
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

+

Responses

Response samples

Content type
application/json
"boolean"

send_contact

Use this method to send phone contacts

+
Request Body schema: application/json
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
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_dice

Use this method to send an animated emoji that will display a random value

+
Request Body schema: application/json
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
Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”
Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”
Defaults to “🎲”

+
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_document

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.

+
Request Body schema: application/json
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
Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data
More information on Sending Files »

+
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
The thumbnail should be in JPEG format and less than 200 kB in size
A thumbnail's width and height should not exceed 320
Ignored if the file is not uploaded using multipart/form-data
Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
More information on Sending Files »

+
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
See formatting options for more details.

+
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
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_location

Use this method to send point on the map

+
Request Body schema: application/json
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
Must be between 1 and 360 if specified.

+
proximity_alert_radius
number

For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters
Must be between 1 and 100000 if specified.

+
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_media_group

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.

+
Request Body schema: application/json
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
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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

+

Responses

Response samples

Content type
application/json
"Message[]"

send_message

Use this method to send text messages

+
Request Body schema: application/json
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
See formatting options for more details.

+
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
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_paid_media

Use this method to send paid media

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target channel (in the format @channelusername)
If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance
Otherwise, they will be credited to the bot's balance.

+
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
This will not be displayed to the user, use it for your internal processes.

+
caption
string

Media caption, 0-1024 characters after entities parsing

+
string

Mode for parsing entities in the media caption
See formatting options for more details.

+
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
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
object (ReplyParameters)

Description of the message to reply to

+
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_photo

Use this method to send photos

+
Request Body schema: application/json
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
Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data
The photo must be at most 10 MB in size
The photo's width and height must not exceed 10000 in total
Width and height ratio must be at most 20
More information on Sending Files »

+
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
See formatting options for more details.

+
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
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_poll

Use this method to send a native poll

+
Request Body schema: application/json
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
See formatting options for more details
Currently, only custom emoji entities are allowed

+
Array of objects (MessageEntity)

A JSON-serialized list of special entities that appear in the poll question
It can be specified instead of question_parse_mode

+
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
See formatting options for more details.

+
Array of objects (MessageEntity)

A JSON-serialized list of special entities that appear in the poll explanation
It can be specified instead of explanation_parse_mode

+
open_period
number

Amount of time in seconds the poll will be active after creation, 5-600
Can't be used together with close_date.

+
close_date
number

Point in time (Unix timestamp) when the poll will be automatically closed
Must be at least 5 and no more than 600 seconds in the future
Can't be used together with open_period.

+
is_closed
boolean

Pass True if the poll needs to be immediately closed
This can be useful for poll preview.

+
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_venue

Use this method to send information about a venue

+
Request Body schema: application/json
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
(For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)

+
google_place_id
string

Google Places identifier of the venue

+
google_place_type
string

Google Places type of the venue
(See supported types.)

+
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_video

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.

+
Request Body schema: application/json
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
Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data
More information on Sending Files »

+
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
The thumbnail should be in JPEG format and less than 200 kB in size
A thumbnail's width and height should not exceed 320
Ignored if the file is not uploaded using multipart/form-data
Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
More information on Sending Files »

+
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
See formatting options for more details.

+
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
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_video_note

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

+
Request Body schema: application/json
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
Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data
More information on Sending Files »
Sending video notes by a URL is currently unsupported

+
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
diameter of the video message

+
InputFile (string) or string

Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side
The thumbnail should be in JPEG format and less than 200 kB in size
A thumbnail's width and height should not exceed 320
Ignored if the file is not uploaded using multipart/form-data
Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>
More information on Sending Files »

+
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

send_voice

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.

+
Request Body schema: application/json
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
Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data
More information on Sending Files »

+
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
See formatting options for more details.

+
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
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

set_chat_administrator_custom_title

Use this method to set a custom title for an administrator in a supergroup promoted by the bot

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

set_chat_description

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

set_chat_menu_button

Use this method to change the bot's menu button in a private chat, or the default menu button

+
Request Body schema: application/json
chat_id
number

Unique identifier for the target private chat
If not specified, default bot's menu button will be changed

+
object or object or object (MenuButton)

Responses

Response samples

Content type
application/json
"boolean"

set_chat_permissions

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

+
Request Body schema: application/json
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
Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.

+

Responses

Response samples

Content type
application/json
"boolean"

set_chat_photo

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

set_chat_sticker_set

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

set_chat_title

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

set_message_reaction

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

+
Request Body schema: application/json
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
If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead.

+
Array of ReactionTypeEmoji (object) or ReactionTypeCustomEmoji (object) or ReactionTypePaid (object) (ReactionType)

A JSON-serialized list of reaction types to set on the message
Currently, as non-premium users, bots can set up to one reaction per message
A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators
Paid reactions can't be used by bots.

+
is_big
boolean

Pass True to set the reaction with a big animation

+

Responses

Response samples

Content type
application/json
"boolean"

set_my_commands

Use this method to change the list of the bot's commands
See this manual for more details about bot commands

+
Request Body schema: application/json
required
Array of objects (BotCommand)

A JSON-serialized list of bot commands to be set as the list of the bot's commands
At most 100 commands can be specified.

+
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
If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands

+

Responses

Response samples

Content type
application/json
"boolean"

set_my_default_administrator_rights

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

+
Request Body schema: application/json
object (ChatAdministratorRights)

A JSON-serialized object describing new default administrator rights
If not specified, the default administrator rights will be cleared.

+
for_channels
boolean

Pass True to change the default administrator rights of the bot in channels
Otherwise, the default administrator rights of the bot for groups and supergroups will be changed.

+

Responses

Response samples

Content type
application/json
"boolean"

set_my_description

Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty

+
Request Body schema: application/json
description
string

New bot description; 0-512 characters
Pass an empty string to remove the dedicated description for the given language.

+
language_code
string

A two-letter ISO 639-1 language code
If empty, the description will be applied to all users for whose language there is no dedicated description.

+

Responses

Response samples

Content type
application/json
"boolean"

set_my_name

Use this method to change the bot's name

+
Request Body schema: application/json
name
string

New bot name; 0-64 characters
Pass an empty string to remove the dedicated name for the given language.

+
language_code
string

A two-letter ISO 639-1 language code
If empty, the name will be shown to all users for whose language there is no dedicated name.

+

Responses

Response samples

Content type
application/json
"boolean"

set_my_short_description

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

+
Request Body schema: application/json
short_description
string

New short description for the bot; 0-120 characters
Pass an empty string to remove the dedicated short description for the given language.

+
language_code
string

A two-letter ISO 639-1 language code
If empty, the short description will be applied to all users for whose language there is no dedicated short description.

+

Responses

Response samples

Content type
application/json
"boolean"

set_user_emoji_status

Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess

+
Request Body schema: application/json
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
Pass an empty string to remove the status.

+
emoji_status_expiration_date
number

Expiration date of the emoji status, if any

+

Responses

Response samples

Content type
application/json
"boolean"

unban_chat_member

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

unban_chat_sender_chat

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

unhide_general_forum_topic

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

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

+

Responses

Response samples

Content type
application/json
"boolean"

unpin_all_chat_messages

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

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

+

Responses

Response samples

Content type
application/json
"boolean"

unpin_all_forum_topic_messages

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

unpin_all_general_forum_topic_messages

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

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

+

Responses

Response samples

Content type
application/json
"boolean"

unpin_chat_message

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

+
Request Body schema: application/json
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
Required if business_connection_id is specified
If not specified, the most recent pinned message (by sending date) will be unpinned.

+

Responses

Response samples

Content type
application/json
"boolean"

games

get_game_high_scores

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
+" class="sc-dODueM sc-eHKghg fhLETC hIcgHh">

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.

-
Request Body schema: application/json
user_id
required
number

Target user id

-
chat_id
number

Required if inline_message_id is not specified
Unique identifier for the target chat

-
message_id
number

Required if inline_message_id is not specified
Identifier of the sent message

-
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

-

Responses

Response samples

Content type
application/json
"GameHighScore[]"

send_game

Use this method to send a game

-
Request Body schema: application/json
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
Set up your games via @BotFather.

-
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
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
object (InlineKeyboardMarkup)

Responses

Response samples

Content type
application/json
"Message"

set_game_score

Use this method to set the score of the specified user in a game message

-
Request Body schema: application/json
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
This can be useful when fixing mistakes or banning cheaters

-
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
Unique identifier for the target chat

-
message_id
number

Required if inline_message_id is not specified
Identifier of the sent message

-
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

-

Responses

Response samples

Content type
application/json
"Message | boolean"

getting-updates

delete_webhook

Use this method to remove webhook integration if you decide to switch back to getUpdates

-
Request Body schema: application/json
drop_pending_updates
boolean

Pass True to drop all pending updates

-

Responses

Response samples

Content type
application/json
"boolean"

get_updates

Use this method to receive incoming updates using long polling (wiki)

-
Request Body schema: application/json
offset
number

Identifier of the first update to be returned
Must be greater by one than the highest among the identifiers of previously received updates
By default, updates starting with the earliest unconfirmed update are returned
An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id
The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue
All previous updates will be forgotten.

-
limit
number

Limits the number of updates to be retrieved
Values between 1-100 are accepted
Defaults to 100.

-
timeout
number

Timeout in seconds for long polling
Defaults to 0, i.e
usual short polling
Should be positive, short polling should be used for testing purposes only.

-
allowed_updates
Array of strings

A JSON-serialized list of the update types you want your bot to receive
For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types
See Update for a complete list of available update types
Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default)
If not specified, the previous setting will be used
.


Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.

-

Responses

Response samples

Content type
application/json
"Update[]"

get_webhook_info

Use this method to get current webhook status
Requires no parameters
If the bot is using getUpdates, will return an object with the url field empty.

-
Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
"WebhookInfo"

set_webhook

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, we will 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.

-
Request Body schema: application/json
url
required
string

HTTPS URL to send updates to
Use an empty string to remove webhook integration

-
certificate
string <binary> (InputFile)
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
Defaults to 40
Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.

-
allowed_updates
Array of strings

A JSON-serialized list of the update types you want your bot to receive
For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types
See Update for a complete list of available update types
Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default)
If not specified, the previous setting will be used
.

Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.

-
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
Only characters A-Z, a-z, 0-9, _ and - are allowed
The header is useful to ensure that the request comes from a webhook set by you.

-

Responses

Response samples

Content type
application/json
"boolean"

inline-mode

answer_inline_query

Use this method to send answers to an inline query
.
No more than 50 results per query are allowed.

-
Request Body schema: application/json
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
Defaults to 300.

-
is_personal
boolean

Pass True if results may be cached on the server side only for the user that sent the query
By default, results may be returned to any user who sends the same query.

-
next_offset
string

Pass the offset that a client should send in the next query with the same text to receive more results
Pass an empty string if there are no more results or if you don't support pagination
Offset length can't exceed 64 bytes.

-
object (InlineQueryResultsButton)

Responses

Response samples

Content type
application/json
"boolean"

answer_web_app_query

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

-
Request Body schema: application/json
web_app_query_id
required
string

Unique identifier for the query to be answered

-
required
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)

Responses

Response samples

Content type
application/json
"SentWebAppMessage"

save_prepared_inline_message

Stores a message that can be sent by a user of a Mini App

-
Request Body schema: application/json
user_id
required
number

Unique identifier of the target user that can use the prepared message

-
required
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)
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

-

Responses

Response samples

Content type
application/json
"PreparedInlineMessage"

payments

answer_pre_checkout_query

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.

-
Request Body schema: application/json
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
Use False if there are any problems.

-
error_message
string

Required if ok is False
Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g
"Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details
Please choose a different color or garment!")
Telegram will display this message to the user.

-

Responses

Response samples

Content type
application/json
"boolean"

answer_shipping_query

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

-
Request Body schema: application/json
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
A JSON-serialized array of available shipping options.

-
error_message
string

Required if ok is False
Error message in human readable form that explains why it is impossible to complete the order (e.g
"Sorry, delivery to your desired address is unavailable')
Telegram will display this message to the user.

-

Responses

Response samples

Content type
application/json
"boolean"

create_invoice_link

Use this method to create a link for an invoice

-
Request Body schema: application/json
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
This will not be displayed to the user, use it for your internal processes.

-
currency
required
string

Three-letter ISO 4217 currency code, see more on currencies
Pass “XTR” for payments in Telegram Stars.

-
required
Array of objects (LabeledPrice)

Price breakdown, a JSON-serialized list of components (e.g
product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
Must contain exactly one item for payments in Telegram Stars.

-
business_connection_id
string

Unique identifier of the business connection on behalf of which the link will be created
For payments in Telegram Stars only.

-
provider_token
string

Payment provider token, obtained via @BotFather
Pass an empty string for payments in Telegram Stars.

-
subscription_period
number

The number of seconds the subscription will be active for before the next payment
The currency must be set to “XTR” (Telegram Stars) if the parameter is used
Currently, it must always be 2592000 (30 days) if specified
Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user
Subscription price must no exceed 2500 Telegram Stars.

-
max_tip_amount
number

The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double)
For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145
See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)
Defaults to 0
Not supported for payments in Telegram Stars.

-
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)
At most 4 suggested tip amounts can be specified
The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

-
provider_data
string

JSON-serialized data about the invoice, which will be shared with the payment provider
A detailed description of required fields should be provided by the payment provider.

-
photo_url
string

URL of the product photo for the invoice
Can be a photo of the goods or a marketing image for a service.

-
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
Ignored for payments in Telegram Stars.

-
need_phone_number
boolean

Pass True if you require the user's phone number to complete the order
Ignored for payments in Telegram Stars.

-
need_email
boolean

Pass True if you require the user's email address to complete the order
Ignored for payments in Telegram Stars.

-
need_shipping_address
boolean

Pass True if you require the user's shipping address to complete the order
Ignored for payments in Telegram Stars.

-
send_phone_number_to_provider
boolean

Pass True if the user's phone number should be sent to the provider
Ignored for payments in Telegram Stars.

-
send_email_to_provider
boolean

Pass True if the user's email address should be sent to the provider
Ignored for payments in Telegram Stars.

-
is_flexible
boolean

Pass True if the final price depends on the shipping method
Ignored for payments in Telegram Stars.

-

Responses

Response samples

Content type
application/json
"string"

edit_user_star_subscription

Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars

-
Request Body schema: application/json
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
Pass False to allow the user to re-enable a subscription that was previously canceled by the bot.

-

Responses

Response samples

Content type
application/json
"boolean"

get_star_transactions

Returns the bot's Telegram Star transactions in chronological order

-
Request Body schema: application/json
offset
number

Number of transactions to skip in the response

-
limit
number

The maximum number of transactions to be retrieved
Values between 1-100 are accepted
Defaults to 100.

-

Responses

Response samples

Content type
application/json
"StarTransactions"

refund_star_payment

Refunds a successful payment in Telegram Stars

-
Request Body schema: application/json
user_id
required
number

Identifier of the user whose payment will be refunded

-
telegram_payment_charge_id
required
string

Telegram payment identifier

-

Responses

Response samples

Content type
application/json
"boolean"

send_invoice

Use this method to send invoices

-
Request Body schema: application/json
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
This will not be displayed to the user, use it for your internal processes.

-
currency
required
string

Three-letter ISO 4217 currency code, see more on currencies
Pass “XTR” for payments in Telegram Stars.

-
required
Array of objects (LabeledPrice)

Price breakdown, a JSON-serialized list of components (e.g
product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
Must contain exactly one item for payments in Telegram Stars.

-
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
Pass an empty string for payments in Telegram Stars.

-
max_tip_amount
number

The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double)
For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145
See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)
Defaults to 0
Not supported for payments in Telegram Stars.

-
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)
At most 4 suggested tip amounts can be specified
The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

-
start_parameter
string

Unique deep-linking parameter
If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice
If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter

-
provider_data
string

JSON-serialized data about the invoice, which will be shared with the payment provider
A detailed description of required fields should be provided by the payment provider.

-
photo_url
string

URL of the product photo for the invoice
Can be a photo of the goods or a marketing image for a service
People like it better when they see what they are paying for.

-
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
Ignored for payments in Telegram Stars.

-
need_phone_number
boolean

Pass True if you require the user's phone number to complete the order
Ignored for payments in Telegram Stars.

-
need_email
boolean

Pass True if you require the user's email address to complete the order
Ignored for payments in Telegram Stars.

-
need_shipping_address
boolean

Pass True if you require the user's shipping address to complete the order
Ignored for payments in Telegram Stars.

-
send_phone_number_to_provider
boolean

Pass True if the user's phone number should be sent to the provider
Ignored for payments in Telegram Stars.

-
send_email_to_provider
boolean

Pass True if the user's email address should be sent to the provider
Ignored for payments in Telegram Stars.

-
is_flexible
boolean

Pass True if the final price depends on the shipping method
Ignored for payments in Telegram Stars.

-
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
object (InlineKeyboardMarkup)

Responses

Response samples

Content type
application/json
"Message"

stickers

add_sticker_to_set

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

-
Request Body schema: application/json
user_id
required
number

User identifier of sticker set owner

-
name
required
string

Sticker set name

-
required
object (InputSticker)

Responses

Response samples

Content type
application/json
"boolean"

create_new_sticker_set

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

-
Request Body schema: application/json
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)
Can contain only English letters, digits and underscores
Must begin with a letter, can't contain consecutive underscores and must end in "by<bot_username>"
<bot_username> is case insensitive
1-64 characters.

-
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”
By default, a regular sticker set is created.

-
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

-

Responses

Response samples

Content type
application/json
"boolean"

delete_sticker_from_set

Use this method to delete a sticker from a set created by the bot

-
Request Body schema: application/json
sticker
required
string

File identifier of the sticker

-

Responses

Response samples

Content type
application/json
"boolean"

delete_sticker_set

Use this method to delete a sticker set that was created by the bot

-
Request Body schema: application/json
name
required
string

Sticker set name

-

Responses

Response samples

Content type
application/json
"boolean"

get_available_gifts

Returns the list of gifts that can be sent by the bot to users
Requires no parameters

-
Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
"Gifts"

get_custom_emoji_stickers

Use this method to get information about custom emoji stickers by their identifiers

-
Request Body schema: application/json
custom_emoji_ids
required
Array of strings

A JSON-serialized list of custom emoji identifiers
At most 200 custom emoji identifiers can be specified.

-

Responses

Response samples

Content type
application/json
"Sticker[]"

get_sticker_set

Use this method to get a sticker set

-
Request Body schema: application/json
name
required
string

Name of the sticker set

-

Responses

Response samples

Content type
application/json
"StickerSet"

replace_sticker_in_set

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

-
Request Body schema: application/json
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)

Responses

Response samples

Content type
application/json
"boolean"

send_gift

Sends a gift to the given user
The gift can't be converted to Telegram Stars by the user

-
Request Body schema: application/json
user_id
required
number

Unique identifier of the target user that will receive the gift

-
gift_id
required
string

Identifier of the gift

-
text
string

Text that will be shown along with the gift; 0-255 characters

-
text_parse_mode
string

Mode for parsing entities in the text
See formatting options for more details
Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.

-
Array of objects (MessageEntity)

A JSON-serialized list of special entities that appear in the gift text
It can be specified instead of text_parse_mode
Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.

-

Responses

Response samples

Content type
application/json
"boolean"

send_sticker

Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers

-
Request Body schema: application/json
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
Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data
More information on Sending Files »
Video and animated stickers can't be sent via an HTTP URL.

-
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
Users will receive a notification with no sound.

-
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
The relevant Stars will be withdrawn from the bot's balance

-
message_effect_id
string

Unique identifier of the message effect to be added to the message; for private chats only

-
object (ReplyParameters)
InlineKeyboardMarkup (object) or ReplyKeyboardMarkup (object) or ReplyKeyboardRemove (object) or ForceReply (object)

Additional interface options
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

-

Responses

Response samples

Content type
application/json
"Message"

set_custom_emoji_sticker_set_thumbnail

Use this method to set the thumbnail of a custom emoji sticker set

-
Request Body schema: application/json
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.

-

Responses

Response samples

Content type
application/json
"boolean"

set_sticker_emoji_list

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

set_sticker_keywords

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

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

set_sticker_mask_position

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

-
Request Body schema: application/json
sticker
required
string

File identifier of the sticker

-
object (MaskPosition)

Responses

Response samples

Content type
application/json
"boolean"

set_sticker_position_in_set

Use this method to move a sticker in a set created by the bot to a specific position

-
Request Body schema: application/json
sticker
required
string

File identifier of the sticker

-
position
required
number

New sticker position in the set, zero-based

-

Responses

Response samples

Content type
application/json
"boolean"

set_sticker_set_thumbnail

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

-
Request Body schema: application/json
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
Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data
More information on Sending Files »
Animated and video sticker set thumbnails can't be uploaded via HTTP URL
If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.

-

Responses

Response samples

Content type
application/json
"boolean"

set_sticker_set_title

Use this method to set the title of a created sticker set

-
Request Body schema: application/json
name
required
string

Sticker set name

-
title
required
string

Sticker set title, 1-64 characters

-

Responses

Response samples

Content type
application/json
"boolean"

upload_sticker_file

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)

-
Request Body schema: application/json
user_id
required
number

User identifier of sticker file owner

-
sticker
required
string <binary> (InputFile)
sticker_format
required
string
Enum: "static" "animated" "video"

Format of the sticker, must be one of “static”, “animated”, “video”

-

Responses

Response samples

Content type
application/json
"File"

telegram-passport

set_passport_data_errors

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.

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

updating-messages

delete_message

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
.

-
Request Body schema: application/json
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

-

Responses

Response samples

Content type
application/json
"boolean"

delete_messages

Use this method to delete multiple messages simultaneously
If some of the specified messages can't be found, they are skipped

-
Request Body schema: application/json
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
See deleteMessage for limitations on which messages can be deleted

-

Responses

Response samples

Content type
application/json
"boolean"

edit_message_caption

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.

-
Request Body schema: application/json
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
Unique identifier for the target chat or username of the target channel (in the format @channelusername)

-
message_id
number

Required if inline_message_id is not specified
Identifier of the message to edit

-
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

-
caption
string

New caption of the message, 0-1024 characters after entities parsing

-
parse_mode
string

Mode for parsing entities in the message caption
See formatting options for more details.

-
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
Supported only for animation, photo and video messages.

-
object (InlineKeyboardMarkup)

Responses

Response samples

Content type
application/json
"Message | boolean"

edit_message_live_location

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

-
Request Body schema: application/json
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
Unique identifier for the target chat or username of the target channel (in the format @channelusername)

-
message_id
number

Required if inline_message_id is not specified
Identifier of the message to edit

-
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

-
live_period
number

New period in seconds during which the location can be updated, starting from the message send date
If 0x7FFFFFFF is specified, then the location can be updated forever
Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days
If not specified, then live_period remains unchanged

-
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
Must be between 1 and 360 if specified.

-
proximity_alert_radius
number

The maximum distance for proximity alerts about approaching another chat member, in meters
Must be between 1 and 100000 if specified.

-
object (InlineKeyboardMarkup)

Responses

Response samples

Content type
application/json
"Message | boolean"

edit_message_media

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.

-
Request Body schema: application/json
required
InputMediaAnimation (object) or InputMediaDocument (object) or InputMediaAudio (object) or InputMediaPhoto (object) or InputMediaVideo (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
Unique identifier for the target chat or username of the target channel (in the format @channelusername)

-
message_id
number

Required if inline_message_id is not specified
Identifier of the message to edit

-
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

-
object (InlineKeyboardMarkup)

Responses

Response samples

Content type
application/json
"Message | boolean"

edit_message_reply_markup

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.

-
Request Body schema: application/json
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
Unique identifier for the target chat or username of the target channel (in the format @channelusername)

-
message_id
number

Required if inline_message_id is not specified
Identifier of the message to edit

-
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

-
object (InlineKeyboardMarkup)

Responses

Response samples

Content type
application/json
"Message | boolean"

edit_message_text

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.

-
Request Body schema: application/json
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
Unique identifier for the target chat or username of the target channel (in the format @channelusername)

-
message_id
number

Required if inline_message_id is not specified
Identifier of the message to edit

-
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

-
parse_mode
string

Mode for parsing entities in the message text
See formatting options for more details.

-
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)
object (InlineKeyboardMarkup)

Responses

Response samples

Content type
application/json
"Message | boolean"

stop_message_live_location

Use this method to stop updating a live location message before live_period expires

-
Request Body schema: application/json
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
Unique identifier for the target chat or username of the target channel (in the format @channelusername)

-
message_id
number

Required if inline_message_id is not specified
Identifier of the message with live location to stop

-
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

-
object (InlineKeyboardMarkup)

Responses

Response samples

Content type
application/json
"Message | boolean"

stop_poll

Use this method to stop a poll which was sent by the bot

-
Request Body schema: application/json
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)

Responses

Response samples

Content type
application/json
"Poll"
+
Request Body schema: application/json
user_id
required
number

Target user id

+
chat_id
number

Required if inline_message_id is not specified
Unique identifier for the target chat

+
message_id
number

Required if inline_message_id is not specified
Identifier of the sent message

+
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

+

Responses

Response samples

Content type
application/json
"GameHighScore[]"

send_game

Use this method to send a game

+
Request Body schema: application/json
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
Set up your games via @BotFather.

+
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
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
If empty, one 'Play game_title' button will be shown
If not empty, the first button must launch the game.

+

Responses

Response samples

Content type
application/json
"Message"

set_game_score

Use this method to set the score of the specified user in a game message

+
Request Body schema: application/json
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
This can be useful when fixing mistakes or banning cheaters

+
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
Unique identifier for the target chat

+
message_id
number

Required if inline_message_id is not specified
Identifier of the sent message

+
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

+

Responses

Response samples

Content type
application/json
"Message | boolean"

getting-updates

delete_webhook

Use this method to remove webhook integration if you decide to switch back to getUpdates

+
Request Body schema: application/json
drop_pending_updates
boolean

Pass True to drop all pending updates

+

Responses

Response samples

Content type
application/json
"boolean"

get_updates

Use this method to receive incoming updates using long polling (wiki)

+
Request Body schema: application/json
offset
number

Identifier of the first update to be returned
Must be greater by one than the highest among the identifiers of previously received updates
By default, updates starting with the earliest unconfirmed update are returned
An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id
The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue
All previous updates will be forgotten.

+
limit
number

Limits the number of updates to be retrieved
Values between 1-100 are accepted
Defaults to 100.

+
timeout
number

Timeout in seconds for long polling
Defaults to 0, i.e
usual short polling
Should be positive, short polling should be used for testing purposes only.

+
allowed_updates
Array of strings

A JSON-serialized list of the update types you want your bot to receive
For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types
See Update for a complete list of available update types
Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default)
If not specified, the previous setting will be used
.
Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.

+

Responses

Response samples

Content type
application/json
"Update[]"

get_webhook_info

Use this method to get current webhook status
Requires no parameters
If the bot is using getUpdates, will return an object with the url field empty.

+
Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
"WebhookInfo"

set_webhook

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.

+
Request Body schema: application/json
url
required
string

HTTPS URL to send updates to
Use an empty string to remove webhook integration

+
certificate
string <binary> (InputFile)

Upload your public key certificate so that the root certificate in use can be checked
See our self-signed guide for details.

+
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
Defaults to 40
Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.

+
allowed_updates
Array of strings

A JSON-serialized list of the update types you want your bot to receive
For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types
See Update for a complete list of available update types
Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default)
If not specified, the previous setting will be used
.
Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.

+
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
Only characters A-Z, a-z, 0-9, _ and - are allowed
The header is useful to ensure that the request comes from a webhook set by you.

+

Responses

Response samples

Content type
application/json
"boolean"

inline-mode

answer_inline_query

Use this method to send answers to an inline query
.
No more than 50 results per query are allowed.

+
Request Body schema: application/json
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
Defaults to 300.

+
is_personal
boolean

Pass True if results may be cached on the server side only for the user that sent the query
By default, results may be returned to any user who sends the same query.

+
next_offset
string

Pass the offset that a client should send in the next query with the same text to receive more results
Pass an empty string if there are no more results or if you don't support pagination
Offset length can't exceed 64 bytes.

+
object (InlineQueryResultsButton)

A JSON-serialized object describing a button to be shown above inline query results

+

Responses

Response samples

Content type
application/json
"boolean"

answer_web_app_query

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

+
Request Body schema: application/json
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)

Responses

Response samples

Content type
application/json
"SentWebAppMessage"

save_prepared_inline_message

Stores a message that can be sent by a user of a Mini App

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"PreparedInlineMessage"

payments

answer_pre_checkout_query

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.

+
Request Body schema: application/json
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
Use False if there are any problems.

+
error_message
string

Required if ok is False
Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g
"Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details
Please choose a different color or garment!")
Telegram will display this message to the user.

+

Responses

Response samples

Content type
application/json
"boolean"

answer_shipping_query

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

+
Request Body schema: application/json
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
A JSON-serialized array of available shipping options.

+
error_message
string

Required if ok is False
Error message in human readable form that explains why it is impossible to complete the order (e.g
“Sorry, delivery to your desired address is unavailable”)
Telegram will display this message to the user.

+

Responses

Response samples

Content type
application/json
"boolean"

create_invoice_link

Use this method to create a link for an invoice

+
Request Body schema: application/json
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
This will not be displayed to the user, use it for your internal processes.

+
currency
required
string

Three-letter ISO 4217 currency code, see more on currencies
Pass “XTR” for payments in Telegram Stars.

+
required
Array of objects (LabeledPrice)

Price breakdown, a JSON-serialized list of components (e.g
product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
Must contain exactly one item for payments in Telegram Stars.

+
business_connection_id
string

Unique identifier of the business connection on behalf of which the link will be created
For payments in Telegram Stars only.

+
provider_token
string

Payment provider token, obtained via @BotFather
Pass an empty string for payments in Telegram Stars.

+
subscription_period
number

The number of seconds the subscription will be active for before the next payment
The currency must be set to “XTR” (Telegram Stars) if the parameter is used
Currently, it must always be 2592000 (30 days) if specified
Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user
Subscription price must no exceed 2500 Telegram Stars.

+
max_tip_amount
number

The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double)
For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145
See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)
Defaults to 0
Not supported for payments in Telegram Stars.

+
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)
At most 4 suggested tip amounts can be specified
The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

+
provider_data
string

JSON-serialized data about the invoice, which will be shared with the payment provider
A detailed description of required fields should be provided by the payment provider.

+
photo_url
string

URL of the product photo for the invoice
Can be a photo of the goods or a marketing image for a service.

+
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
Ignored for payments in Telegram Stars.

+
need_phone_number
boolean

Pass True if you require the user's phone number to complete the order
Ignored for payments in Telegram Stars.

+
need_email
boolean

Pass True if you require the user's email address to complete the order
Ignored for payments in Telegram Stars.

+
need_shipping_address
boolean

Pass True if you require the user's shipping address to complete the order
Ignored for payments in Telegram Stars.

+
send_phone_number_to_provider
boolean

Pass True if the user's phone number should be sent to the provider
Ignored for payments in Telegram Stars.

+
send_email_to_provider
boolean

Pass True if the user's email address should be sent to the provider
Ignored for payments in Telegram Stars.

+
is_flexible
boolean

Pass True if the final price depends on the shipping method
Ignored for payments in Telegram Stars.

+

Responses

Response samples

Content type
application/json
"string"

edit_user_star_subscription

Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars

+
Request Body schema: application/json
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
Pass False to allow the user to re-enable a subscription that was previously canceled by the bot.

+

Responses

Response samples

Content type
application/json
"boolean"

get_star_transactions

Returns the bot's Telegram Star transactions in chronological order

+
Request Body schema: application/json
offset
number

Number of transactions to skip in the response

+
limit
number

The maximum number of transactions to be retrieved
Values between 1-100 are accepted
Defaults to 100.

+

Responses

Response samples

Content type
application/json
"StarTransactions"

refund_star_payment

Refunds a successful payment in Telegram Stars

+
Request Body schema: application/json
user_id
required
number

Identifier of the user whose payment will be refunded

+
telegram_payment_charge_id
required
string

Telegram payment identifier

+

Responses

Response samples

Content type
application/json
"boolean"

send_invoice

Use this method to send invoices

+
Request Body schema: application/json
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
This will not be displayed to the user, use it for your internal processes.

+
currency
required
string

Three-letter ISO 4217 currency code, see more on currencies
Pass “XTR” for payments in Telegram Stars.

+
required
Array of objects (LabeledPrice)

Price breakdown, a JSON-serialized list of components (e.g
product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
Must contain exactly one item for payments in Telegram Stars.

+
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
Pass an empty string for payments in Telegram Stars.

+
max_tip_amount
number

The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double)
For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145
See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)
Defaults to 0
Not supported for payments in Telegram Stars.

+
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)
At most 4 suggested tip amounts can be specified
The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

+
start_parameter
string

Unique deep-linking parameter
If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice
If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter

+
provider_data
string

JSON-serialized data about the invoice, which will be shared with the payment provider
A detailed description of required fields should be provided by the payment provider.

+
photo_url
string

URL of the product photo for the invoice
Can be a photo of the goods or a marketing image for a service
People like it better when they see what they are paying for.

+
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
Ignored for payments in Telegram Stars.

+
need_phone_number
boolean

Pass True if you require the user's phone number to complete the order
Ignored for payments in Telegram Stars.

+
need_email
boolean

Pass True if you require the user's email address to complete the order
Ignored for payments in Telegram Stars.

+
need_shipping_address
boolean

Pass True if you require the user's shipping address to complete the order
Ignored for payments in Telegram Stars.

+
send_phone_number_to_provider
boolean

Pass True if the user's phone number should be sent to the provider
Ignored for payments in Telegram Stars.

+
send_email_to_provider
boolean

Pass True if the user's email address should be sent to the provider
Ignored for payments in Telegram Stars.

+
is_flexible
boolean

Pass True if the final price depends on the shipping method
Ignored for payments in Telegram Stars.

+
disable_notification
boolean

Sends the message silently
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
If empty, one 'Pay total price' button will be shown
If not empty, the first button must be a Pay button.

+

Responses

Response samples

Content type
application/json
"Message"

stickers

add_sticker_to_set

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

+
Request Body schema: application/json
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
If exactly the same sticker had already been added to the set, then the set isn't changed.

+

Responses

Response samples

Content type
application/json
"boolean"

create_new_sticker_set

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

+
Request Body schema: application/json
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)
Can contain only English letters, digits and underscores
Must begin with a letter, can't contain consecutive underscores and must end in "by<bot_username>"
<bot_username> is case insensitive
1-64 characters.

+
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”
By default, a regular sticker set is created.

+
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

+

Responses

Response samples

Content type
application/json
"boolean"

delete_sticker_from_set

Use this method to delete a sticker from a set created by the bot

+
Request Body schema: application/json
sticker
required
string

File identifier of the sticker

+

Responses

Response samples

Content type
application/json
"boolean"

delete_sticker_set

Use this method to delete a sticker set that was created by the bot

+
Request Body schema: application/json
name
required
string

Sticker set name

+

Responses

Response samples

Content type
application/json
"boolean"

get_available_gifts

Returns the list of gifts that can be sent by the bot to users
Requires no parameters

+
Request Body schema: application/json
Schema not provided

Responses

Response samples

Content type
application/json
"Gifts"

get_custom_emoji_stickers

Use this method to get information about custom emoji stickers by their identifiers

+
Request Body schema: application/json
custom_emoji_ids
required
Array of strings

A JSON-serialized list of custom emoji identifiers
At most 200 custom emoji identifiers can be specified.

+

Responses

Response samples

Content type
application/json
"Sticker[]"

get_sticker_set

Use this method to get a sticker set

+
Request Body schema: application/json
name
required
string

Name of the sticker set

+

Responses

Response samples

Content type
application/json
"StickerSet"

remove_chat_verification

Removes verification from a chat that is currently verified on behalf of the organization represented by the bot

+
Request Body schema: application/json
required
number or string

Unique identifier for the target chat or username of the target channel (in the format @channelusername)

+

Responses

Response samples

Content type
application/json
"boolean"

remove_user_verification

Removes verification from a user who is currently verified on behalf of the organization represented by the bot

+
Request Body schema: application/json
user_id
required
number

Unique identifier of the target user

+

Responses

Response samples

Content type
application/json
"boolean"

replace_sticker_in_set

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

+
Request Body schema: application/json
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
If exactly the same sticker had already been added to the set, then the set remains unchanged.

+

Responses

Response samples

Content type
application/json
"boolean"

send_gift

Sends a gift to the given user
The gift can't be converted to Telegram Stars by the user

+
Request Body schema: application/json
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
See formatting options for more details
Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.

+
Array of objects (MessageEntity)

A JSON-serialized list of special entities that appear in the gift text
It can be specified instead of text_parse_mode
Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.

+

Responses

Response samples

Content type
application/json
"boolean"

send_sticker

Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers

+
Request Body schema: application/json
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
Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data
More information on Sending Files »
Video and animated stickers can't be sent via an HTTP URL.

+
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
Users will receive a notification with no sound.

+
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
The relevant Stars will be withdrawn from the bot's balance

+
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
A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user

+

Responses

Response samples

Content type
application/json
"Message"

set_custom_emoji_sticker_set_thumbnail

Use this method to set the thumbnail of a custom emoji sticker set

+
Request Body schema: application/json
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.

+

Responses

Response samples

Content type
application/json
"boolean"

set_sticker_emoji_list

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

set_sticker_keywords

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

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

set_sticker_mask_position

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

+
Request Body schema: application/json
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
Omit the parameter to remove the mask position.

+

Responses

Response samples

Content type
application/json
"boolean"

set_sticker_position_in_set

Use this method to move a sticker in a set created by the bot to a specific position

+
Request Body schema: application/json
sticker
required
string

File identifier of the sticker

+
position
required
number

New sticker position in the set, zero-based

+

Responses

Response samples

Content type
application/json
"boolean"

set_sticker_set_thumbnail

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

+
Request Body schema: application/json
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
Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data
More information on Sending Files »
Animated and video sticker set thumbnails can't be uploaded via HTTP URL
If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.

+

Responses

Response samples

Content type
application/json
"boolean"

set_sticker_set_title

Use this method to set the title of a created sticker set

+
Request Body schema: application/json
name
required
string

Sticker set name

+
title
required
string

Sticker set title, 1-64 characters

+

Responses

Response samples

Content type
application/json
"boolean"

upload_sticker_file

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)

+
Request Body schema: application/json
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
See https://core.telegram.org/stickers for technical requirements
More information on Sending Files »

+
sticker_format
required
string
Enum: "static" "animated" "video"

Format of the sticker, must be one of “static”, “animated”, “video”

+

Responses

Response samples

Content type
application/json
"File"

verify_chat

Verifies a chat on behalf of the organization which is represented by the bot

+
Request Body schema: application/json
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
Must be empty if the organization isn't allowed to provide a custom verification description.

+

Responses

Response samples

Content type
application/json
"boolean"

verify_user

Verifies a user on behalf of the organization which is represented by the bot

+
Request Body schema: application/json
user_id
required
number

Unique identifier of the target user

+
custom_description
string

Custom description for the verification; 0-70 characters
Must be empty if the organization isn't allowed to provide a custom verification description.

+

Responses

Response samples

Content type
application/json
"boolean"

telegram-passport

set_passport_data_errors

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.

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

updating-messages

delete_message

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
.

+
Request Body schema: application/json
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

+

Responses

Response samples

Content type
application/json
"boolean"

delete_messages

Use this method to delete multiple messages simultaneously
If some of the specified messages can't be found, they are skipped

+
Request Body schema: application/json
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
See deleteMessage for limitations on which messages can be deleted

+

Responses

Response samples

Content type
application/json
"boolean"

edit_message_caption

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.

+
Request Body schema: application/json
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
Unique identifier for the target chat or username of the target channel (in the format @channelusername)

+
message_id
number

Required if inline_message_id is not specified
Identifier of the message to edit

+
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

+
caption
string

New caption of the message, 0-1024 characters after entities parsing

+
string

Mode for parsing entities in the message caption
See formatting options for more details.

+
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
Supported only for animation, photo and video messages.

+
object (InlineKeyboardMarkup)

A JSON-serialized object for an inline keyboard.

+

Responses

Response samples

Content type
application/json
"Message | boolean"

edit_message_live_location

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

+
Request Body schema: application/json
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
Unique identifier for the target chat or username of the target channel (in the format @channelusername)

+
message_id
number

Required if inline_message_id is not specified
Identifier of the message to edit

+
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

+
live_period
number

New period in seconds during which the location can be updated, starting from the message send date
If 0x7FFFFFFF is specified, then the location can be updated forever
Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days
If not specified, then live_period remains unchanged

+
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
Must be between 1 and 360 if specified.

+
proximity_alert_radius
number

The maximum distance for proximity alerts about approaching another chat member, in meters
Must be between 1 and 100000 if specified.

+
object (InlineKeyboardMarkup)

A JSON-serialized object for a new inline keyboard.

+

Responses

Response samples

Content type
application/json
"Message | boolean"

edit_message_media

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.

+
Request Body schema: application/json
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
Unique identifier for the target chat or username of the target channel (in the format @channelusername)

+
message_id
number

Required if inline_message_id is not specified
Identifier of the message to edit

+
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

+
object (InlineKeyboardMarkup)

A JSON-serialized object for a new inline keyboard.

+

Responses

Response samples

Content type
application/json
"Message | boolean"

edit_message_reply_markup

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.

+
Request Body schema: application/json
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
Unique identifier for the target chat or username of the target channel (in the format @channelusername)

+
message_id
number

Required if inline_message_id is not specified
Identifier of the message to edit

+
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

+
object (InlineKeyboardMarkup)

A JSON-serialized object for an inline keyboard.

+

Responses

Response samples

Content type
application/json
"Message | boolean"

edit_message_text

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.

+
Request Body schema: application/json
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
Unique identifier for the target chat or username of the target channel (in the format @channelusername)

+
message_id
number

Required if inline_message_id is not specified
Identifier of the message to edit

+
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

+
string

Mode for parsing entities in the message text
See formatting options for more details.

+
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.

+

Responses

Response samples

Content type
application/json
"Message | boolean"

stop_message_live_location

Use this method to stop updating a live location message before live_period expires

+
Request Body schema: application/json
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
Unique identifier for the target chat or username of the target channel (in the format @channelusername)

+
message_id
number

Required if inline_message_id is not specified
Identifier of the message with live location to stop

+
inline_message_id
string

Required if chat_id and message_id are not specified
Identifier of the inline message

+
object (InlineKeyboardMarkup)

A JSON-serialized object for a new inline keyboard.

+

Responses

Response samples

Content type
application/json
"Message | boolean"

stop_poll

Use this method to stop a poll which was sent by the bot

+
Request Body schema: application/json
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.

+

Responses

Response samples

Content type
application/json
"Poll"
- + + @@ -27,7 +27,11 @@

Telegram Bot Playground 🤖

> - diff --git a/makefile b/makefile index b73fd36..4dac282 100644 --- a/makefile +++ b/makefile @@ -2,4 +2,7 @@ build-tg: PROJECT=tg-bot-playground vite build dev: - PROJECT=tg-bot-playground vite \ No newline at end of file + PROJECT=tg-bot-playground vite + +gen-openapi-ui: + redocly build-docs --output=docs/telegram-bot-api/index.html diff --git a/redocly.yml b/redocly.yml new file mode 100644 index 0000000..ace4625 --- /dev/null +++ b/redocly.yml @@ -0,0 +1,11 @@ +extends: + - recommended + +apis: + telegram-bot: + root: ../tg-bot-client/openapi/openapi.yaml + +theme: + openapi: + hideRequestPayloadSample: true + sortTagsAlphabetically: true diff --git a/src/tg-bot-playground/index.html b/src/tg-bot-playground/index.html index 4e91ce7..de13487 100644 --- a/src/tg-bot-playground/index.html +++ b/src/tg-bot-playground/index.html @@ -27,7 +27,11 @@

Telegram Bot Playground 🤖

> - diff --git a/vite.config.ts b/vite.config.ts index acb2796..6e7c10f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,7 +12,7 @@ const configs: Record = { build: { emptyOutDir: true, outDir: "../../docs/telegram-bot-playground", - minify: false + minify: true } } }