Skip to main content

Telegram

Send and read messages as your own Telegram bot.

Connect it with: API key. Telegram's own documentation: https://core.telegram.org/bots/api#authorizing-your-bot.

What agents can do​

Connect Telegram so the agents working your tasks can reach it. With it connected, they can:

  • Send a message to a chat, group or channel, for example a release note or an alert.
  • Read the messages people send to the bot and act on them.
  • Post files and photos to a chat.
  • Pin or edit the bot's own messages.

Before you start​

  • A Telegram account to talk to @BotFather.
  • The bot added to each group or channel it should post to; in a channel it must be an administrator with Post Messages.
  • A Jaah account. Anyone can add a personal secret; an organization secret needs an Org Owner or Admin.

Connect with Telegram​

Jaah connects to Telegram with an API key, not with a sign-in button.

Connect with an API key​

Find each value first:

  • Bot token: In Telegram, open a chat with @BotFather and send /newbot (or /token for a bot you already have). Copy the token it replies with, in the form 123456789:AAH4hk-example-token.

Then add it to Jaah:

  1. In Jaah, open Secrets, select New, and pick the Telegram card.
  2. Name the secret and choose who can use it.
  3. Fill in Bot token.
  4. Select Save. Jaah tests the secret straight away (see Test the connection).

Jaah encrypts what you type and never shows it again — not to you, and not to an admin.

Use your own OAuth app​

Not used: Jaah connects to Telegram with an API key, not through an OAuth app.

Test the connection​

Select Test on the secret. Jaah makes one read-only call to Telegram with the stored values and shows the result on the secret's page. Jaah also tests automatically when you save or reconnect.

Who can use it​

Every secret has an owner, and the owner decides who can use it:

  • Personal — only your own tasks can use it. This is the default.
  • Organization — every task in the organization can use it. Only Org Owners and Admins can choose this.
  • Attached to a project — every task on that project can use it, whoever started the task. See Attach a secret to a project.

More on owners and access: How secrets work.

Use it in an agent session​

An agent asks for the secret with its credential_get tool, by the secret's path, when it needs it, and gets the values for that one call. The path is the owner's prefix and the secret's name:

  • org/<name> for an organization secret,
  • projects/<project>/<name> for one attached to a project,
  • me/<name> for your personal one.

A key connection hands the agent its fields: bot_token.

Tell the agent in your task description which secret to use, for example “use the Telegram secret org/telegram”.

Manage, rotate or disconnect​

Everything is on the secret's page under Secrets:

  • Rotate a key: create a new key at the vendor first, then select Replace on the secret and paste it. Revoke the old key at Telegram once the test passes. Steps: Replace or delete a secret.
  • Disconnect: select Delete. The stored values are destroyed and agents lose access on their next call. To end access at Telegram's side too, revoke or delete the key at Telegram.

Limitations​

  • A bot cannot start a conversation with a person: they must message the bot first (or add it to a group) before it can write to them.
  • In groups a bot sees only commands and replies to it unless its privacy mode is turned off with /setprivacy in @BotFather.
  • This connection is a bot your organization owns. Jaah's own Telegram notifications to you are set up separately under your profile and do not use it.
  • Agents can do only what the connected Telegram account allows.

Troubleshooting​

Test says the bot token was rejected

The token was revoked or mistyped. Send /token to @BotFather, pick the bot, copy the new token and select Replace on the secret.

The agent gets 403 Forbidden: bot was blocked by the user

That person blocked or never started the bot. Ask them to open the bot and press Start.

The agent gets 400 Bad Request: chat not found

The chat ID is wrong or the bot is not a member. Add the bot to the group or channel, then send it a message so the chat appears in getUpdates.

Still stuck? Select Test and read the result: it names the value Telegram refused and the status it answered.

FAQ​

How does an agent find a chat ID?

Have someone message the bot or add it to the group, then the agent calls getUpdates and reads message.chat.id. A public channel can also be addressed as @channelname.

Can I reuse one bot for several projects?

Yes. Attach the same secret to each project, or create one bot per project in @BotFather if you want their messages kept apart.

Can Jaah or an admin see the key or token?

No. Jaah stores it encrypted and never shows it again. Only the tasks allowed to use the secret receive it, at the moment they ask for it.

Can I connect more than one Telegram account?

Yes. Add one secret per account, each with its own name, and tell the agent which one to use.