Telegram Bot API

The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
To learn how to create and set up a bot, please consult our Introduction to Bots and Bot FAQ.

Recent changes

Subscribe to @BotNews to be the first to know about the latest updates and join the discussion in @BotTalk

August 15, 2025

Bot API 9.2

Checklists

  • Added the field checklist_task_id to the class ReplyParameters, allowing bots to reply to a specific checklist task.
  • Added the field reply_to_checklist_task_id to the class Message.

Gifts

  • Added the field publisher_chat to the classes Gift and UniqueGift which can be used to get information about the chat that published a gift.

Direct Messages in Channels

Suggested Posts

July 3, 2025

Bot API 9.1

Checklists

  • Added the class ChecklistTask representing a task in a checklist.
  • Added the class Checklist representing a checklist.
  • Added the class InputChecklistTask representing a task to add to a checklist.
  • Added the class InputChecklist representing a checklist to create.
  • Added the field checklist to the classes Message and ExternalReplyInfo, describing a checklist in a message.
  • Added the class ChecklistTasksDone and the field checklist_tasks_done to the class Message, describing a service message about status changes for tasks in a checklist (i.e., marked as done/not done).
  • Added the class ChecklistTasksAdded and the field checklist_tasks_added to the class Message, describing a service message about the addition of new tasks to a checklist.
  • Added the method sendChecklist, allowing bots to send a checklist on behalf of a business account.
  • Added the method editMessageChecklist, allowing bots to edit a checklist on behalf of a business account.

Gifts

General

  • Increased the maximum number of options in a poll to 12.
  • Added the method getMyStarBalance, allowing bots to get their current balance of Telegram Stars.
  • Added the class DirectMessagePriceChanged and the field direct_message_price_changed to the class Message, describing a service message about a price change for direct messages sent to the channel chat.
  • Added the method hideKeyboard to the class WebApp.

April 11, 2025

Bot API 9.0

Business Accounts

Mini Apps

  • Added the field DeviceStorage, allowing Mini Apps to use persistent local storage on the user's device.
  • Added the field SecureStorage, allowing Mini Apps to use a secure local storage on the user's device for sensitive data.

Gifts

Telegram Premium

  • Added the method giftPremiumSubscription, allowing bots to gift a user a Telegram Premium subscription paid in Telegram Stars.
  • Added the field premium_subscription_duration to the class TransactionPartnerUser for transactions involving a Telegram Premium subscription purchased by the bot.
  • Added the field transaction_type to the class TransactionPartnerUser, simplifying the differentiation and processing of all transaction types.

General

  • Increased the maximum price for paid media to 10000 Telegram Stars.
  • Increased the maximum price for a subscription period to 10000 Telegram Stars.
  • Added the class PaidMessagePriceChanged and the field paid_message_price_changed to the class Message, describing a service message about a price change for paid messages sent to the chat.
  • Added the field paid_star_count to the class Message, containing the number of Telegram Stars that were paid to send the message.

See earlier changes »

Authorizing your bot

Each bot is given a unique authentication token when it is created. The token looks something like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11, but we'll use simply <token> in this document instead. You can learn about obtaining tokens and generating new ones in this document.

Making requests

All queries to the Telegram Bot API must be served over HTTPS and need to be presented in this form: https://api.telegram.org/bot<token>/METHOD_NAME. Like this for example:

https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe

We support GET and POST HTTP methods. We support four ways of passing parameters in Bot API requests:

  • URL query string
  • application/x-www-form-urlencoded
  • application/json (except for uploading files)
  • multipart/form-data (use to upload files)

The response contains a JSON object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals True, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error.

  • All methods in the Bot API are case-insensitive.
  • All queries must be made using UTF-8.

Making requests when getting updates

If you're using webhooks, you can perform a request to the Bot API while sending an answer to the webhook. Use either application/json or application/x-www-form-urlencoded or multipart/form-data response content type for passing parameters. Specify the method to be invoked in the method parameter of the request. It's not possible to know that such a request was successful or get its result.

Please see our FAQ for examples.

Using a Local Bot API Server

The Bot API server source code is available at telegram-bot-api. You can run it locally and send the requests to your own server instead of https://api.telegram.org. If you switch to a local Bot API server, your bot will be able to:

  • Download files without a size limit.
  • Upload files up to 2000 MB.
  • Upload files using their local path and the file URI scheme.
  • Use an HTTP URL for the webhook.
  • Use any local IP address for the webhook.
  • Use any port for the webhook.
  • Set max_webhook_connections up to 100000.
  • Receive the absolute local path as a value of the file_path field without the need to download the file after a getFile request.

Do I need a Local Bot API Server

The majority of bots will be OK with the default configuration, running on our servers. But if you feel that you need one of these features, you're welcome to switch to your own at any time.

Getting updates

There are two mutually exclusive ways of receiving updates for your bot - the getUpdates method on one hand and webhooks on the other. Incoming updates are stored on the server until the bot receives them either way, but they will not be kept longer than 24 hours.

Regardless of which option you choose, you will receive JSON-serialized Update objects as a result.

Update

This object represents an incoming update.
At most one of the optional parameters can be present in any given update.

