<!-- Generated by `just docs` from catalog/toolkits/telegram.yaml, catalog/expansions/telegram.yaml, catalog/evals/scorecard.json. Edit the source, not this file. -->

# Telegram

Messaging bots. Send and edit text, photo, and document messages, pin them, run polls, and administer a group and its members.

| Property | Value |
| --- | --- |
| Slug | `telegram` |
| Definition version | `0.1.0` |
| Base URL | `https://api.telegram.org` |
| Auth schemes | `api_key` |
| Action tools | 28 |
| By class | 6 read, 20 write, 2 destructive |
| Triggers | 0 |
| Provider rate limit | not declared, so outbound calls are unpaced |

## Measured routing accuracy

40 golden cases replayed through the router over the whole index: measured over corpus `ea4f12ad2948` (65 toolkits, 2283 tools indexed and 13 declared uncallable), 28 cases written by hand and 12 cases from the paraphrase pass. A case counts as top-1 when its gold tool ranked first and top-8 when it reached the slate at all.

| Measure | Cases | Share |
| --- | --- | --- |
| top-1 | 19/40 | 47.5% |
| top-8 | 31/40 | 77.5% |

The sweep is offline: the reranker is a deterministic identity fake that returns candidates in the order retrieval produced them, so top-1 measures retrieval order rather than a reranked slate. `just eval-live` measures the same cases through the live reranker.

## Authentication

Connect an entity with `ConnectionsService.InitiateConnection`, naming this toolkit's slug. Credentials stay in the connections vault; callers hold connected-account ids only.

### `api_key`

| Property | Value |
| --- | --- |
| Placement | `header` |
| Name | `Authorization` |
| Rendered as | `Bearer {key}` |

Submit the key with `ConnectionsService` rather than putting it in a request; it is sealed at rest and never returned.

## Tools

28 action tools. The catalog-wide slug is `telegram.<tool>`, which is what `search_tools` returns and `call_tool` takes.

### `telegram.get_me`

Get the identity of the connected Telegram bot itself: its id, username, and display name. Use when the user asks which bot this integration is running as, or wants to confirm the bot token is working at all.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /getMe`.

Takes no arguments.

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `first_name` | string |  |
| `id` | integer |  |
| `is_bot` | boolean |  |
| `username` | string |  |

Also retrieved by: "which bot am I actually running as", "check that the bot token still works", "what's this integration's own identity", "show me this bot's own profile".

### `telegram.send_message`

Send a text message to a Telegram chat, group, or channel right now. Use when the user wants to send, post, message, or notify people on Telegram. Set reply_to_message_id to quote a specific earlier message, and parse_mode to send Markdown or HTML formatting.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /sendMessage`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Numeric chat id (as a string, e.g. "-1001234567890") or a public channel username, e.g. "@rudrite_updates". Resolve a chat name with get_chat. |
| `disable_notification` | boolean | no | Send silently, without a notification sound. Default false. |
| `parse_mode` | string | no | Formatting mode for text: "MarkdownV2" or "HTML". Omit for plain text. |
| `reply_to_message_id` | integer | no | Id of a message to quote as a reply. |
| `text` | string | **yes** | Message text, up to 4096 characters. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `chat` | object |  |
| `chat.id` | integer |  |
| `chat.title` | string |  |
| `date` | integer |  |
| `message_id` | integer |  |
| `text` | string |  |

Also retrieved by: "broadcast something to the whole group", "shout something out to the whole channel", "let the group know what's going on", "quote an earlier message when responding", "fire off a quick line in the chat", "ping everyone in the channel with an update".

### `telegram.send_photo`

