Telegram Client API Swagger
An interactive reference for the Telegram Client API (MTProto). Find a method, inspect its parameters, response examples and RPC errors, then run a request in the browser with your own Telegram session.
For developers building Telegram clients, integrations and automation tools who need to know which method to call and what Telegram returns.
All methods Explore an example method
Site revision · 38e510b
Use OpenAPI in your own tools
Download the OpenAPI specification for the Telegram Client API and reuse it in your own tools.
- Import it into Postman or another tool that supports OpenAPI to build request collections and test cases.
- Use the schemas in your own documentation, form builders, or JSON validation tools.
- Use method descriptions and input schemas as a starting point for MCP tools backed by a Telegram client.
To run requests outside this site, connect your tool to an MTProto client or an HTTP adapter.
OpenAPI JSON is available in 15 languages. The file downloads in the selected language.
The source code is open under the MIT license. GitHub stars help more developers discover the project. Star on GitHub
How it works
The build turns the Telegram TL schema into OpenAPI and static method pages. You can inspect request and response schemas before running a method.
Method and field descriptions are also taken from the official Telegram documentation where available.
Libraries and tooling
Teleproto handles MTProto. big-integer preserves 64-bit values. esbuild bundles the browser client, and Python generates the static pages.
Updates
Published version: Teleproto 1.236.0 · TL 236
Every day, GitHub Actions compares the Teleproto release tagged latest on npm with the pinned version. When a newer stable release appears, it reads the TL schema from the exact release commit and reports new, removed and changed methods.
The workflow checks the TL layer, runs tests and a preview build, and opens an update PR. After merge, GitHub Pages rebuilds the catalog and its OpenAPI files.
Security and privacy
On GitHub Pages, requests go from your browser to Telegram over WebSocket. The app stores connection credentials in this tab’s session storage. Clear the session to remove them from the tab.
How request testing works
Example: ask Telegram for the current account’s profile. The inputUserSelf value tells Telegram to use the current account.
What you enter in our editor
On the users.getFullUser page, the request editor contains only this JSON. The method name comes from the page you opened.
{
"id": { "_": "inputUserSelf" }
}
1. OpenAPI describes the request as POST
The path and JSON describe the operation for tools such as Postman. GitHub Pages serves the specification and has no handler for this POST.
POST /catalog/users.getFullUser
Content-Type: application/json
{
"id": { "_": "inputUserSelf" }
}
2. The browser sends the real request over MTProto
When you click Run request, Teleproto takes the method name and JSON fields, encodes them as a binary MTProto request, and sends it directly to Telegram over WebSocket. The app turns Telegram’s reply into JSON for display. Before execution, the interface shows a schema example.
Teleproto replaces the method and constructor names with their TL identifiers. Here are the eight bytes of this call before transport headers, wrappers and encryption. Each identifier is written with its least significant byte first.
users.getFullUser#b60f5918 id:InputUser = users.UserFull
inputUserSelf#f7c1b13f = InputUser
18 59 0f b6 | 3f b1 c1 f7
MTProto wraps the TL bytes with service fields such as the server salt, session ID, message ID, sequence number and length. It also adds random padding.
Teleproto uses the authorization key from the session and computes a message key. MTProto 2.0 derives the encryption key and IV from these values with SHA-256 and encrypts the packet body with AES-256-IGE. The outgoing packet carries the key ID, the message key and the encrypted body. The authorization key stays with the client and Telegram.
auth_key_id | msg_key | AES-256-IGE(…)
TL → MTProto → WebSocket → Telegram
JSON ← TL ← MTProto ← Telegram
The hex bytes above show the TL payload only. The actual WebSocket frame contains the encrypted packet with transport framing. Telegram processes the call, returns a TL reply, and Teleproto decrypts and decodes it so the page can display JSON.
Telegram’s MTProto 2.0 specification
3. An HTTP adapter can receive POST requests
For Postman, point the request at a running adapter. The local Python server accepts the following request shape. Telethon encodes the Telegram call and the server returns the result as HTTP JSON.
POST /api/method/call
Content-Type: application/json
{
"method": "users.getFullUser",
"request": { "id": { "_": "inputUserSelf" } },
"confirmed": true
}
Only the operation fields are shown. The local adapter also needs an API ID and valid session credentials. The example uses no account secrets.