Field Type Description
update_id Integer The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.
message Message Optional. New incoming message of any kind - text, photo, sticker, etc.
edited_message Message Optional. New version of a message that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
channel_post Message Optional. New incoming channel post of any kind - text, photo, sticker, etc.
edited_channel_post Message Optional. New version of a channel post that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
business_connection BusinessConnection Optional. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot
business_message Message Optional. New message from a connected business account
edited_business_message Message Optional. New version of a message from a connected business account
deleted_business_messages BusinessMessagesDeleted Optional. Messages were deleted from a connected business account
message_reaction MessageReactionUpdated Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.
message_reaction_count MessageReactionCountUpdated Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with delay up to a few minutes.
inline_query InlineQuery Optional. New incoming inline query
chosen_inline_result ChosenInlineResult Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.
callback_query CallbackQuery Optional. New incoming callback query
shipping_query ShippingQuery Optional. New incoming shipping query. Only for invoices with flexible price
pre_checkout_query PreCheckoutQuery Optional. New incoming pre-checkout query. Contains full information about checkout
purchased_paid_media PaidMediaPurchased Optional. A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat
poll Poll Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot
poll_answer PollAnswer Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
my_chat_member ChatMemberUpdated Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
chat_member ChatMemberUpdated Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates.
chat_join_request ChatJoinRequest Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.
chat_boost ChatBoostUpdated Optional. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.
removed_chat_boost ChatBoostRemoved Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.

getUpdates

Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.

Parameter Type Required Description
offset Integer Optional 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 Integer Optional Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
timeout Integer Optional 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 String Optional 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.

Notes
1. This method will not work if an outgoing webhook is set up.
2. In order to avoid getting duplicate updates, recalculate offset after each server response.

setWebhook

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. Returns True on success.

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.

Parameter Type Required Description
url String Yes HTTPS URL to send updates to. Use an empty string to remove webhook integration
certificate InputFile Optional 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 Optional The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
max_connections Integer Optional 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 String Optional 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 Optional Pass True to drop all pending updates
secret_token String Optional 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.

Notes
1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.
2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.
3. Ports currently supported for webhooks: 443, 80, 88, 8443.

If you're having any trouble setting up webhooks, please check out this amazing guide to webhooks.

deleteWebhook

Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.

Parameter Type Required Description
drop_pending_updates Boolean Optional Pass True to drop all pending updates

getWebhookInfo

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

WebhookInfo

Describes the current status of a webhook.

Field Type Description
url String Webhook URL, may be empty if webhook is not set up
has_custom_certificate Boolean True, if a custom certificate was provided for webhook certificate checks
pending_update_count Integer Number of updates awaiting delivery
ip_address String Optional. Currently used webhook IP address
last_error_date Integer Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook
last_error_message String Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
last_synchronization_error_date Integer Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters
max_connections Integer Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
allowed_updates Array of String Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member

Available types

All types used in the Bot API responses are represented as JSON-objects.

It is safe to use 32-bit signed integers for storing all Integer fields unless otherwise noted.

Optional fields may be not returned when irrelevant.

User

This object represents a Telegram user or bot.

Field Type Description
id Integer Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
is_bot Boolean True, if this user is a bot
first_name String User's or bot's first name
last_name String Optional. User's or bot's last name
username String Optional. User's or bot's username
language_code String Optional. IETF language tag of the user's language
is_premium True Optional. True, if this user is a Telegram Premium user
added_to_attachment_menu True Optional. True, if this user added the bot to the attachment menu
can_join_groups Boolean Optional. True, if the bot can be invited to groups. Returned only in getMe.
can_read_all_group_messages Boolean Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
supports_inline_queries Boolean Optional. True, if the bot supports inline queries. Returned only in getMe.
can_connect_to_business Boolean Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe.
has_main_web_app Boolean Optional. True, if the bot has a main Web App. Returned only in getMe.

Chat

This object represents a chat.

Field Type Description
id Integer Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
type String Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
title String Optional. Title, for supergroups, channels and group chats
username String Optional. Username, for private chats, supergroups and channels if available
first_name String Optional. First name of the other party in a private chat
last_name String Optional. Last name of the other party in a private chat
is_forum True Optional. True, if the supergroup chat is a forum (has topics enabled)
is_direct_messages True Optional. True, if the chat is the direct messages chat of a channel

ChatFullInfo

This object contains full information about a chat.

Field Type Description
id Integer Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
type String Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
title String Optional. Title, for supergroups, channels and group chats
username String Optional. Username, for private chats, supergroups and channels if available
first_name String Optional. First name of the other party in a private chat
last_name String Optional. Last name of the other party in a private chat
is_forum True Optional. True, if the supergroup chat is a forum (has topics enabled)
is_direct_messages True Optional. True, if the chat is the direct messages chat of a channel
accent_color_id Integer Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details.
max_reaction_count Integer The maximum number of reactions that can be set on a message in the chat
photo ChatPhoto Optional. Chat photo
active_usernames Array of String Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels
birthdate Birthdate Optional. For private chats, the date of birth of the user
business_intro BusinessIntro Optional. For private chats with business accounts, the intro of the business
business_location BusinessLocation Optional. For private chats with business accounts, the location of the business
business_opening_hours BusinessOpeningHours Optional. For private chats with business accounts, the opening hours of the business
personal_chat Chat Optional. For private chats, the personal channel of the user
parent_chat Chat Optional. Information about the corresponding channel chat; for direct messages chats only
available_reactions Array of ReactionType Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed.
background_custom_emoji_id String Optional. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background
profile_accent_color_id Integer Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details.
profile_background_custom_emoji_id String Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background
emoji_status_custom_emoji_id String Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat
emoji_status_expiration_date Integer Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any
bio String Optional. Bio of the other party in a private chat
has_private_forwards True Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user
has_restricted_voice_and_video_messages True Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat
join_to_send_messages True Optional. True, if users need to join the supergroup before they can send messages
join_by_request True Optional. True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators
description String Optional. Description, for groups, supergroups and channel chats
invite_link String Optional. Primary invite link, for groups, supergroups and channel chats
pinned_message Message Optional. The most recent pinned message (by sending date)
permissions ChatPermissions Optional. Default chat member permissions, for groups and supergroups
accepted_gift_types AcceptedGiftTypes Information about types of gifts that are accepted by the chat or by the corresponding user for private chats
can_send_paid_media True Optional. True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.
slow_mode_delay Integer Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds
unrestrict_boost_count Integer Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions
message_auto_delete_time Integer Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds
has_aggressive_anti_spam_enabled True Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.
has_hidden_members True Optional. True, if non-administrators can only get the list of bots and administrators in the chat
has_protected_content True Optional. True, if messages from the chat can't be forwarded to other chats
has_visible_history True Optional. True, if new chat members will have access to old messages; available only to chat administrators
sticker_set_name String Optional. For supergroups, name of the group sticker set
can_set_sticker_set True Optional. True, if the bot can change the group sticker set
custom_emoji_sticker_set_name String Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.
linked_chat_id Integer Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
location ChatLocation Optional. For supergroups, the location to which the supergroup is connected