Send a photo to a Telegram chat by its URL, with an optional caption. Use when the user wants to send, share, or post a picture or image on Telegram. For any other file type, use send_document instead.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /sendPhoto`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `caption` | string | no | Optional caption shown under the photo, up to 1024 characters. |
| `chat_id` | string | **yes** | Numeric chat id or "@channelusername" to send the photo to. |
| `photo` | string | **yes** | Publicly reachable URL of the image to send. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `caption` | string |  |
| `chat` | object |  |
| `chat.id` | integer |  |
| `date` | integer |  |
| `message_id` | integer |  |

Also retrieved by: "share a picture with the group", "post an image in the channel", "drop a screenshot into the chat", "send someone a picture by link".

### `telegram.send_document`

Send a file to a Telegram chat by its URL, with an optional caption. Use when the user wants to send, share, or attach a document, PDF, or other file on Telegram. For an image meant to display inline, use send_photo instead.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /sendDocument`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `caption` | string | no | Optional caption shown with the file, up to 1024 characters. |
| `chat_id` | string | **yes** | Numeric chat id or "@channelusername" to send the document to. |
| `document` | string | **yes** | Publicly reachable URL of the file to send. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `chat` | object |  |
| `chat.id` | integer |  |
| `date` | integer |  |
| `document` | object |  |
| `document.file_name` | string |  |
| `message_id` | integer |  |

Also retrieved by: "attach a PDF to the chat", "share a file with the group", "send over that spreadsheet as an attachment", "drop a report into the channel".

### `telegram.edit_message_text`

Change the text of a message the bot already sent. Use when the user wants to fix, correct, or update a Telegram message that was already posted. Only messages the bot itself sent can be edited, and only while they are recent enough for Telegram to allow it.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /editMessageText`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id containing the message. |
| `message_id` | integer | **yes** | Id of the message to edit. |
| `parse_mode` | string | no | Formatting mode for the new text: "MarkdownV2" or "HTML". |
| `text` | string | **yes** | Replacement text for the whole message. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `edit_date` | integer |  |
| `message_id` | integer |  |
| `text` | string |  |

Also retrieved by: "fix a typo in something the bot posted", "reword what got sent earlier", "clean up the wording in the last post", "change what was typed by mistake".

### `telegram.delete_message`

Delete one message from a Telegram chat. Use when the user wants to remove, retract, or take down a message. Permanent: the message cannot be restored, and the bot must be an admin to delete a message it did not send itself.

Class `destructive` (held by the mutation gate until the call's own arguments carry `"confirm": true`). No scopes beyond the connection's defaults. Calls `POST /deleteMessage`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id containing the message. |
| `message_id` | integer | **yes** | Id of the message to delete. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "take back something that got posted", "erase a post someone regrets sending", "pull down what was just written in the chat", "undo a message sent by mistake", "wipe one bad post out of the group".

### `telegram.forward_message`

Forward an existing message, as-is, from one chat into another. Use when the user wants to forward, relay, or repost a message somewhere else on Telegram without retyping it.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /forwardMessage`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id to forward the message into. |
| `from_chat_id` | string | **yes** | Chat id the original message is in. |
| `message_id` | integer | **yes** | Id of the message to forward. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `chat` | object |  |
| `chat.id` | integer |  |
| `date` | integer |  |
| `message_id` | integer |  |

Also retrieved by: "relay this post into another group", "repost something without retyping it", "send this along to a different channel", "share the exact same message elsewhere".

### `telegram.get_updates`

Poll for new incoming messages, edits, and other events the bot has not yet seen. Use when the user wants to check, fetch, or catch up on new Telegram activity. Pass offset one past the highest update_id already handled to avoid seeing the same update twice.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /getUpdates`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `limit` | integer | no | Maximum updates to return, up to 100. Default 100. |
| `offset` | integer | no | Only return updates with an id greater than or equal to this. |
| `timeout` | integer | no | Long-poll timeout in seconds. Default 0 (return immediately). |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `updates` | array of object |  |
| `updates[].message` | object |  |
| `updates[].message.chat` | object |  |
| `updates[].message.date` | integer |  |
| `updates[].message.from` | object |  |
| `updates[].message.message_id` | integer |  |
| `updates[].message.text` | string |  |
| `updates[].update_id` | integer |  |

Also retrieved by: "what did I miss since last time", "check for any new incoming messages", "catch up on activity the bot hasn't seen yet", "pull the latest events waiting for the bot".

### `telegram.send_chat_action`

Show a transient status, like "typing" or "uploading photo", in a chat. Use when the user wants the bot to look like it's actively working before a slower response lands. The indicator clears itself after about five seconds or as soon as a message is sent.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /sendChatAction`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `action` | string | **yes** | Status to show: "typing", "upload_photo", "upload_document", "record_voice", or "choose_sticker". |
| `chat_id` | string | **yes** | Chat id to show the status in. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "make it look like the bot is typing", "show a working indicator before the answer lands", "flash the uploading status while a file is prepared".

