Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Telegram Bot

Simplified HTTP version of the MTProto API for bots

This event API exposes 2 operations across 2 channels, and defines 21 schemas. It is described by AsyncAPI 2.6.0, at version 8.0.

The API connects through 2 servers: api.telegram.org (https), {webhookHost}:{webhookPort} (https).

2 operations 2 channels 21 schemas

Metadata

The identity and technical contract details declared by the specification.

Specification
AsyncAPI 2.6.0
API Version
8.0
Base URL
https://core.telegram.org/bots/api
Resource Areas
1

Channels & Operations 2

Across 2 channels, the API surfaces 2 operations. Each is listed below with its action, channel, parameters, and response codes.

Channels 2
SUB
/bot{token}/getUpdates
Long-poll for pending updates.
getUpdates 1 param body
PUB
/webhook
Receive a single Update via HTTPS POST.
receiveWebhookUpdate body

Messages & Schemas 21

The contract defines 21 schemas that model the data carried by its messages. The most detailed are Update (24 properties), GetUpdatesResponseBody (2 properties). Each schema is shown below with its type and property counts.

GetUpdatesResponse
message
Successful response body from getUpdates.
WebhookUpdate
message
HTTPS POST body sent by Telegram for each new event.
GetUpdatesResponseBody
object
Standard Telegram Bot API response envelope wrapping the array of Update objects returned by getUpdates.
2 properties 2 required
Update
object
This object represents an incoming update. At most ONE of the optional parameters can be present in any given update.
24 properties 1 required
Message
object
This object represents a message. See the full field list at https://core.telegram.org/bots/apimessage
BusinessConnection
object
Describes the connection of the bot with a business account. See https://core.telegram.org/bots/apibusinessconnection
BusinessMessagesDeleted
object
Received when messages are deleted from a connected business account. See https://core.telegram.org/bots/apibusinessmessagesdeleted
MessageReactionUpdated
object
This object represents a change of a reaction on a message performed by a user. See https://core.telegram.org/bots/apimessagereactionupdated
MessageReactionCountUpdated
object
This object represents reaction changes on a message with anonymous reactions. See https://core.telegram.org/bots/apimessagereactioncountupdated
InlineQuery
object
This object represents an incoming inline query. See https://core.telegram.org/bots/apiinlinequery
ChosenInlineResult
object
Represents a result of an inline query that was chosen by the user and sent to their chat partner. See https://core.telegram.org/bots/apichoseninlineresult
CallbackQuery
object
This object represents an incoming callback query from a callback button in an inline keyboard. See https://core.telegram.org/bots/apicallbackquery
ShippingQuery
object
This object contains information about an incoming shipping query. See https://core.telegram.org/bots/apishippingquery
PreCheckoutQuery
object
This object contains information about an incoming pre-checkout query. See https://core.telegram.org/bots/apiprecheckoutquery
PaidMediaPurchased
object
This object contains information about a paid media purchase. See https://core.telegram.org/bots/apipaidmediapurchased
Poll
object
This object contains information about a poll. See https://core.telegram.org/bots/apipoll
PollAnswer
object
This object represents an answer of a user in a non-anonymous poll. See https://core.telegram.org/bots/apipollanswer
ChatMemberUpdated
object
This object represents changes in the status of a chat member. See https://core.telegram.org/bots/apichatmemberupdated
ChatJoinRequest
object
Represents a join request sent to a chat. See https://core.telegram.org/bots/apichatjoinrequest
ChatBoostUpdated
object
This object represents a boost added to a chat or changed. See https://core.telegram.org/bots/apichatboostupdated
ChatBoostRemoved
object
This object represents a boost removed from a chat. See https://core.telegram.org/bots/apichatboostremoved

Specification

The full machine-readable AsyncAPI contract behind this narrative.

Source

asyncapi.yaml Raw ↑