Message

This object represents a message.

Field Type Description
message_id Integer Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
message_thread_id Integer Optional. Unique identifier of a message thread to which the message belongs; for supergroups only
direct_messages_topic DirectMessagesTopic Optional. Information about the direct messages chat topic that contains the message
from User Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats
sender_chat Chat Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.
sender_boost_count Integer Optional. If the sender of the message boosted the chat, the number of boosts added by the user
sender_business_bot User Optional. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.
date Integer Date the message was sent in Unix time. It is always a positive number, representing a valid date.
business_connection_id String Optional. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
chat Chat Chat the message belongs to
forward_origin MessageOrigin Optional. Information about the original message for forwarded messages
is_topic_message True Optional. True, if the message is sent to a forum topic
is_automatic_forward True Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
reply_to_message Message Optional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
external_reply ExternalReplyInfo Optional. Information about the message that is being replied to, which may come from another chat or forum topic
quote TextQuote Optional. For replies that quote part of the original message, the quoted part of the message
reply_to_story Story Optional. For replies to a story, the original story
reply_to_checklist_task_id Integer Optional. Identifier of the specific checklist task that is being replied to
via_bot User Optional. Bot through which the message was sent
edit_date Integer Optional. Date the message was last edited in Unix time
has_protected_content True Optional. True, if the message can't be forwarded
is_from_offline True Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message
is_paid_post True Optional. True, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can't be edited.
media_group_id String Optional. The unique identifier of a media message group this message belongs to
author_signature String Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
paid_star_count Integer Optional. The number of Telegram Stars that were paid by the sender of the message to send it
text String Optional. For text messages, the actual UTF-8 text of the message
entities Array of MessageEntity Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
link_preview_options LinkPreviewOptions Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed
suggested_post_info SuggestedPostInfo Optional. Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can't be edited.
effect_id String Optional. Unique identifier of the message effect added to the message
animation Animation Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
audio Audio Optional. Message is an audio file, information about the file
document Document Optional. Message is a general file, information about the file
paid_media PaidMediaInfo Optional. Message contains paid media; information about the paid media
photo Array of PhotoSize Optional. Message is a photo, available sizes of the photo
sticker Sticker Optional. Message is a sticker, information about the sticker
story Story Optional. Message is a forwarded story
video Video Optional. Message is a video, information about the video
video_note VideoNote Optional. Message is a video note, information about the video message
voice Voice Optional. Message is a voice message, information about the file
caption String Optional. Caption for the animation, audio, document, paid media, photo, video or voice
caption_entities Array of MessageEntity Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
show_caption_above_media True Optional. True, if the caption must be shown above the message media
has_media_spoiler True Optional. True, if the message media is covered by a spoiler animation
checklist Checklist Optional. Message is a checklist
contact Contact Optional. Message is a shared contact, information about the contact
dice Dice Optional. Message is a dice with random value
game Game Optional. Message is a game, information about the game. More about games »
poll Poll Optional. Message is a native poll, information about the poll
venue Venue Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
location Location Optional. Message is a shared location, information about the location
new_chat_members Array of User Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
left_chat_member User Optional. A member was removed from the group, information about them (this member may be the bot itself)
new_chat_title String Optional. A chat title was changed to this value
new_chat_photo Array of PhotoSize Optional. A chat photo was change to this value
delete_chat_photo True Optional. Service message: the chat photo was deleted
group_chat_created True Optional. Service message: the group has been created
supergroup_chat_created True Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
channel_chat_created True Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
message_auto_delete_timer_changed MessageAutoDeleteTimerChanged Optional. Service message: auto-delete timer settings changed in the chat
migrate_to_chat_id Integer Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
migrate_from_chat_id Integer Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
pinned_message MaybeInaccessibleMessage Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
invoice Invoice Optional. Message is an invoice for a payment, information about the invoice. More about payments »
successful_payment SuccessfulPayment Optional. Message is a service message about a successful payment, information about the payment. More about payments »
refunded_payment RefundedPayment Optional. Message is a service message about a refunded payment, information about the payment. More about payments »
users_shared UsersShared Optional. Service message: users were shared with the bot
chat_shared ChatShared Optional. Service message: a chat was shared with the bot
gift GiftInfo Optional. Service message: a regular gift was sent or received
unique_gift UniqueGiftInfo Optional. Service message: a unique gift was sent or received
connected_website String Optional. The domain name of the website on which the user has logged in. More about Telegram Login »
write_access_allowed WriteAccessAllowed Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess
passport_data PassportData Optional. Telegram Passport data
proximity_alert_triggered ProximityAlertTriggered Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
boost_added ChatBoostAdded Optional. Service message: user boosted the chat
chat_background_set ChatBackground Optional. Service message: chat background set
checklist_tasks_done ChecklistTasksDone Optional. Service message: some tasks in a checklist were marked as done or not done
checklist_tasks_added ChecklistTasksAdded Optional. Service message: tasks were added to a checklist
direct_message_price_changed DirectMessagePriceChanged Optional. Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed
forum_topic_created ForumTopicCreated Optional. Service message: forum topic created
forum_topic_edited ForumTopicEdited Optional. Service message: forum topic edited
forum_topic_closed ForumTopicClosed Optional. Service message: forum topic closed
forum_topic_reopened ForumTopicReopened Optional. Service message: forum topic reopened
general_forum_topic_hidden GeneralForumTopicHidden Optional. Service message: the 'General' forum topic hidden
general_forum_topic_unhidden GeneralForumTopicUnhidden Optional. Service message: the 'General' forum topic unhidden
giveaway_created GiveawayCreated Optional. Service message: a scheduled giveaway was created
giveaway Giveaway Optional. The message is a scheduled giveaway message
giveaway_winners GiveawayWinners Optional. A giveaway with public winners was completed
giveaway_completed GiveawayCompleted Optional. Service message: a giveaway without public winners was completed
paid_message_price_changed PaidMessagePriceChanged Optional. Service message: the price for paid messages has changed in the chat
suggested_post_approved SuggestedPostApproved Optional. Service message: a suggested post was approved
suggested_post_approval_failed SuggestedPostApprovalFailed Optional. Service message: approval of a suggested post has failed
suggested_post_declined SuggestedPostDeclined Optional. Service message: a suggested post was declined
suggested_post_paid SuggestedPostPaid Optional. Service message: payment for a suggested post was received
suggested_post_refunded SuggestedPostRefunded Optional. Service message: payment for a suggested post was refunded
video_chat_scheduled VideoChatScheduled Optional. Service message: video chat scheduled
video_chat_started VideoChatStarted Optional. Service message: video chat started
video_chat_ended VideoChatEnded Optional. Service message: video chat ended
video_chat_participants_invited VideoChatParticipantsInvited Optional. Service message: new participants invited to a video chat
web_app_data WebAppData Optional. Service message: data sent by a Web App
reply_markup InlineKeyboardMarkup Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.

