Create invitation link
Creates a link for joining a closed chat
- Parameters
- Advanced call ?
Function CreateInvitationLink(Val Token, Val ChatID, Val Title = "", Val ExpirationDate = "", Val UserLimit = 0) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Token | --token | String | ✔ | Bot token |
| ChatID | --chat | String, Number | ✔ | Target chat ID or ChatID*TopicID |
| Title | --title | String | ✖ | Invitation title |
| ExpirationDate | --expire | Date | ✖ | Link expiration date (permanent if not specified) |
| UserLimit | --limit | Number | ✖ | User limit (infinite if not specified) |
Returns
Map Of KeyAndValue - serialized JSON response from Telegram
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete structure with fields code, body, and headers |
tip
Method at API documentation: createChatInviteLink
1C:Enterprise/OneScript code example
Token = "6129457865:AAFyzNYOAFbu...";
ChannelID = "@testsichee";
Day = 86400;
CurrentDate = OPI_Tools.GetCurrentDate();
Title = "Link " + String(CurrentDate);
Expiration = CurrentDate + Day;
UnixExpiration = OPI_Tools.UNIXTime(Expiration);
Result = OPI_Telegram.CreateInvitationLink(Token, ChannelID, Title, Expiration, 200);
- Bash
- CMD/Bat
oint telegram CreateInvitationLink \
--token "***" \
--chat "***" \
--title "Link 05/02/2026 11:19:33" \
--expire "2026-05-03T11:19:33" \
--limit 200
oint telegram CreateInvitationLink ^
--token "***" ^
--chat "***" ^
--title "Link 05/02/2026 11:19:33" ^
--expire "2026-05-03T11:19:33" ^
--limit 200
Result
{
"ok": true,
"result": {
"invite_link": "***",
"name": "Link 05/02/2026 11:19:33",
"creator": {
"id": 6129457865,
"is_bot": true,
"first_name": "Бот Виталий",
"username": "sicheebot"
},
"expire_date": 1777803573,
"member_limit": 200,
"creates_join_request": false,
"is_primary": false,
"is_revoked": false
}
}