Telegram API Key Walkthrough
Simple Step-by-Step Guide
Last updated
Simple Step-by-Step Guide
Last updated
Open Telegram and start a chat with BotFather.
Type the command /newbot
to create a new bot.
Follow the prompts to:
Set a name for your bot.
Set a unique username (must end in bot
).
Once done, you’ll receive a bot token (e.g., 123456789:ABCdefGhIjKlmNoPQRstuVWXyz
).
More detailed tutorial here -
Keep this token secure. You’ll use it later on aigent.run.
Paste your bot token into the Bot Token field.
Click Save.
Use the Test Credentials button to check that the bot is connected correctly.
Create a new Telegram group or use one where you're already an admin.
Add your newly created bot to the group.
Once added, tap the group name → Manage Group → Administrators.
Promote your bot to Administrator status.
To get the chat ID you have to follow these steps:
Add @myidbot to the group you want to enable the agent in, and make it an Admin.
To get the Thread ID, the easiest way is this: Post a message to that topic, then right-click on it and select Copy Message Link
. Paste it on a notepad and notice that it has the following structure https://t.me/c/XXXXXXXXXX/YY/ZZ
. The Thread ID is YY
(integer).
Go back to the Configuration tab on aigent.run.
Paste the Chat ID into the appropriate field.
Click Send Test Message.
If everything is set up correctly, you’ll receive a message in your Telegram group saying:
"This is a test message from your AIgent."
That’s it! Your Telegram bot is now ready to send messages through aigent.run.
Visit and go to the Configuration tab.
Contact the bot and send the /getid
command to get your personal chat ID, or invite it into a group and use the /getgroupid
command to get the group chat ID.