MessageId

This object represents a unique message identifier.

Field Type Description
message_id Integer Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent

InaccessibleMessage

This object describes a message that was deleted or is otherwise inaccessible to the bot.

Field Type Description
chat Chat Chat the message belonged to
message_id Integer Unique message identifier inside the chat
date Integer Always 0. The field can be used to differentiate regular and inaccessible messages.

MaybeInaccessibleMessage

This object describes a message that can be inaccessible to the bot. It can be one of

MessageEntity

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

Field Type Description
type String Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” ([email protected]), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)
offset Integer Offset in UTF-16 code units to the start of the entity
length Integer Length of the entity in UTF-16 code units
url String Optional. For “text_link” only, URL that will be opened after user taps on the text
user User Optional. For “text_mention” only, the mentioned user
language String Optional. For “pre” only, the programming language of the entity text
custom_emoji_id String Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker

TextQuote

This object contains information about the quoted part of a message that is replied to by the given message.

Field Type Description
text String Text of the quoted part of a message that is replied to by the given message
entities Array of MessageEntity Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes.
position Integer Approximate quote position in the original message in UTF-16 code units as specified by the sender
is_manual True Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.

ExternalReplyInfo

This object contains information about a message that is being replied to, which may come from another chat or forum topic.

Field Type Description
origin MessageOrigin Origin of the message replied to by the given message
chat Chat Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.
message_id Integer Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.
link_preview_options LinkPreviewOptions Optional. Options used for link preview generation for the original message, if it is a text message
animation Animation Optional. Message is an animation, information about the animation
audio Audio Optional. Message is an audio file, information about the file
document Document Optional. Message is a general file, information about the file
paid_media PaidMediaInfo Optional. Message contains paid media; information about the paid media
photo Array of PhotoSize Optional. Message is a photo, available sizes of the photo
sticker Sticker Optional. Message is a sticker, information about the sticker
story Story Optional. Message is a forwarded story
video Video Optional. Message is a video, information about the video
video_note VideoNote Optional. Message is a video note, information about the video message
voice Voice Optional. Message is a voice message, information about the file
has_media_spoiler True Optional. True, if the message media is covered by a spoiler animation
checklist Checklist Optional. Message is a checklist
contact Contact Optional. Message is a shared contact, information about the contact
dice Dice Optional. Message is a dice with random value
game Game Optional. Message is a game, information about the game. More about games »
giveaway Giveaway Optional. Message is a scheduled giveaway, information about the giveaway
giveaway_winners GiveawayWinners Optional. A giveaway with public winners was completed
invoice Invoice Optional. Message is an invoice for a payment, information about the invoice. More about payments »
location Location Optional. Message is a shared location, information about the location
poll Poll Optional. Message is a native poll, information about the poll
venue Venue Optional. Message is a venue, information about the venue

ReplyParameters

Describes reply parameters for the message that is being sent.

Field Type Description
message_id Integer Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified
chat_id Integer or String Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account and messages from channel direct messages chats.
allow_sending_without_reply Boolean Optional. Pass True if the message should be sent even if the specified message to be replied to is not found. Always False for replies in another chat or forum topic. Always True for messages sent on behalf of a business account.
quote String Optional. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn't found in the original message.
quote_parse_mode String Optional. Mode for parsing entities in the quote. See formatting options for more details.
quote_entities Array of MessageEntity Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode.
quote_position Integer Optional. Position of the quote in the original message in UTF-16 code units
checklist_task_id Integer Optional. Identifier of the specific checklist task to be replied to

MessageOrigin

This object describes the origin of a message. It can be one of

MessageOriginUser

The message was originally sent by a known user.

Field Type Description
type String Type of the message origin, always “user”
date Integer Date the message was sent originally in Unix time
sender_user User User that sent the message originally

MessageOriginHiddenUser

The message was originally sent by an unknown user.

