Skip to navigation

Telegram API

API ID and Hash, device profile and Telegram connection settings

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 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 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 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.

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 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.

FieldDefaultRange
Connection timeoutusually 30 sec1–300 sec
Connection attempts41–10
Max. delay between reconnects300 sec5–1800 sec
How long to wait for a join request10 min1–1440 min

The last field is used by 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.