<metaproperty="description"content="Chats and channels may have a public username or a private invite link: private invite links may be further enhanced with per-user join requests.">
<metaproperty="og:title"content="Invites">
<metaproperty="og:image"content="">
<metaproperty="og:description"content="Chats and channels may have a public username or a private invite link: private invite links may be further enhanced with per-user join requests.">
<p><ahref="/api/channel">Chats and channels</a> may have a public username or a private invite link: private invite links may be further enhanced with per-user <ahref="https://telegram.org/blog/shared-media-scrolling-calendar-join-requests-and-more#join-requests-for-groups-and-channels">join requests</a>.</p>
<p>Only <ahref="/api/channel">supergroups and channels</a> may have a public usernames: <ahref="/api/channel">normal groups</a> must be migrated to a <ahref="/api/channel">supergroup</a> before they can be assigned a username, see the <ahref="/api/channel#migration">migration docs »</a> for more info. </p>
<p><ahref="/method/channels.updateUsername">channels.updateUsername</a> can be used to directly assign or change the public username of a supergroup or channel.<br>
You can use <ahref="/method/channels.updateUsername">channels.checkUsername</a> before assigning the username to make sure that the specified username is valid and available. </p>
<p><ahref="/method/channels.joinChannel">channels.joinChannel</a> can be used to join a supergroup or channel using peer information obtained using <ahref="/method/contacts.resolveUsername">contacts.resolveUsername</a>.</p>
<p>Private invite links can optionally have an expiration date, a usage limit, and can even be set to only allow users into the channel, supergroup or group upon explicit approval of an admin: see <ahref="#join-requests">join requests »</a> for more info.</p>
<p>Invite links match the following regex: <code>@(?:t|telegram)\.(?:me|dog)/(joinchat/|\+)?([\w-]+)@i</code>.<br>
The first matching group can be passed to the <code>hash</code> parameter of <ahref="/method/messages.checkChatInvite">messages.checkChatInvite</a> to get info about the chat, and <ahref="/method/messages.importChatInvite">messages.importChatInvite</a> to join the chat.<br>
<ahref="/method/messages.checkChatInvite">messages.checkChatInvite</a> may return <ahref="/constructor/chatInvitePeek">chatInvitePeek</a> only for <ahref="/api/channel">supergroups and channels</a>, in which case the user may directly fetch chat messages using <ahref="/api/updates">updates</a>, <ahref="/method/messages.getHistory">messages.getHistory</a> and <ahref="/method/channels.getMessages">channels.getMessages</a> until the time indicated by the <code>expires</code> unixtime field.</p>
<p>Newly created groups, supergroups and channel already have a default invite link.<br>
To generate a new one, use <ahref="/method/messages.exportChatInvite">messages.exportChatInvite</a>.<br>
To get info about existing chat invites, optionally filtering only links created by a given admin, use <ahref="/method/messages.getExportedChatInvites">messages.getExportedChatInvites</a>.<br>
<ahref="/method/messages.getExportedChatInvite">messages.getExportedChatInvite</a> can be used to obtain info about a specific invite link. </p>
<p><ahref="/method/messages.editExportedChatInvite">messages.editExportedChatInvite</a> is used to edit or revoke existing invite links: revoked links cannot be used by users to join the group, but info about revoked links can still be fetched using <ahref="/method/messages.getExportedChatInvites">messages.getExportedChatInvites</a> with the <code>revoked</code> flag set.<br>
Use <ahref="/method/messages.deleteExportedChatInvite">messages.deleteExportedChatInvite</a> to permanently remove an invite link, and <ahref="/method/messages.deleteRevokedExportedChatInvites">messages.deleteRevokedExportedChatInvites</a> to permanently remove a revoked invite link. </p>
<p><ahref="/method/messages.getChatInviteImporters">messages.getChatInviteImporters</a> can be used to fetch info about users that joined using a specific invite link. </p>
<p>Some basic stats about the number of invite links generated by a given admin can be fetched using <ahref="/method/messages.getAdminsWithInvites">messages.getAdminsWithInvites</a>. </p>
<p>If the <code>request_needed</code> flag is set when <ahref="#invite-links">generating or editing an invite link</a>, users importing the invite link using <ahref="/method/messages.importChatInvite">messages.importChatInvite</a> will receive an <code>INVITE_REQUEST_SENT</code> RPC error, indicating that an join request was successfully sent to the chat admins. </p>
<p>Bot administrators will receive a <ahref="/constructor/updateBotChatInviteRequester">updateBotChatInviteRequester</a> update for each separate join request.<br>
User administrators will receive an <ahref="/constructor/updatePendingJoinRequests">updatePendingJoinRequests</a>, and should invoke <ahref="/method/messages.getChatInviteImporters">messages.getChatInviteImporters</a> with the <code>requested</code> flag set to obtain a list of users waiting to be admitted into the group. </p>
<p>Administrators can then use <ahref="/method/messages.hideChatJoinRequest">messages.hideChatJoinRequest</a> to approve or dismiss a join request, and <ahref="/method/messages.hideAllChatJoinRequests">messages.hideAllChatJoinRequests</a> to approve or dismiss in bulk multiple join requests. </p>
<p>Administrators can also choose send a message to the user before admitting them into the group: in this case, graphical clients <em>on the user side</em> should display a message on the dialog bar of the chat with the admin, indicating that the chat was initiated by the admin of a chat/channel they have recently requested to join, according to the information contained in the <ahref="/constructor/peerSettings">peerSettings »</a>. </p></div>
</div>
</div>
</div>
<divclass="footer_wrap">
<divclass="footer_columns_wrap footer_desktop">
<divclass="footer_column footer_column_telegram">
<h5>Telegram</h5>
<divclass="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.