Field Type Description
type String Type of the message origin, always “hidden_user”
date Integer Date the message was sent originally in Unix time
sender_user_name String Name of the user that sent the message originally

MessageOriginChat

The message was originally sent on behalf of a chat to a group chat.

Field Type Description
type String Type of the message origin, always “chat”
date Integer Date the message was sent originally in Unix time
sender_chat Chat Chat that sent the message originally
author_signature String Optional. For messages originally sent by an anonymous chat administrator, original message author signature

MessageOriginChannel

The message was originally sent to a channel chat.

Field Type Description
type String Type of the message origin, always “channel”
date Integer Date the message was sent originally in Unix time
chat Chat Channel chat to which the message was originally sent
message_id Integer Unique message identifier inside the chat
author_signature String Optional. Signature of the original post author

PhotoSize

This object represents one size of a photo or a file / sticker thumbnail.

Field Type Description
file_id String Identifier for this file, which can be used to download or reuse the file
file_unique_id String Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
width Integer Photo width
height Integer Photo height
file_size Integer Optional. File size in bytes

Animation

This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).

Field Type Description
file_id String Identifier for this file, which can be used to download or reuse the file
file_unique_id String Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
width Integer Video width as defined by the sender
height Integer Video height as defined by the sender
duration Integer Duration of the video in seconds as defined by the sender
thumbnail PhotoSize Optional. Animation thumbnail as defined by the sender
file_name String Optional. Original animation filename as defined by the sender
mime_type String Optional. MIME type of the file as defined by the sender
file_size Integer Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

Audio

This object represents an audio file to be treated as music by the Telegram clients.

Field Type Description
file_id String Identifier for this file, which can be used to download or reuse the file
file_unique_id String Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
duration Integer Duration of the audio in seconds as defined by the sender
performer String Optional. Performer of the audio as defined by the sender or by audio tags
title String Optional. Title of the audio as defined by the sender or by audio tags
file_name String Optional. Original filename as defined by the sender
mime_type String Optional. MIME type of the file as defined by the sender
file_size Integer Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
thumbnail PhotoSize Optional. Thumbnail of the album cover to which the music file belongs

Document

This object represents a general file (as opposed to photos, voice messages and audio files).

Field Type Description
file_id String Identifier for this file, which can be used to download or reuse the file
file_unique_id String Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
thumbnail PhotoSize Optional. Document thumbnail as defined by the sender
file_name String Optional. Original filename as defined by the sender
mime_type String Optional. MIME type of the file as defined by the sender
file_size Integer Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

Story

This object represents a story.

Field Type Description
chat Chat Chat that posted the story
id Integer Unique identifier for the story in the chat

Video

This object represents a video file.

Field Type Description
file_id String Identifier for this file, which can be used to download or reuse the file
file_unique_id String Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
width Integer Video width as defined by the sender
height Integer Video height as defined by the sender
duration Integer Duration of the video in seconds as defined by the sender
thumbnail PhotoSize Optional. Video thumbnail
cover Array of PhotoSize Optional. Available sizes of the cover of the video in the message
start_timestamp Integer Optional. Timestamp in seconds from which the video will play in the message
file_name String Optional. Original filename as defined by the sender
mime_type String Optional. MIME type of the file as defined by the sender
file_size Integer Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

VideoNote

This object represents a video message (available in Telegram apps as of v.4.0).

Field Type Description
file_id String Identifier for this file, which can be used to download or reuse the file
file_unique_id String Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
length Integer Video width and height (diameter of the video message) as defined by the sender
duration Integer Duration of the video in seconds as defined by the sender
thumbnail PhotoSize Optional. Video thumbnail
file_size Integer Optional. File size in bytes

Voice

This object represents a voice note.

Field Type Description
file_id String Identifier for this file, which can be used to download or reuse the file
file_unique_id String Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
duration Integer Duration of the audio in seconds as defined by the sender
mime_type String Optional. MIME type of the file as defined by the sender
file_size Integer Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

PaidMediaInfo

Describes the paid media added to a message.

Field Type Description
star_count Integer The number of Telegram Stars that must be paid to buy access to the media
paid_media Array of PaidMedia Information about the paid media

PaidMedia

This object describes paid media. Currently, it can be one of

PaidMediaPreview

The paid media isn't available before the payment.

Field Type Description
type String Type of the paid media, always “preview”
width Integer Optional. Media width as defined by the sender
height Integer Optional. Media height as defined by the sender
duration Integer Optional. Duration of the media in seconds as defined by the sender

PaidMediaPhoto

The paid media is a photo.

Field Type Description
type String Type of the paid media, always “photo”
photo Array of PhotoSize The photo

PaidMediaVideo

The paid media is a video.

Field Type Description
type String Type of the paid media, always “video”
video Video The video

Contact

This object represents a phone contact.

Field Type Description
phone_number String Contact's phone number
first_name String Contact's first name
last_name String Optional. Contact's last name
user_id Integer Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
vcard String Optional. Additional data about the contact in the form of a vCard

Dice

This object represents an animated emoji that displays a random value.

Field Type Description
emoji String Emoji on which the dice throw animation is based
value Integer Value of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji

PollOption

This object contains information about one answer option in a poll.

Field Type Description
text String Option text, 1-100 characters
text_entities Array of MessageEntity Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts
voter_count Integer Number of users that voted for this option

InputPollOption

This object contains information about one answer option in a poll to be sent.

Field Type Description
text String Option text, 1-100 characters
text_parse_mode String Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed
text_entities Array of MessageEntity Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode

PollAnswer

This object represents an answer of a user in a non-anonymous poll.