### `telegram.pin_chat_message`

Pin a message to the top of a chat. Use when the user wants to pin, highlight, or keep a Telegram message easy to find later. Reversible with unpin_chat_message.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /pinChatMessage`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id containing the message. |
| `disable_notification` | boolean | no | Pin without notifying every chat member. Default false. |
| `message_id` | integer | **yes** | Id of the message to pin. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "stick that message to the top of the group", "highlight a post so it's easy to find later", "keep this one visible for everyone", "flag a message as important in the chat".

### `telegram.unpin_chat_message`

Remove one message from a chat's pinned list. Use when the user wants to unpin a specific message. Omit message_id to unpin whichever message is currently pinned most recently. For clearing every pin at once, use unpin_all_chat_messages.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /unpinChatMessage`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id containing the message. |
| `message_id` | integer | no | Id of the message to unpin. Omit to unpin the most recent pin. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "take that pinned post off the top", "stop highlighting a message that's no longer relevant", "clear a pin from the chat header", "remove something from the pinned list".

### `telegram.unpin_all_chat_messages`

Clear every pinned message in a chat at once. Use when the user wants to unpin everything, clear all pins, or start a chat's pinned list over. Only affects pinned status; the messages themselves stay in the chat. For a single pin, use unpin_chat_message.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /unpinAllChatMessages`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id to clear all pins from. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "clear every pin in this group at once", "start the pinned list over from scratch", "wipe out all the highlighted posts together".

### `telegram.send_poll`

Post a poll or quiz to a chat with a question and answer options. Use when the user wants to run, create, or send a poll or vote on Telegram. Set type to "quiz" for a single correct answer instead of an open vote.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /sendPoll`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `allows_multiple_answers` | boolean | no | Let a voter pick more than one option. Default false. |
| `chat_id` | string | **yes** | Chat id to post the poll in. |
| `is_anonymous` | boolean | no | Hide who voted for what. Default true. |
| `options` | array of string | **yes** | 2 to 10 answer options. |
| `question` | string | **yes** | The poll's question text, up to 300 characters. |
| `type` | string | no | "regular" for an open vote or "quiz" for one correct answer. Default "regular". |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `message_id` | integer |  |
| `poll` | object |  |
| `poll.id` | string |  |
| `poll.is_closed` | boolean |  |
| `poll.options` | array of object |  |
| `poll.options[].text` | string |  |
| `poll.options[].voter_count` | integer |  |
| `poll.question` | string |  |

Also retrieved by: "run a quick vote in the group", "ask everyone to pick an option", "set up a quiz with a right answer", "see what people prefer with a poll".

### `telegram.stop_poll`

Close a poll early so no more votes are accepted, and get its final results. Use when the user wants to end, close, or finalize a Telegram poll before it would otherwise stay open.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /stopPoll`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id the poll was sent to. |
| `message_id` | integer | **yes** | Id of the message the poll was sent as. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `id` | string |  |
| `is_closed` | boolean |  |
| `options` | array of object |  |
| `options[].text` | string |  |
| `options[].voter_count` | integer |  |
| `question` | string |  |

Also retrieved by: "end the vote early and show results", "close out that quiz now", "lock in the final poll numbers".

### `telegram.get_chat`

Get a Telegram chat's details: its type, title, username, and description. Use when the user asks about a specific group, channel, or conversation as a whole, or wants to resolve a chat's invite link.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /getChat`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Numeric chat id or "@channelusername" to look up. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `description` | string |  |
| `id` | integer |  |
| `invite_link` | string |  |
| `title` | string |  |
| `type` | string |  |
| `username` | string |  |

Also retrieved by: "tell me about this particular group", "what's the description on this channel", "give me the basics on one chat", "look up this group's invite link".

### `telegram.get_chat_administrators`

List every admin and the owner of a chat, with their status and custom title. Use when the user asks who moderates or owns a Telegram group or channel. For one member's own status, use get_chat_member.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /getChatAdministrators`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id to list admins from. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `administrators` | array of object |  |
| `administrators[].custom_title` | string |  |
| `administrators[].status` | string |  |
| `administrators[].user` | object |  |
| `administrators[].user.first_name` | string |  |
| `administrators[].user.id` | integer |  |
| `administrators[].user.username` | string |  |

