API de Webhooks

Recibe notificaciones de eventos en tiempo real

Los webhooks te permiten recibir notificaciones en tiempo real cuando ocurren eventos en tus bots. En lugar de consultar nuestra API, configura una URL de webhook y te enviaremos los eventos al instante.

Eventos disponibles

message.received

Nuevo mensaje en un chat

message.edited

Se edit贸 un mensaje

member.joined

Un usuario se uni贸 a un grupo

member.left

Un usuario abandon贸 un grupo

bot.added

Se a帽adi贸 un bot a un grupo

bot.removed

Se elimin贸 un bot de un grupo

command.executed

Se ejecut贸 un comando de bot

module.triggered

Se activ贸 una acci贸n de m贸dulo

Endpoints

GET
/api/webhooks

Listar todos los webhooks configurados

botId
POST
/api/webhooks

Crear un nuevo endpoint de webhook

urleventssecret
PATCH
/api/webhooks/:id

Actualizar configuraci贸n de webhook

urleventsstatus
DELETE
/api/webhooks/:id

Eliminar un webhook

id
POST
/api/webhooks/:id/test

Enviar un evento de prueba a tu webhook

id

Seguridad de webhooks

Verificaci贸n de firma

Todos los payloads de webhook incluyen un encabezado de firma para verificaci贸n:

X-BotLaunch-Signature: sha256=abc123...

Example Payload

{
  "event": "message.received",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "messageId": "msg_abc123",
    "chatId": "-100123456789",
    "from": {
      "id": 123456789,
      "username": "johndoe"
    },
    "text": "Hello, bot!"
  }
}

Pol铆tica de reintentos

If your endpoint returns a non-2xx status, we'll retry up to 3 times with exponential backoff (10s, 30s, 90s). After 3 failures, the webhook is paused.

Explorar m谩s

Aprende sobre las mejores pr谩cticas de seguridad para tu integraci贸n con la API.

Security Guide