Field Type Description
poll_id String Unique poll identifier
voter_chat Chat Optional. The chat that changed the answer to the poll, if the voter is anonymous
user User Optional. The user that changed the answer to the poll, if the voter isn't anonymous
option_ids Array of Integer 0-based identifiers of chosen answer options. May be empty if the vote was retracted.

Poll

This object contains information about a poll.

Field Type Description
id String Unique poll identifier
question String Poll question, 1-300 characters
question_entities Array of MessageEntity Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions
options Array of PollOption List of poll options
total_voter_count Integer Total number of users that voted in the poll
is_closed Boolean True, if the poll is closed
is_anonymous Boolean True, if the poll is anonymous
type String Poll type, currently can be “regular” or “quiz”
allows_multiple_answers Boolean True, if the poll allows multiple answers
correct_option_id Integer Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
explanation String Optional. 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
explanation_entities Array of MessageEntity Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
open_period Integer Optional. Amount of time in seconds the poll will be active after creation
close_date Integer Optional. Point in time (Unix timestamp) when the poll will be automatically closed

ChecklistTask

Describes a task in a checklist.

Field Type Description
id Integer Unique identifier of the task
text String Text of the task
text_entities Array of MessageEntity Optional. Special entities that appear in the task text
completed_by_user User Optional. User that completed the task; omitted if the task wasn't completed
completion_date Integer Optional. Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed

Checklist

Describes a checklist.

Field Type Description
title String Title of the checklist
title_entities Array of MessageEntity Optional. Special entities that appear in the checklist title
tasks Array of ChecklistTask List of tasks in the checklist
others_can_add_tasks True Optional. True, if users other than the creator of the list can add tasks to the list
others_can_mark_tasks_as_done True Optional. True, if users other than the creator of the list can mark tasks as done or not done

InputChecklistTask

Describes a task to add to a checklist.

Field Type Description
id Integer Unique identifier of the task; must be positive and unique among all task identifiers currently present in the checklist
text String Text of the task; 1-100 characters after entities parsing
parse_mode String Optional. Mode for parsing entities in the text. See formatting options for more details.
text_entities Array of MessageEntity Optional. List of special entities that appear in the text, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are allowed.

InputChecklist

Describes a checklist to create.

Field Type Description
title String Title of the checklist; 1-255 characters after entities parsing
parse_mode String Optional. Mode for parsing entities in the title. See formatting options for more details.
title_entities Array of MessageEntity Optional. List of special entities that appear in the title, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are allowed.
tasks Array of InputChecklistTask List of 1-30 tasks in the checklist
others_can_add_tasks Boolean Optional. Pass True if other users can add tasks to the checklist
others_can_mark_tasks_as_done Boolean Optional. Pass True if other users can mark tasks as done or not done in the checklist

ChecklistTasksDone

Describes a service message about checklist tasks marked as done or not done.

Field Type Description
checklist_message Message Optional. Message containing the checklist whose tasks were marked as done or not done. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
marked_as_done_task_ids Array of Integer Optional. Identifiers of the tasks that were marked as done
marked_as_not_done_task_ids Array of Integer Optional. Identifiers of the tasks that were marked as not done

ChecklistTasksAdded

Describes a service message about tasks added to a checklist.

Field Type Description
checklist_message Message Optional. Message containing the checklist to which the tasks were added. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
tasks Array of ChecklistTask List of tasks added to the checklist

Location

This object represents a point on the map.

Field Type Description
latitude Float Latitude as defined by the sender
longitude Float Longitude as defined by the sender
horizontal_accuracy Float Optional. The radius of uncertainty for the location, measured in meters; 0-1500
live_period Integer Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.
heading Integer Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
proximity_alert_radius Integer Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.

Venue

This object represents a venue.

Field Type Description
location Location Venue location. Can't be a live location
title String Name of the venue
address String Address of the venue
foursquare_id String Optional. Foursquare identifier of the venue
foursquare_type String Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_id String Optional. Google Places identifier of the venue
google_place_type String Optional. Google Places type of the venue. (See supported types.)

WebAppData

Describes data sent from a Web App to the bot.

Field Type Description
data String The data. Be aware that a bad client can send arbitrary data in this field.
button_text String Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field.

ProximityAlertTriggered

This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.

Field Type Description
traveler User User that triggered the alert
watcher User User that set the alert
distance Integer The distance between the users

MessageAutoDeleteTimerChanged

This object represents a service message about a change in auto-delete timer settings.

Field Type Description
message_auto_delete_time Integer New auto-delete time for messages in the chat; in seconds

ChatBoostAdded

This object represents a service message about a user boosting a chat.

Field Type Description
boost_count Integer Number of boosts added by the user

BackgroundFill

This object describes the way a background is filled based on the selected colors. Currently, it can be one of

BackgroundFillSolid

The background is filled using the selected color.

Field Type Description
type String Type of the background fill, always “solid”
color Integer The color of the background fill in the RGB24 format

BackgroundFillGradient

The background is a gradient fill.

Field Type Description
type String Type of the background fill, always “gradient”
top_color Integer Top color of the gradient in the RGB24 format
bottom_color Integer Bottom color of the gradient in the RGB24 format
rotation_angle Integer Clockwise rotation angle of the background fill in degrees; 0-359

BackgroundFillFreeformGradient

The background is a freeform gradient that rotates after every message in the chat.

Field Type Description
type String Type of the background fill, always “freeform_gradient”
colors Array of Integer A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format

BackgroundType

This object describes the type of a background. Currently, it can be one of

BackgroundTypeFill

The background is automatically filled based on the selected colors.

Field Type Description
type String Type of the background, always “fill”
fill BackgroundFill The background fill
dark_theme_dimming Integer Dimming of the background in dark themes, as a percentage; 0-100

BackgroundTypeWallpaper

The background is a wallpaper in the JPEG format.

