Telegram Bot API
🌐 Español

revokeChatInviteLink

Categoría: Chat · Bot API 10.3 · Documentación oficial

Revoca un enlace de invitación.

Devuelve: Si la llamada tiene éxito, devuelve ChatInviteLink.

Parámetros

ParámetroTipoObligatorioDescripción
chat_idInteger or StringSíID del chat
invite_linkStringSíEnlace de invitación a revocar

Las descripciones de los parámetros son resúmenes breves; consulta la documentación oficial para ver el texto completo.

Ejemplo de solicitud

curl

curl -s -X POST "https://api.telegram.org/bot$TOKEN/revokeChatInviteLink" \
  -H "Content-Type: application/json" \
  -d '{"chat_id":123456789,"invite_link":"https://t.me/+AbCdEfGhIjKl"}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/revokeChatInviteLink",
    json={
        "chat_id": 123456789,
        "invite_link": "https://t.me/+AbCdEfGhIjKl"
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/revokeChatInviteLink`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "chat_id": 123456789,
    "invite_link": "https://t.me/+AbCdEfGhIjKl"
  }),
});
console.log(await res.json());

Guía paso a paso: Cómo crear un bot en Telegram paso a paso: de BotFather a tu primer mensaje