Many Telegram tools — scrapers, schedulers, multi-account managers, Python scripts with Telethon or Pyrogram — ask for two values before they work: an API ID and an API hash. This guide shows how to get your Telegram API ID and hash step by step, how to fix the common “ERROR” when creating an app, and how to keep the keys safe.
What Are the Telegram API ID and API Hash?
Telegram has two different APIs:
| Bot API | Telegram API (MTProto) | |
|---|---|---|
| Works as | A bot created with @BotFather | A normal user account |
| Credential | Bot token | API ID + API hash, then login with phone number |
| Typical use | Auto-replies, notifications, n8n/Zapier workflows | Desktop tools, userbots, account managers, reading groups as a user |
The API ID is a number and the API hash is a 32-character string. Together they identify the application that connects to Telegram — not your account. You still log in with a phone number and code (or a session file) afterwards.
How to Get Your Telegram API ID and Hash (Step by Step)
- Open my.telegram.org in a browser (the official domain only).
- Enter your phone number in international format, e.g.
+44…, and press Next. - Telegram sends a confirmation code inside the Telegram app (not by SMS). Paste it into the page.
- Click API development tools.
- Fill the form: App title (any name, e.g. “My Tool”), Short name (5–32 letters/numbers), Platform (Desktop is fine), description optional. URL can stay empty.
- Click Create application.
- Copy the App api_id and App api_hash shown on the page and store them safely.
Each account can create one application; when you come back to the page later, it shows the same API ID and hash.
Fixing “ERROR” When Creating a Telegram App
A very common problem: you press Create application and get a pop-up saying only “ERROR”. Things that usually help:
- Turn off VPN/proxy or switch to a clean connection from your own country.
- Disable ad blockers and browser extensions, or try a private window / another browser.
- Use a simple app title and short name — letters only, no spaces or special characters, and not containing the word “telegram”.
- Try from an older, active account. Very new or restricted accounts are more likely to fail.
- Wait a while and try again later instead of retrying many times in a row.
If you didn’t receive the login code, check Telegram on your phone or desktop — the code arrives as a message from the official “Telegram” service account.
Do You Need Your Own API ID for Every Tool?
Not always. Some tools use built-in keys, some let you enter your own. Using your own API ID and hash is useful when a tool asks for it, when you run your own scripts, or when you want to keep different projects separate. One API ID can be used to log in to many accounts — the keys belong to the app, not to each account.
TELEGRAM MKT PRO, our Windows software, works with session and tdata accounts directly, so you can manage many accounts without writing code. If you are comparing approaches, read Telegram API vs third-party marketing tools.
Keep Your API Hash Safe
- Never share your API hash or your login code with anyone — not “support agents”, not giveaways. Telegram staff will never ask for it.
- Only enter credentials on my.telegram.org. Fake copies of the page are used to steal accounts.
- Don’t commit keys to public GitHub repositories; use environment variables or a config file kept private.
- Keep two-step verification on. See How to secure a Telegram account.
API Limits and Account Safety
Having an API ID does not change Telegram’s rules. Accounts connected through the API can still be spam-limited or frozen if they message strangers in bulk or join too many groups quickly. Respect flood-wait errors (they tell you to slow down) — see the Telegram API rate limit guide — and if an account does get restricted, follow what to do when a Telegram account is frozen or banned.
FAQ
Is the Telegram API ID free?
Yes. Creating an application on my.telegram.org is free.
Can I change or delete my API hash?
The page doesn’t offer a simple “regenerate” button. If you think your hash leaked, end unknown sessions in Settings → Devices and stop using tools you don’t trust.
Why does the code not arrive by SMS?
my.telegram.org sends the code to your Telegram app. Open Telegram on any logged-in device to see it.
Is “telegram api key” the same as API hash?
People use “API key” loosely. For user-account tools it means API ID + API hash; for bots it means the bot token from @BotFather.
Need help setting up a tool?
Message @teleproaz for a free demo of TELEGRAM MKT PRO.