Field Type Description
type String Type of the background, always “wallpaper”
document Document Document with the wallpaper
dark_theme_dimming Integer Dimming of the background in dark themes, as a percentage; 0-100
is_blurred True Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12
is_moving True Optional. True, if the background moves slightly when the device is tilted

BackgroundTypePattern

The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.

Field Type Description
type String Type of the background, always “pattern”
document Document Document with the pattern
fill BackgroundFill The background fill that is combined with the pattern
intensity Integer Intensity of the pattern when it is shown above the filled background; 0-100
is_inverted True Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only
is_moving True Optional. True, if the background moves slightly when the device is tilted

BackgroundTypeChatTheme

The background is taken directly from a built-in chat theme.

Field Type Description
type String Type of the background, always “chat_theme”
theme_name String Name of the chat theme, which is usually an emoji

ChatBackground

This object represents a chat background.

Field Type Description
type BackgroundType Type of the background

ForumTopicCreated

This object represents a service message about a new forum topic created in the chat.

Field Type Description
name String Name of the topic
icon_color Integer Color of the topic icon in RGB format
icon_custom_emoji_id String Optional. Unique identifier of the custom emoji shown as the topic icon

ForumTopicClosed

This object represents a service message about a forum topic closed in the chat. Currently holds no information.

ForumTopicEdited

This object represents a service message about an edited forum topic.

Field Type Description
name String Optional. New name of the topic, if it was edited
icon_custom_emoji_id String Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed

ForumTopicReopened

This object represents a service message about a forum topic reopened in the chat. Currently holds no information.

GeneralForumTopicHidden

This object represents a service message about General forum topic hidden in the chat. Currently holds no information.

GeneralForumTopicUnhidden

This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.

SharedUser

This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.

Field Type Description
user_id Integer Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.
first_name String Optional. First name of the user, if the name was requested by the bot
last_name String Optional. Last name of the user, if the name was requested by the bot
username String Optional. Username of the user, if the username was requested by the bot
photo Array of PhotoSize Optional. Available sizes of the chat photo, if the photo was requested by the bot

UsersShared

This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.

Field Type Description
request_id Integer Identifier of the request
users Array of SharedUser Information about users shared with the bot.

ChatShared

This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.

Field Type Description
request_id Integer Identifier of the request
chat_id Integer Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.
title String Optional. Title of the chat, if the title was requested by the bot.
username String Optional. Username of the chat, if the username was requested by the bot and available.
photo Array of PhotoSize Optional. Available sizes of the chat photo, if the photo was requested by the bot

WriteAccessAllowed

This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.

Field Type Description
from_request Boolean Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess
web_app_name String Optional. Name of the Web App, if the access was granted when the Web App was launched from a link
from_attachment_menu Boolean Optional. True, if the access was granted when the bot was added to the attachment or side menu

VideoChatScheduled

This object represents a service message about a video chat scheduled in the chat.

Field Type Description
start_date Integer Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator

VideoChatStarted

This object represents a service message about a video chat started in the chat. Currently holds no information.

VideoChatEnded

This object represents a service message about a video chat ended in the chat.

Field Type Description
duration Integer Video chat duration in seconds

VideoChatParticipantsInvited

This object represents a service message about new members invited to a video chat.

Field Type Description
users Array of User New members that were invited to the video chat

PaidMessagePriceChanged

Describes a service message about a change in the price of paid messages within a chat.

Field Type Description
paid_message_star_count Integer The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message

DirectMessagePriceChanged

Describes a service message about a change in the price of direct messages sent to a channel chat.

Field Type Description
are_direct_messages_enabled Boolean True, if direct messages are enabled for the channel chat; false otherwise
direct_message_star_count Integer Optional. The new number of Telegram Stars that must be paid by users for each direct message sent to the channel. Does not apply to users who have been exempted by administrators. Defaults to 0.

SuggestedPostApproved

Describes a service message about the approval of a suggested post.

Field Type Description
suggested_post_message Message Optional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
price SuggestedPostPrice Optional. Amount paid for the post
send_date Integer Date when the post will be published

SuggestedPostApprovalFailed

Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval.

Field Type Description
suggested_post_message Message Optional. Message containing the suggested post whose approval has failed. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
price SuggestedPostPrice Expected price of the post

SuggestedPostDeclined

Describes a service message about the rejection of a suggested post.

Field Type Description
suggested_post_message Message Optional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
comment String Optional. Comment with which the post was declined

SuggestedPostPaid

Describes a service message about a successful payment for a suggested post.

Field Type Description
suggested_post_message Message Optional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
currency String Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins
amount Integer Optional. The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins only
star_amount StarAmount Optional. The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only

SuggestedPostRefunded

Describes a service message about a payment refund for a suggested post.

Field Type Description
suggested_post_message Message Optional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
reason String Reason for the refund. Currently, one of “post_deleted” if the post was deleted within 24 hours of being posted or removed from scheduled messages without being posted, or “payment_refunded” if the payer refunded their payment.

GiveawayCreated

This object represents a service message about the creation of a scheduled giveaway.

Field Type Description
prize_star_count Integer Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only

Giveaway

This object represents a message about a scheduled giveaway.

Field Type Description
chats Array of Chat The list of chats which the user must join to participate in the giveaway
winners_selection_date Integer Point in time (Unix timestamp) when winners of the giveaway will be selected
winner_count Integer The number of users which are supposed to be selected as winners of the giveaway
only_new_members True Optional. True, if only users who join the chats after the giveaway started should be eligible to win
has_public_winners True Optional. True, if the list of giveaway winners will be visible to everyone
prize_description String Optional. Description of additional giveaway prize
country_codes Array of String Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.
prize_star_count Integer Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
premium_subscription_month_count Integer Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only

GiveawayWinners

