telegram api method · layer 229 · #a455de90

messages.exportChatInvite

usable by users and bots

Export an invite link for a chat

definition

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.

returns

ExportedChatInvite

errors (15)

codeerrordescription
400BUSINESS_CONNECTION_NOT_ALLOWEDThis method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection.
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.
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.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).
403CHAT_WRITE_FORBIDDENYou can't write in this chat.

history

present in layers 46–229 · constructor id changed 4×

idlayers
#7d88528946–92
#0df7534c93–123
#14b9bcd7124–133
#a02ce5d5134–185
#a455de90186–229