Also retrieved by: "who moderates this group", "show me everyone with admin powers here", "who runs this channel", "list the mods for this chat".

### `telegram.get_chat_member_count`

Get the total number of members in a chat. Use when the user asks how big a Telegram group or channel is, or how many people are in it.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /getChatMemberCount`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id to count members in. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `count` | integer |  |

Also retrieved by: "how many people are in this group", "how big is this channel", "what's the headcount for this chat".

### `telegram.get_chat_member`

Get one chat member's status by user id: whether they're the owner, an admin, a regular member, restricted, or banned. Use when the user asks about a specific person's standing in a Telegram chat. For every admin at once, use get_chat_administrators.

Class `read` (reads only). No scopes beyond the connection's defaults. Calls `GET /getChatMember`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id the member belongs to. |
| `user_id` | integer | **yes** | User id to look up. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `status` | string |  |
| `user` | object |  |
| `user.first_name` | string |  |
| `user.id` | integer |  |
| `user.username` | string |  |

Also retrieved by: "what's this person's standing in the group", "is this user still a member or were they banned", "look someone up by their id in this chat", "check if someone's an admin here".

### `telegram.set_chat_title`

Rename a Telegram group or channel. Use when the user wants to rename, retitle, or change the name of a chat. The bot needs admin rights in the chat.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /setChatTitle`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id to rename. |
| `title` | string | **yes** | New chat title, up to 128 characters. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "rename this group", "change the name shown on this channel", "give this chat a new title".

### `telegram.set_chat_description`

Change a Telegram group or channel's description text. Use when the user wants to update, edit, or set the description shown on a chat's info page. The bot needs admin rights in the chat.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /setChatDescription`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id to update. |
| `description` | string | **yes** | New description text, up to 255 characters. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "update the about text for this group", "change what shows in the channel's about text", "set what shows on the chat's info page".

### `telegram.ban_chat_member`

Ban a member from a group or channel, removing them and blocking them from rejoining until unban_chat_member is called. Use when the user wants to ban, permanently remove, or block someone on Telegram. Optionally deletes all of their messages in the chat via revoke_messages.

Class `destructive` (held by the mutation gate until the call's own arguments carry `"confirm": true`). No scopes beyond the connection's defaults. Calls `POST /banChatMember`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id to ban the member from. |
| `revoke_messages` | boolean | no | Also delete every message this user sent in the chat. Default false. |
| `until_date` | integer | no | Unix timestamp the ban lifts at. Omit or set more than 366 days out for a permanent ban. |
| `user_id` | integer | **yes** | User id of the person to ban. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "permanently remove a troublemaker from the group", "block someone from ever rejoining this channel", "kick someone out for good and wipe their messages".

### `telegram.unban_chat_member`

Lift a ban so the person can rejoin a group or channel. Use when the user wants to unban, reinstate, or forgive someone who was previously banned on Telegram. They still need a fresh invite to actually come back if the chat is private.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /unbanChatMember`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id to lift the ban on. |
| `only_if_banned` | boolean | no | Do nothing if the user isn't actually banned. Default false. |
| `user_id` | integer | **yes** | User id of the banned person. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "lift a ban on someone", "let a banned person back into the group", "forgive someone who was previously blocked", "reverse a ban so they can rejoin".

### `telegram.restrict_chat_member`