This object represents a message about the completion of a giveaway with public winners.

Field Type Description
chat Chat The chat that created the giveaway
giveaway_message_id Integer Identifier of the message with the giveaway in the chat
winners_selection_date Integer Point in time (Unix timestamp) when winners of the giveaway were selected
winner_count Integer Total number of winners in the giveaway
winners Array of User List of up to 100 winners of the giveaway
additional_chat_count Integer Optional. The number of other chats the user had to join in order to be eligible for the giveaway
prize_star_count Integer Optional. The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only
premium_subscription_month_count Integer Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only
unclaimed_prize_count Integer Optional. Number of undistributed prizes
only_new_members True Optional. True, if only users who had joined the chats after the giveaway started were eligible to win
was_refunded True Optional. True, if the giveaway was canceled because the payment for it was refunded
prize_description String Optional. Description of additional giveaway prize

GiveawayCompleted

This object represents a service message about the completion of a giveaway without public winners.

Field Type Description
winner_count Integer Number of winners in the giveaway
unclaimed_prize_count Integer Optional. Number of undistributed prizes
giveaway_message Message Optional. Message with the giveaway that was completed, if it wasn't deleted
is_star_giveaway True Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway.

LinkPreviewOptions

Describes the options used for link preview generation.

Field Type Description
is_disabled Boolean Optional. True, if the link preview is disabled
url String Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used
prefer_small_media Boolean Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
prefer_large_media Boolean Optional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
show_above_text Boolean Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text

SuggestedPostPrice

Describes the price of a suggested post.

Field Type Description
currency String Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins
amount Integer The amount of the currency that will be paid for the post in the smallest units of the currency, i.e. Telegram Stars or nanotoncoins. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins must be between 10000000 and 10000000000000.

SuggestedPostInfo

Contains information about a suggested post.

Field Type Description
state String State of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”.
price SuggestedPostPrice Optional. Proposed price of the post. If the field is omitted, then the post is unpaid.
send_date Integer Optional. Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it.

SuggestedPostParameters

Contains parameters of a post that is being suggested by the bot.

Field Type Description
price SuggestedPostPrice Optional. Proposed price for the post. If the field is omitted, then the post is unpaid.
send_date Integer Optional. Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it.

DirectMessagesTopic

Describes a topic of a direct messages chat.

Field Type Description
topic_id Integer Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
user User Optional. Information about the user that created the topic. Currently, it is always present

UserProfilePhotos

This object represent a user's profile pictures.

Field Type Description
total_count Integer Total number of profile pictures the target user has
photos Array of Array of PhotoSize Requested profile pictures (in up to 4 sizes each)

File

This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. 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.

The maximum file size to download is 20 MB

Field Type Description
file_id String Identifier for this file, which can be used to download or reuse the file
file_unique_id String Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
file_size Integer Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
file_path String Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.

WebAppInfo

Describes a Web App.

Field Type Description
url String An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps

ReplyKeyboardMarkup

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.

Field Type Description
keyboard Array of Array of KeyboardButton Array of button rows, each represented by an Array of KeyboardButton objects
is_persistent Boolean Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon.
resize_keyboard Boolean Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
one_time_keyboard Boolean Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false.
input_field_placeholder String Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
selective Boolean Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.

Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.

KeyboardButton

This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.

Field Type Description
text String Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed
request_users KeyboardButtonRequestUsers Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only.
request_chat KeyboardButtonRequestChat Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only.
request_contact Boolean Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.
request_location Boolean Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only.
request_poll KeyboardButtonPollType Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only.
web_app WebAppInfo Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only.

Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

KeyboardButtonRequestUsers

This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users »

Field Type Description
request_id Integer Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message
user_is_bot Boolean Optional. Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied.
user_is_premium Boolean Optional. Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied.
max_quantity Integer Optional. The maximum number of users to be selected; 1-10. Defaults to 1.
request_name Boolean Optional. Pass True to request the users' first and last names
request_username Boolean Optional. Pass True to request the users' usernames
request_photo Boolean Optional. Pass True to request the users' photos

KeyboardButtonRequestChat

This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. More about requesting chats ».

Field Type Description
request_id Integer Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message
chat_is_channel Boolean Pass True to request a channel chat, pass False to request a group or a supergroup chat.
chat_is_forum Boolean Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.
chat_has_username Boolean Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.
chat_is_created Boolean Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.
user_administrator_rights ChatAdministratorRights Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.
bot_administrator_rights ChatAdministratorRights Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.
bot_is_member Boolean Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.
request_title Boolean Optional. Pass True to request the chat's title
request_username Boolean Optional. Pass True to request the chat's username
request_photo Boolean Optional. Pass True to request the chat's photo

KeyboardButtonPollType

This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.

Field Type Description
type String Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.

ReplyKeyboardRemove

Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a Telegram Business account.

Field Type Description
remove_keyboard True Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
selective Boolean Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.

Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.

InlineKeyboardMarkup

This object represents an inline keyboard that appears right next to the message it belongs to.

Field Type Description
inline_keyboard Array of Array of InlineKeyboardButton Array of button rows, each represented by an Array of InlineKeyboardButton objects

InlineKeyboardButton

This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.

Field Type Description
text String Label text on the button
url String Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.
callback_data String Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes
web_app WebAppInfo Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.
login_url LoginUrl Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
switch_inline_query String Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account.
switch_inline_query_current_chat String Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.

This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a Telegram Business account.
switch_inline_query_chosen_chat SwitchInlineQueryChosenChat Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account.
copy_text CopyTextButton Optional. Description of the button that copies the specified text to the clipboard.
callback_game CallbackGame Optional. Description of the game that will be launched when the user presses the button.

NOTE: This type of button must always be the first button in the first row.
pay Boolean Optional. Specify True, to send a Pay button. Substrings “⭐” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.

NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.

LoginUrl

This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in: