Skip to main content

Create Invite Link

Creates an invite link for a Telegram group or channel. This link can be shared with users to allow them to join the chat.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Input

  • Client Id - (Optional) The unique identifier for the bot client connection obtained from the Connect node. If not provided, you can use Bot Token instead.
  • Chat Id - The target chat identifier for which to create an invite link. Must be a group or channel ID (e.g., -987654321 or -1001234567890). Cannot be used for private chats.

Options

  • Bot Token - (Optional) The Telegram bot token credential. This is an alternative to using Client Id - provide either Client Id OR Bot Token.

Output

  • Result - The generated invite link URL. This is a https://t.me/... link that can be shared with users to invite them to the chat.

How It Works

The Create Invite Link node generates a new invitation link for a Telegram group or channel. When executed, the node:

  1. Either uses the provided Client Id or creates a temporary connection using Bot Token
  2. Validates the Chat Id
  3. Verifies that the Chat Id corresponds to a group or channel (not a private chat)
  4. Calls Telegram's createChatInviteLink API method
  5. Generates a new invite link for the specified chat
  6. Returns the invite link URL in the Result output

Requirements

  • Either a valid Client Id from a Connect node OR a valid Bot Token credential
  • A valid group or channel Chat Id (negative number)
  • The bot must be an administrator in the group/channel
  • The bot must have the "Invite Users" permission
  • Cannot be used for private chats (one-on-one conversations)

Error Handling

The node will return errors in the following cases:

  • Empty or invalid Chat Id
  • Chat Id is for a private chat (must be group or channel)
  • Bot is not an administrator in the chat
  • Bot doesn't have "Invite Users" permission
  • Chat not found
  • Network connectivity issues
  • Telegram API errors

Usage Examples

Create Basic Invite Link:

Connect
→ Create Invite Link (Chat Id: -1001234567890)
→ Send Message (Chat Id: admin_id, Message: result)
→ Disconnect

Auto-Generate Link for New Groups:

Create Group
→ Add Bot as Admin
→ Create Invite Link (Chat Id: group_id)
→ Store Link in Database

Send Invite Link to User:

Receive Message (from user)
→ Create Invite Link (Chat Id: community_group)
→ Send Message (
Chat Id: message.from.id,
Message: "Join us: " + result
)

Generate Multiple Links:

For Each (group in groupList)
→ Create Invite Link (Chat Id: group.id)
→ Log (group.name + ": " + result)

Understanding Chat IDs

Group Chat ID:

-987654321          // Regular group (starts with -)

Supergroup/Channel ID:

-1001234567890      // Supergroup or channel (starts with -100)

Private Chat ID (NOT SUPPORTED):

123456789           // Positive number - will cause error

Use Cases

Automated Onboarding:

New User Registration
→ Create Invite Link (for welcome group)
→ Send Email with Link
→ Log Invitation

Dynamic Group Access:

Receive Message ("join premium")
→ If (user.is_premium)
→ Create Invite Link (premium_group)
→ Send Message (link)
→ Else
→ Send Message ("Upgrade required")

Event Invitations:

Schedule Event
→ Create Event Channel
→ Create Invite Link
→ Send to Participants

Customer Support:

Receive Message (support request)
→ Create Invite Link (support_group)
→ Send Message (
"Join our support group: " + result
)

Temporary Access:

User Requests Access
→ Create Invite Link
→ Send to User
→ Schedule Link Revocation (after 24 hours)

The Result output contains a URL in this format:

https://t.me/joinchat/XXXXXXXXXXXXXXXXXXX

Or for public chats:

https://t.me/channel_username

Users can click this link to:

  • Open Telegram
  • See a preview of the group/channel
  • Join the chat (if they meet requirements)

Best Practices

  • Verify bot permissions - Ensure the bot is an admin with invite permissions
  • Store links - Save generated links for reuse instead of creating new ones each time
  • Validate Chat Id - Check that it's a group/channel ID (negative number)
  • Handle errors - Bot may not have required permissions
  • Use for groups only - Cannot create invite links for private chats
  • Monitor link usage - Track who joins via generated links
  • Consider link expiration - Use Telegram's link management features

Common Patterns

Link Distribution:

Create Invite Link (for community)
→ For Each (user in userList)
→ Send Message (
Chat Id: user.id,
Message: "Join: " + result
)

Conditional Access:

let userLevel = getUserLevel(userId);
let groupId;

if (userLevel === "premium") {
groupId = premiumGroupId;
} else if (userLevel === "standard") {
groupId = standardGroupId;
}

// Create Invite Link (Chat Id: groupId)

Link with Instructions:

Create Invite Link
→ Send Message (
Message: `
Welcome to our community!

Click here to join: ${result}

Please read our rules after joining.
`
)

Error Handling:

Try {
Create Invite Link (Chat Id: group_id)
Send Message (result)
}
Catch {
Send Message ("Unable to create invite link. Please contact admin.")
Log Error
}

By default, the created link:

  • Never expires - Link is permanent until revoked
  • No member limit - Unlimited users can join
  • Cannot be revoked - This node creates basic links

For advanced features (expiring links, member limits, etc.), you need to use Telegram's additional API parameters (not currently exposed in this node).

Creating Links:

  • Each call creates a new link
  • Old links remain valid unless revoked
  • Multiple links can exist for the same chat

Link Reuse:

Create Invite Link (once)
→ Store result in variable/database
→ Reuse the stored link for future invitations

Best Practice - Reuse Links:

// Check if link already exists
let existingLink = getStoredLink(groupId);

if (existingLink) {
// Use existing link
sendLink(existingLink);
} else {
// Create new link and store it
// Create Invite Link node
storeLink(groupId, result);
sendLink(result);
}

Group vs. Channel

For Groups:

  • Users can see member list
  • Everyone can send messages (unless restricted)
  • Good for communities and discussions

For Channels:

  • Only admins can post
  • Users can only view and comment
  • Good for announcements and broadcasts

Both:

  • Support invite links
  • Require bot to be admin
  • Can be public or private

Chat ID Formats

To get the Chat Id:

From Bot API:

// When bot is added to group
update.message.chat.id // Negative number

From Received Messages:

// In Receive Message node
message.chat.id

For Public Chats:

Use @username or Chat Id

Permissions Required

The bot needs these permissions in the group/channel:

  • Must be an administrator
  • Invite Users permission - Specifically this permission
  • Without these, the node will fail

Check Permissions:

  1. Go to group/channel settings
  2. Check administrators list
  3. Find your bot
  4. Ensure "Invite Users" is enabled

Troubleshooting

"Chat not found" Error:

  • Verify the Chat Id is correct
  • Ensure it's a negative number
  • Check the bot is a member of the chat

"Not enough rights" Error:

  • Bot is not an administrator
  • Bot doesn't have "Invite Users" permission
  • Promote bot to admin with correct permissions

"Bad request" Error:

  • Chat Id may be for a private chat
  • Chat Id format is incorrect
  • Try using the numeric ID instead of username

Link Doesn't Work:

  • Verify the link was generated successfully
  • Check if the group/channel still exists
  • Ensure the group is not deleted

Integration Examples

With Database:

Create Invite Link
→ Insert to Database (
group_id: chat_id,
invite_link: result,
created_at: timestamp
)

With Email:

Create Invite Link
→ Send Email (
to: user_email,
subject: "Join our Telegram group",
body: "Click here: " + result
)

With QR Code:

Create Invite Link
→ Generate QR Code (from result)
→ Send Photo (QR code image)

Tips

  • Create links once and reuse them to avoid creating many links for the same chat
  • Store generated links in a database or variable for future use
  • The bot must remain an administrator for the link to work
  • Invite links work even if the group is set to private
  • For public groups, you can also use the @username directly
  • Multiple invite links can exist for the same group
  • Users can join via the link without needing approval (unless chat requires it)
  • Consider using link analytics to track which links are most effective
  • You can create different links for different campaigns to track sources
  • Links remain valid even if the bot leaves the group (until revoked by admins)