messages.exportChatInvite #

Export an invite link for a chat

Layer 223

chatInviteExported#a22cbd96 flags:# revoked:flags.0?true permanent:flags.5?true request_needed:flags.6?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int requested:flags.7?int subscription_expired:flags.10?int title:flags.8?string subscription_pricing:flags.9?StarsSubscriptionPricing = ExportedChatInvite;
chatInvitePublicJoinRequests#ed107ab7 = ExportedChatInvite;
---functions---
messages.exportChatInvite#a455de90 flags:# legacy_revoke_permanent:flags.2?true request_needed:flags.3?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int title:flags.4?string subscription_pricing:flags.5?StarsSubscriptionPricing = ExportedChatInvite;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
legacy_revoke_permanentflags.2?trueLegacy flag, reproducing legacy behavior of this method: if set, revokes all previous links before creating a new one. Kept for bot API BC, should not be used by modern clients.
request_neededflags.3?trueWhether admin confirmation is required before admitting each separate user into the chat
peerInputPeerChat
expire_dateflags.0?intExpiration date
usage_limitflags.1?intMaximum number of users that can join using this link
titleflags.4?stringDescription of the invite link, visible only to administrators
subscription_pricingflags.5?StarsSubscriptionPricingFor Telegram Star subscriptions », contains the pricing of the subscription the user must activate to join the private channel.

Result #

ExportedChatInvite

Both users and bots can use this method #

Possible errors #

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_MONOFORUM_UNSUPPORTEDMonoforums do not support this feature.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400CHAT_ID_INVALIDThe provided chat id is invalid.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
400EXPIRE_DATE_INVALIDThe specified expiration date is invalid.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.
400PRICING_CHAT_INVALIDThe pricing for the subscription is invalid, the maximum price is specified in the stars_subscription_amount_max config key ».
400SUBSCRIPTION_PERIOD_INVALIDThe specified subscription_pricing.period is invalid.
400USAGE_LIMIT_INVALIDThe specified usage limit is invalid.

Telegram Stars #

Telegram Stars are virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more.

Channels, supergroups, gigagroups and basic groups #

How to handle channels, supergroups, gigagroups, basic groups, and what's the difference between them.

Star subscriptions #

Bots and channels may create subscriptions, periodically charging users a certain amount of Telegram Stars in exchange for content and services.

Client configuration #

The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.