> This page is for English.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.tgnow.cc/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.tgnow.cc/_mcp/server.

# Telegram API

Every app that connects to Telegram identifies itself with an **API ID** and **API Hash** pair. Telegram itself issues the pair on my.telegram.org. The settings live on the [Accounts](/en/accounts/manager) page: the **Account settings** gear → **Telegram API** tab.

## Shared API ID and Hash

You need the pair if you sign in by phone number, use the [Authorizer](/en/accounts/authorizer) or upload `.session` files without JSON. Sessions with JSON take the pair from it, and `tdata` uses the Telegram Desktop pair. Changing the pair doesn't affect sessions that are already running.

How to get a pair:

1. Sign in to [my.telegram.org](https://my.telegram.org) with your number. The code arrives in the “Telegram” chat in the app, not by SMS.
2. Open **API development tools**, fill in **App title** and **Short name** (5 to 32 Latin characters) and click **Create application**.
3. Copy **App api_id** (a number) and **App api_hash** (32 characters) into the **API ID** and **API Hash** fields, then click **Save**.

> **Warning**
>
> The API Hash is a secret. Don't publish it or send it in chats.

## Telethon session profile

How an account presents itself to Telegram: device, system, app version, languages. The profile from the settings goes to `tdata`, `.session` files without JSON and new [Reauthorizer](/en/accounts/reauthorizer) sessions. Changing it doesn't affect existing accounts.

By default, every field is set to `opentele2:auto`: each account gets its own stable Telegram Desktop for Windows profile. Your own options are written like this: `{Desktop|PC|Laptop}`.

## The Other tab

Settings shared by your whole workspace, applied from the next connection.

| Field                                   | Default        | Range      |
| --------------------------------------- | -------------- | ---------- |
| **Connection timeout**                  | usually 30 sec | 1–300 sec  |
| **Connection attempts**                 | 4              | 1–10       |
| **Max. delay between reconnects**       | 300 sec        | 5–1800 sec |
| **How long to wait for a join request** | 10 min         | 1–1440 min |

The last field is used by [Chat spammer](/en/modules/chat-spammer) for chats you can only join by request.

**Show accounts as online** is off by default. Turned on, it makes accounts look more alive, but the chance of unwanted attention is a bit higher.

## Tips

* Leave `opentele2:auto`: a hundred identical devices look more suspicious than different ones.
* Mobile or slow proxies: raise the **Connection timeout** to 60 sec.
* The site replies “ERROR”: turn off your VPN and ad blockers or try another browser.
* “Could not save”: check the hash for an extra space with **Show hash**.