Limit what a member can do in a group without removing them: mute them, or stop them sending media, polls, or invite links. Use when the user wants to restrict, mute, or silence someone on Telegram. Restore full permissions by calling again with every flag true.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /restrictChatMember`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `can_add_web_page_previews` | boolean | no | Allow link previews in their messages. Default false. |
| `can_send_media_messages` | boolean | no | Allow sending photos, videos, and other media. Default false. |
| `can_send_messages` | boolean | no | Allow sending text messages. Default false. |
| `can_send_polls` | boolean | no | Allow sending polls. Default false. |
| `chat_id` | string | **yes** | Chat id the member belongs to. |
| `until_date` | integer | no | Unix timestamp the restriction lifts at. Omit for indefinite. |
| `user_id` | integer | **yes** | User id to restrict. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "mute someone in the group", "stop a person from sending media for a while", "silence a member without kicking them", "limit what someone's allowed to post here".

### `telegram.promote_chat_member`

Grant a member admin rights in a group or channel, such as deleting messages, inviting users, or pinning. Use when the user wants to promote, make an admin, or grant moderator powers to someone on Telegram. Call again with every right false to demote them.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /promoteChatMember`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `can_change_info` | boolean | no | Allow changing the chat's title, photo, and description. |
| `can_delete_messages` | boolean | no | Allow deleting other members' messages. |
| `can_invite_users` | boolean | no | Allow inviting new members. |
| `can_pin_messages` | boolean | no | Allow pinning messages. |
| `can_promote_members` | boolean | no | Allow granting admin rights to other members. |
| `can_restrict_members` | boolean | no | Allow restricting or banning other members. |
| `chat_id` | string | **yes** | Chat id the member belongs to. |
| `user_id` | integer | **yes** | User id to promote. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "make someone an admin in this group", "grant moderator powers to a member", "give someone the ability to delete posts and invite people", "demote an admin back to a regular member".

### `telegram.set_chat_administrator_custom_title`

Set the custom title shown next to an admin's name in a group, like "Support Lead" instead of the default "Admin". Use when the user wants to relabel, rename, or set a custom admin title for someone on Telegram. The member must already be an admin.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /setChatAdministratorCustomTitle`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id the admin belongs to. |
| `custom_title` | string | **yes** | New custom title, up to 16 characters. |
| `user_id` | integer | **yes** | User id of the admin to relabel. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "give an admin a custom label instead of the default", "relabel a moderator's title in the group", "set what shows next to an admin's name here".

### `telegram.exit_chat`

Remove the bot itself from a group or channel. Use when the user wants the bot taken out of, exited from, or removed from a Telegram chat entirely. The bot can be re-added later with a fresh invite; the chat and its history are untouched.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /leaveChat`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id for the bot to exit. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `ok` | boolean |  |

Also retrieved by: "have the bot exit this group", "remove the bot from this channel", "take the bot out of this chat for now".

### `telegram.create_chat_invite_link`

Create a new invite link for a group or channel. Use when the user wants to invite, share access, or generate a link for someone to join a Telegram chat. expire_date and member_limit cap when it stops working and how many people can use it.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /createChatInviteLink`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id to create the invite for. |
| `expire_date` | integer | no | Optional Unix timestamp the link stops working at. |
| `member_limit` | integer | no | Optional maximum number of members who can join via this link. |
| `name` | string | no | Optional label for the link, shown to admins only. |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `expire_date` | integer |  |
| `invite_link` | string |  |
| `member_limit` | integer |  |
| `name` | string |  |

Also retrieved by: "make me a join link for this group", "generate a way for someone to get into the channel", "set up an invite that expires soon", "give me a link with a limited number of uses".

### `telegram.revoke_chat_invite_link`

Revoke an existing invite link so it can no longer be used to join. Use when the user wants to revoke, cancel, or kill a Telegram invite link. A new one can be created immediately with create_chat_invite_link.

Class `write` (writes, no confirmation needed). No scopes beyond the connection's defaults. Calls `POST /revokeChatInviteLink`.

Arguments:

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `chat_id` | string | **yes** | Chat id the invite link belongs to. |
| `invite_link` | string | **yes** | The invite link to revoke, e.g. "https://t.me/+AbCdEfGhIjK". |

Result fields (the payload is trimmed to these before it reaches the model):

| Field | Type | Notes |
| --- | --- | --- |
| `invite_link` | string |  |
| `is_revoked` | boolean |  |

Also retrieved by: "kill an invite link", "cancel a join link before it's abused", "shut down a link someone shared by mistake".
