exportChatInviteLink
Export the primary invite link for a chat. Each call generates a new primary invite link, and the previous primary invite link will be invalidated.
Request
POST /:token/exportchatinvitelink
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| chat_id | Integer/String | Yes | Unique identifier for the target chat or username |
Response
Returns the new invite link URL as a String on success.
json
{
"ok": true,
"result": "https://t.me/+abc123def456"
}Error Codes
| Code | Description |
|---|---|
| 400 | Bad request parameters, e.g. missing chat_id |
| 401 | Invalid or expired token |
| 403 | Bot does not have permission to export the invite link for this chat |
| 404 | Chat not found |
| 500 | Internal server error |
