openapi: 3.0.3 info: title: Telegram Bot API description: >- The Telegram Bot API is an HTTP-based interface created for developers keen on building bots for Telegram. Bots can receive messages, send messages, manage chats, handle payments, work with stickers, and much more. All methods are HTTPS POST requests to https://api.telegram.org/bot/METHOD_NAME. version: '9.5' contact: name: Telegram Support url: https://core.telegram.org/bots/api license: name: Terms of Service url: https://telegram.org/tos termsOfService: https://telegram.org/tos externalDocs: description: Official Telegram Bot API Documentation url: https://core.telegram.org/bots/api servers: - url: https://api.telegram.org/bot{token} description: Telegram Bot API Server variables: token: default: YOUR_BOT_TOKEN description: Bot authentication token obtained from @BotFather security: - BotToken: [] tags: - name: Getting Updates description: Methods for receiving incoming updates from Telegram - name: Bot Info description: Methods for getting and setting bot information - name: Messaging description: Methods for sending messages and media - name: Message Editing description: Methods for editing and deleting messages - name: Chat Management description: Methods for managing chats and chat settings - name: Member Management description: Methods for managing chat members and administrators - name: Invites description: Methods for managing chat invite links - name: Payments description: Methods for handling Telegram Payments - name: Stickers description: Methods for working with sticker sets paths: /getMe: post: operationId: getMe summary: Get Bot Info description: A simple method for testing your bot authentication token. Returns basic information about the bot in the form of a User object. tags: - Bot Info responses: '200': description: Bot user object returned successfully content: application/json: schema: $ref: '#/components/schemas/UserResponse' /getUpdates: post: operationId: getUpdates summary: Get Updates description: >- Receive incoming updates using long polling. Returns an array of Update objects. Notes: this method will not work if an outgoing webhook is set up. tags: - Getting Updates requestBody: content: application/json: schema: type: object properties: offset: type: integer description: Identifier of the first update to be returned limit: type: integer description: Limits the number of updates to be retrieved (1-100) minimum: 1 maximum: 100 timeout: type: integer description: Timeout in seconds for long polling allowed_updates: type: array items: type: string description: List of update types the bot should receive responses: '200': description: Array of Update objects content: application/json: schema: $ref: '#/components/schemas/UpdatesResponse' /setWebhook: post: operationId: setWebhook summary: Set Webhook description: Specify a URL and receive incoming updates via an outgoing webhook. tags: - Getting Updates requestBody: required: true content: application/json: schema: type: object required: - url properties: url: type: string description: HTTPS URL to send updates to ip_address: type: string description: Fixed IP address to send webhook requests to max_connections: type: integer description: Maximum allowed number of simultaneous HTTPS connections minimum: 1 maximum: 100 allowed_updates: type: array items: type: string description: List of update types the bot should receive drop_pending_updates: type: boolean description: Pass true to drop all pending updates secret_token: type: string description: A secret token to be sent in a header in every webhook request responses: '200': description: Webhook set successfully content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /deleteWebhook: post: operationId: deleteWebhook summary: Delete Webhook description: Remove webhook integration. tags: - Getting Updates requestBody: content: application/json: schema: type: object properties: drop_pending_updates: type: boolean description: Pass true to drop all pending updates responses: '200': description: Webhook deleted successfully content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /getWebhookInfo: post: operationId: getWebhookInfo summary: Get Webhook Info description: Get current webhook status. tags: - Getting Updates responses: '200': description: Webhook info object content: application/json: schema: $ref: '#/components/schemas/WebhookInfoResponse' /sendMessage: post: operationId: sendMessage summary: Send Message description: Send text messages. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - chat_id - text properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat or username text: type: string description: Text of the message to be sent parse_mode: type: string enum: [Markdown, MarkdownV2, HTML] description: Mode for parsing entities in the message text disable_notification: type: boolean description: Sends the message silently reply_to_message_id: type: integer description: If the message is a reply, ID of the original message responses: '200': description: Message sent successfully content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /forwardMessage: post: operationId: forwardMessage summary: Forward Message description: Forward messages of any kind. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - chat_id - from_chat_id - message_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat from_chat_id: oneOf: - type: integer - type: string description: Unique identifier for the chat where the original message was sent message_id: type: integer description: Message identifier in the chat specified in from_chat_id disable_notification: type: boolean description: Sends the message silently responses: '200': description: Forwarded message object content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /copyMessage: post: operationId: copyMessage summary: Copy Message description: Copy messages of any kind without the forward marker. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - chat_id - from_chat_id - message_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat from_chat_id: oneOf: - type: integer - type: string description: Unique identifier for the source chat message_id: type: integer description: Message identifier in the source chat caption: type: string description: New caption for media; pass empty string to remove caption responses: '200': description: Copied message identifier content: application/json: schema: $ref: '#/components/schemas/MessageIdResponse' /sendPhoto: post: operationId: sendPhoto summary: Send Photo description: Send photos. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - chat_id - photo properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat photo: type: string description: Photo to send (file_id, URL, or multipart/form-data) caption: type: string description: Photo caption parse_mode: type: string description: Mode for parsing entities in the caption responses: '200': description: Photo message sent content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /sendDocument: post: operationId: sendDocument summary: Send Document description: Send general files. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - chat_id - document properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat document: type: string description: File to send (file_id, URL, or multipart/form-data) caption: type: string description: Document caption responses: '200': description: Document message sent content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /sendAudio: post: operationId: sendAudio summary: Send Audio description: Send audio files as a playable music track. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - chat_id - audio properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat audio: type: string description: Audio file to send (file_id, URL, or multipart/form-data) caption: type: string description: Audio caption duration: type: integer description: Duration of the audio in seconds performer: type: string description: Performer title: type: string description: Track name responses: '200': description: Audio message sent content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /sendVideo: post: operationId: sendVideo summary: Send Video description: Send video files. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - chat_id - video properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat video: type: string description: Video to send (file_id, URL, or multipart/form-data) duration: type: integer description: Duration of sent video in seconds width: type: integer description: Video width height: type: integer description: Video height caption: type: string description: Video caption responses: '200': description: Video message sent content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /sendVoice: post: operationId: sendVoice summary: Send Voice description: Send audio files as a voice message. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - chat_id - voice properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat voice: type: string description: Audio file to send (file_id, URL, or multipart/form-data) caption: type: string description: Voice message caption duration: type: integer description: Duration of the voice message in seconds responses: '200': description: Voice message sent content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /sendLocation: post: operationId: sendLocation summary: Send Location description: Send a point on the map. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - chat_id - latitude - longitude properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat latitude: type: number format: float description: Latitude of the location longitude: type: number format: float description: Longitude of the location horizontal_accuracy: type: number description: The radius of uncertainty in meters (0-1500) live_period: type: integer description: Period in seconds during which location can be updated responses: '200': description: Location message sent content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /sendContact: post: operationId: sendContact summary: Send Contact description: Send phone contacts. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - chat_id - phone_number - first_name properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat phone_number: type: string description: Contact's phone number first_name: type: string description: Contact's first name last_name: type: string description: Contact's last name vcard: type: string description: Additional data about the contact in vCard format responses: '200': description: Contact sent content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /sendPoll: post: operationId: sendPoll summary: Send Poll description: Send a native poll. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - chat_id - question - options properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat question: type: string description: Poll question (1-300 characters) options: type: array items: type: string description: List of answer options (2-10 strings) is_anonymous: type: boolean description: True if the poll needs to be anonymous type: type: string enum: [regular, quiz] description: Poll type (regular or quiz) allows_multiple_answers: type: boolean description: True if the poll allows multiple answers responses: '200': description: Poll message sent content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /sendDice: post: operationId: sendDice summary: Send Dice description: Send an animated emoji that will display a random value. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - chat_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat emoji: type: string description: Emoji on which the dice throw animation is based default: "\U0001F3B2" responses: '200': description: Dice message sent content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /editMessageText: post: operationId: editMessageText summary: Edit Message Text description: Edit text and game messages. tags: - Message Editing requestBody: required: true content: application/json: schema: type: object required: - text properties: chat_id: oneOf: - type: integer - type: string description: Required if inline_message_id is not specified message_id: type: integer description: Required if inline_message_id is not specified inline_message_id: type: string description: Required if chat_id and message_id are not specified text: type: string description: New text of the message parse_mode: type: string description: Mode for parsing entities in the message text responses: '200': description: Edited message object content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /editMessageCaption: post: operationId: editMessageCaption summary: Edit Message Caption description: Edit captions of messages. tags: - Message Editing requestBody: required: true content: application/json: schema: type: object properties: chat_id: oneOf: - type: integer - type: string description: Required if inline_message_id is not specified message_id: type: integer description: Required if inline_message_id is not specified caption: type: string description: New caption of the message parse_mode: type: string description: Mode for parsing entities in the caption responses: '200': description: Edited message object content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /deleteMessage: post: operationId: deleteMessage summary: Delete Message description: Delete a message, including service messages. tags: - Message Editing requestBody: required: true content: application/json: schema: type: object required: - chat_id - message_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat message_id: type: integer description: Identifier of the message to delete responses: '200': description: Message deleted successfully content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /getUserProfilePhotos: post: operationId: getUserProfilePhotos summary: Get User Profile Photos description: Get a list of profile pictures for a user. tags: - Bot Info requestBody: required: true content: application/json: schema: type: object required: - user_id properties: user_id: type: integer description: Unique identifier of the target user offset: type: integer description: Sequential number of the first photo to be returned limit: type: integer description: Limits the number of photos to be retrieved (1-100) responses: '200': description: User profile photos content: application/json: schema: $ref: '#/components/schemas/UserProfilePhotosResponse' /getFile: post: operationId: getFile summary: Get File description: Get basic info about a file and prepare it for downloading. tags: - Bot Info requestBody: required: true content: application/json: schema: type: object required: - file_id properties: file_id: type: string description: File identifier to get info about responses: '200': description: File object content: application/json: schema: $ref: '#/components/schemas/FileResponse' /getChat: post: operationId: getChat summary: Get Chat description: Get up-to-date information about the chat. tags: - Chat Management requestBody: required: true content: application/json: schema: type: object required: - chat_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat responses: '200': description: Chat object content: application/json: schema: $ref: '#/components/schemas/ChatResponse' /getChatAdministrators: post: operationId: getChatAdministrators summary: Get Chat Administrators description: Get a list of administrators in a chat. tags: - Chat Management requestBody: required: true content: application/json: schema: type: object required: - chat_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat responses: '200': description: Array of ChatMember objects content: application/json: schema: $ref: '#/components/schemas/ChatMembersResponse' /getChatMemberCount: post: operationId: getChatMemberCount summary: Get Chat Member Count description: Get the number of members in a chat. tags: - Chat Management requestBody: required: true content: application/json: schema: type: object required: - chat_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat responses: '200': description: Number of chat members content: application/json: schema: $ref: '#/components/schemas/IntegerResponse' /getChatMember: post: operationId: getChatMember summary: Get Chat Member description: Get information about a member of a chat. tags: - Chat Management requestBody: required: true content: application/json: schema: type: object required: - chat_id - user_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat user_id: type: integer description: Unique identifier of the target user responses: '200': description: ChatMember object content: application/json: schema: $ref: '#/components/schemas/ChatMemberResponse' /leaveChat: post: operationId: leaveChat summary: Leave Chat description: Use this method for your bot to leave a group, supergroup or channel. tags: - Chat Management requestBody: required: true content: application/json: schema: type: object required: - chat_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat responses: '200': description: Bot left the chat content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /banChatMember: post: operationId: banChatMember summary: Ban Chat Member description: Ban a user in a group, a supergroup or a channel. tags: - Member Management requestBody: required: true content: application/json: schema: type: object required: - chat_id - user_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target group or username user_id: type: integer description: Unique identifier of the target user until_date: type: integer description: Date when the user will be unbanned (Unix time) revoke_messages: type: boolean description: Pass true to delete all messages from the chat for the user responses: '200': description: User banned successfully content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /unbanChatMember: post: operationId: unbanChatMember summary: Unban Chat Member description: Unban a previously banned user in a supergroup or channel. tags: - Member Management requestBody: required: true content: application/json: schema: type: object required: - chat_id - user_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target group user_id: type: integer description: Unique identifier of the target user only_if_banned: type: boolean description: Do nothing if the user is not banned responses: '200': description: User unbanned successfully content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /restrictChatMember: post: operationId: restrictChatMember summary: Restrict Chat Member description: Restrict a user in a supergroup. tags: - Member Management requestBody: required: true content: application/json: schema: type: object required: - chat_id - user_id - permissions properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat user_id: type: integer description: Unique identifier of the target user permissions: $ref: '#/components/schemas/ChatPermissions' until_date: type: integer description: Date when restrictions will be lifted for the user (Unix time) responses: '200': description: User restrictions updated content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /promoteChatMember: post: operationId: promoteChatMember summary: Promote Chat Member description: Promote or demote a user in a supergroup or a channel. tags: - Member Management requestBody: required: true content: application/json: schema: type: object required: - chat_id - user_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat user_id: type: integer description: Unique identifier of the target user can_change_info: type: boolean description: Pass true if the administrator can change chat title, photo and other settings can_post_messages: type: boolean description: Pass true if the administrator can post in the channel can_edit_messages: type: boolean description: Pass true if the administrator can edit messages of other users can_delete_messages: type: boolean description: Pass true if the administrator can delete messages of other users can_restrict_members: type: boolean description: Pass true if the administrator can restrict, ban or unban chat members can_promote_members: type: boolean description: Pass true if the administrator can add new administrators can_manage_chat: type: boolean description: Pass true if the administrator can manage the chat responses: '200': description: Administrator rights updated content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /setChatAdministratorCustomTitle: post: operationId: setChatAdministratorCustomTitle summary: Set Chat Administrator Custom Title description: Set a custom title for an administrator in a supergroup promoted by the bot. tags: - Member Management requestBody: required: true content: application/json: schema: type: object required: - chat_id - user_id - custom_title properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat user_id: type: integer description: Unique identifier of the target user custom_title: type: string description: New custom title for the administrator (0-16 characters) responses: '200': description: Custom title set successfully content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /approveChatJoinRequest: post: operationId: approveChatJoinRequest summary: Approve Chat Join Request description: Approve a chat join request. tags: - Member Management requestBody: required: true content: application/json: schema: type: object required: - chat_id - user_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat user_id: type: integer description: Unique identifier of the target user responses: '200': description: Join request approved content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /declineChatJoinRequest: post: operationId: declineChatJoinRequest summary: Decline Chat Join Request description: Decline a chat join request. tags: - Member Management requestBody: required: true content: application/json: schema: type: object required: - chat_id - user_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat user_id: type: integer description: Unique identifier of the target user responses: '200': description: Join request declined content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /setChatPhoto: post: operationId: setChatPhoto summary: Set Chat Photo description: Set a new profile photo for the chat. tags: - Chat Management requestBody: required: true content: multipart/form-data: schema: type: object required: - chat_id - photo properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat photo: type: string format: binary description: New chat photo as InputFile responses: '200': description: Chat photo set content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /deleteChatPhoto: post: operationId: deleteChatPhoto summary: Delete Chat Photo description: Delete a chat photo. tags: - Chat Management requestBody: required: true content: application/json: schema: type: object required: - chat_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat responses: '200': description: Chat photo deleted content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /setChatTitle: post: operationId: setChatTitle summary: Set Chat Title description: Change the title of a chat. tags: - Chat Management requestBody: required: true content: application/json: schema: type: object required: - chat_id - title properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat title: type: string description: New chat title (1-255 characters) responses: '200': description: Chat title updated content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /setChatDescription: post: operationId: setChatDescription summary: Set Chat Description description: Change the description of a group, a supergroup or a channel. tags: - Chat Management requestBody: required: true content: application/json: schema: type: object required: - chat_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat description: type: string description: New chat description (0-255 characters) responses: '200': description: Chat description updated content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /pinChatMessage: post: operationId: pinChatMessage summary: Pin Chat Message description: Add a message to the list of pinned messages in a chat. tags: - Chat Management requestBody: required: true content: application/json: schema: type: object required: - chat_id - message_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat message_id: type: integer description: Identifier of a message to pin disable_notification: type: boolean description: Pass true to notify all chat members silently responses: '200': description: Message pinned successfully content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /unpinChatMessage: post: operationId: unpinChatMessage summary: Unpin Chat Message description: Remove a message from the list of pinned messages in a chat. tags: - Chat Management requestBody: required: true content: application/json: schema: type: object required: - chat_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat message_id: type: integer description: Identifier of a message to unpin responses: '200': description: Message unpinned successfully content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /exportChatInviteLink: post: operationId: exportChatInviteLink summary: Export Chat Invite Link description: Generate a new primary invite link for a chat. tags: - Invites requestBody: required: true content: application/json: schema: type: object required: - chat_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat responses: '200': description: New invite link as string content: application/json: schema: $ref: '#/components/schemas/StringResponse' /createChatInviteLink: post: operationId: createChatInviteLink summary: Create Chat Invite Link description: Create an additional invite link for a chat. tags: - Invites requestBody: required: true content: application/json: schema: type: object required: - chat_id properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat name: type: string description: Invite link name (0-32 characters) expire_date: type: integer description: Point in time when the link will expire member_limit: type: integer description: Maximum number of users that can be chat members via this link creates_join_request: type: boolean description: True if users joining via this link need approval responses: '200': description: New invite link object content: application/json: schema: $ref: '#/components/schemas/ChatInviteLinkResponse' /revokeChatInviteLink: post: operationId: revokeChatInviteLink summary: Revoke Chat Invite Link description: Revoke an invite link created by the bot. tags: - Invites requestBody: required: true content: application/json: schema: type: object required: - chat_id - invite_link properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat invite_link: type: string description: The invite link to revoke responses: '200': description: Revoked invite link object content: application/json: schema: $ref: '#/components/schemas/ChatInviteLinkResponse' /answerCallbackQuery: post: operationId: answerCallbackQuery summary: Answer Callback Query description: Send answers to callback queries sent from inline keyboards. tags: - Messaging requestBody: required: true content: application/json: schema: type: object required: - callback_query_id properties: callback_query_id: type: string description: Unique identifier for the query to be answered text: type: string description: Text of the notification to display (0-200 characters) show_alert: type: boolean description: If true, alert instead of notification url: type: string description: URL to open upon button press cache_time: type: integer description: Maximum time in seconds for caching results (default 0) responses: '200': description: Callback query answered content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /setMyCommands: post: operationId: setMyCommands summary: Set My Commands description: Change the list of the bot commands. tags: - Bot Info requestBody: required: true content: application/json: schema: type: object required: - commands properties: commands: type: array items: $ref: '#/components/schemas/BotCommand' description: List of bot commands (max 100) scope: type: object description: Scope of users for which the commands are relevant language_code: type: string description: Two-letter ISO 639-1 language code responses: '200': description: Commands set successfully content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /getMyCommands: post: operationId: getMyCommands summary: Get My Commands description: Get the current list of the bot commands. tags: - Bot Info requestBody: content: application/json: schema: type: object properties: scope: type: object description: Scope of users for which commands are relevant language_code: type: string description: Two-letter ISO 639-1 language code responses: '200': description: Array of BotCommand objects content: application/json: schema: $ref: '#/components/schemas/BotCommandsResponse' /sendInvoice: post: operationId: sendInvoice summary: Send Invoice description: Send invoices. tags: - Payments requestBody: required: true content: application/json: schema: type: object required: - chat_id - title - description - payload - currency - prices properties: chat_id: oneOf: - type: integer - type: string description: Unique identifier for the target chat title: type: string description: Product name (1-32 characters) description: type: string description: Product description (1-255 characters) payload: type: string description: Bot-defined invoice payload (1-128 bytes) currency: type: string description: Three-letter ISO 4217 currency code prices: type: array items: $ref: '#/components/schemas/LabeledPrice' description: Price breakdown (list of components) provider_token: type: string description: Payment provider token (use empty string for Telegram Stars) responses: '200': description: Invoice message sent content: application/json: schema: $ref: '#/components/schemas/MessageResponse' /answerShippingQuery: post: operationId: answerShippingQuery summary: Answer Shipping Query description: Reply to shipping queries. tags: - Payments requestBody: required: true content: application/json: schema: type: object required: - shipping_query_id - ok properties: shipping_query_id: type: string description: Unique identifier for the query to be answered ok: type: boolean description: Pass true if delivery to the specified address is possible shipping_options: type: array items: type: object description: Required if ok is true. Array of available shipping options error_message: type: string description: Required if ok is false. Error message responses: '200': description: Shipping query answered content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /answerPreCheckoutQuery: post: operationId: answerPreCheckoutQuery summary: Answer Pre-Checkout Query description: Respond to pre-checkout queries. tags: - Payments requestBody: required: true content: application/json: schema: type: object required: - pre_checkout_query_id - ok properties: pre_checkout_query_id: type: string description: Unique identifier for the query to be answered ok: type: boolean description: Specify true if everything is alright for the order to proceed error_message: type: string description: Required if ok is false. Error message responses: '200': description: Pre-checkout query answered content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /createNewStickerSet: post: operationId: createNewStickerSet summary: Create New Sticker Set description: Create a new sticker set owned by a user. tags: - Stickers requestBody: required: true content: application/json: schema: type: object required: - user_id - name - title - stickers properties: user_id: type: integer description: User identifier of created sticker set owner name: type: string description: Short name of sticker set (1-64 characters) title: type: string description: Sticker set title (1-64 characters) stickers: type: array items: type: object description: List of 1-50 initial stickers to be added sticker_type: type: string enum: [regular, mask, custom_emoji] description: Type of stickers in the set responses: '200': description: Sticker set created content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' /addStickerToSet: post: operationId: addStickerToSet summary: Add Sticker to Set description: Add a new sticker to a set created by the bot. tags: - Stickers requestBody: required: true content: application/json: schema: type: object required: - user_id - name - sticker properties: user_id: type: integer description: User identifier of sticker set owner name: type: string description: Sticker set name sticker: type: object description: Sticker object with emoji list and optional keywords responses: '200': description: Sticker added to set content: application/json: schema: $ref: '#/components/schemas/BooleanResponse' components: securitySchemes: BotToken: type: apiKey in: path name: token description: Bot authentication token obtained from @BotFather (embedded in URL path) schemas: BooleanResponse: type: object properties: ok: type: boolean result: type: boolean StringResponse: type: object properties: ok: type: boolean result: type: string IntegerResponse: type: object properties: ok: type: boolean result: type: integer MessageIdResponse: type: object properties: ok: type: boolean result: type: object properties: message_id: type: integer UserResponse: type: object properties: ok: type: boolean result: $ref: '#/components/schemas/User' MessageResponse: type: object properties: ok: type: boolean result: $ref: '#/components/schemas/Message' UpdatesResponse: type: object properties: ok: type: boolean result: type: array items: $ref: '#/components/schemas/Update' WebhookInfoResponse: type: object properties: ok: type: boolean result: $ref: '#/components/schemas/WebhookInfo' UserProfilePhotosResponse: type: object properties: ok: type: boolean result: $ref: '#/components/schemas/UserProfilePhotos' FileResponse: type: object properties: ok: type: boolean result: $ref: '#/components/schemas/File' ChatResponse: type: object properties: ok: type: boolean result: $ref: '#/components/schemas/Chat' ChatMembersResponse: type: object properties: ok: type: boolean result: type: array items: $ref: '#/components/schemas/ChatMember' ChatMemberResponse: type: object properties: ok: type: boolean result: $ref: '#/components/schemas/ChatMember' ChatInviteLinkResponse: type: object properties: ok: type: boolean result: $ref: '#/components/schemas/ChatInviteLink' BotCommandsResponse: type: object properties: ok: type: boolean result: type: array items: $ref: '#/components/schemas/BotCommand' User: type: object properties: id: type: integer description: Unique identifier for this user or bot is_bot: type: boolean description: True if this user is a bot first_name: type: string description: User's or bot's first name last_name: type: string description: User's or bot's last name username: type: string description: User's or bot's username language_code: type: string description: IETF language tag of the user's language is_premium: type: boolean description: True if this user is a Telegram Premium user required: - id - is_bot - first_name Message: type: object properties: message_id: type: integer description: Unique message identifier inside a chat from: $ref: '#/components/schemas/User' chat: $ref: '#/components/schemas/Chat' date: type: integer description: Date the message was sent in Unix time text: type: string description: For text messages, the actual UTF-8 text of the message caption: type: string description: Caption for the animation, audio, document, photo, video or voice required: - message_id - date - chat Update: type: object properties: update_id: type: integer description: The update's unique identifier message: $ref: '#/components/schemas/Message' edited_message: $ref: '#/components/schemas/Message' callback_query: type: object description: New incoming callback query required: - update_id Chat: type: object properties: id: type: integer description: Unique identifier for this chat type: type: string enum: [private, group, supergroup, channel] description: Type of chat title: type: string description: Title for supergroups, channels and group chats username: type: string description: Username for private chats, supergroups and channels first_name: type: string description: First name of the other party in a private chat last_name: type: string description: Last name of the other party in a private chat description: type: string description: Description for groups, supergroups and channel chats invite_link: type: string description: Primary invite link for the chat member_count: type: integer description: Number of members in a chat required: - id - type ChatMember: type: object properties: status: type: string enum: [creator, administrator, member, restricted, left, kicked] description: The member's status in the chat user: $ref: '#/components/schemas/User' required: - status - user ChatInviteLink: type: object properties: invite_link: type: string description: The invite link creator: $ref: '#/components/schemas/User' creates_join_request: type: boolean description: True if users joining via the link need to be approved is_primary: type: boolean description: True if the link is primary is_revoked: type: boolean description: True if the link is revoked name: type: string description: Invite link name expire_date: type: integer description: Point in time when the link will expire or has been expired member_limit: type: integer description: Maximum number of users that can be chat members pending_join_request_count: type: integer description: Number of pending join requests required: - invite_link - creator - creates_join_request - is_primary - is_revoked ChatPermissions: type: object properties: can_send_messages: type: boolean description: True if the user is allowed to send text messages can_send_audios: type: boolean description: True if the user is allowed to send audios can_send_documents: type: boolean description: True if the user is allowed to send documents can_send_photos: type: boolean description: True if the user is allowed to send photos can_send_videos: type: boolean description: True if the user is allowed to send videos can_send_polls: type: boolean description: True if the user is allowed to send polls can_send_other_messages: type: boolean description: True if the user is allowed to send animations, games, stickers can_add_web_page_previews: type: boolean description: True if the user is allowed to add web page previews to messages can_change_info: type: boolean description: True if the user is allowed to change chat title, photo and settings can_invite_users: type: boolean description: True if the user is allowed to invite new users to the chat can_pin_messages: type: boolean description: True if the user is allowed to pin messages WebhookInfo: type: object properties: url: type: string description: Webhook URL, may be empty if webhook is not set up has_custom_certificate: type: boolean description: True if a custom certificate was provided pending_update_count: type: integer description: Number of updates awaiting delivery ip_address: type: string description: Currently used webhook IP address last_error_date: type: integer description: Unix time for the most recent error last_error_message: type: string description: Error message in human-readable format for the most recent webhook error max_connections: type: integer description: Maximum allowed number of simultaneous HTTPS connections allowed_updates: type: array items: type: string description: List of update types the bot is subscribed to required: - url - has_custom_certificate - pending_update_count UserProfilePhotos: type: object properties: total_count: type: integer description: Total number of profile pictures the target user has photos: type: array items: type: array items: type: object description: Requested profile pictures (in up to 4 sizes each) required: - total_count - photos File: type: object properties: file_id: type: string description: Identifier for this file, which can be used to download or reuse the file file_unique_id: type: string description: Unique identifier for this file (stable across bots) file_size: type: integer description: File size in bytes file_path: type: string description: File path. Use https://api.telegram.org/file/bot/ to get the file. required: - file_id - file_unique_id BotCommand: type: object properties: command: type: string description: Text of the command (1-32 characters, lowercase, no spaces) description: type: string description: Description of the command (3-256 characters) required: - command - description LabeledPrice: type: object properties: label: type: string description: Portion label amount: type: integer description: Price of the product in the smallest units of the currency required: - label - amount