API Webhook

Ricevi notifiche di eventi in tempo reale

I webhook ti consentono di ricevere notifiche in tempo reale quando si verificano eventi nei tuoi bot. Invece di interrogare la nostra API, configura un URL webhook e ti invieremo gli eventi istantaneamente.

Eventi Disponibili

message.received

Nuovo messaggio in una chat

message.edited

Messaggio modificato

member.joined

Utente entrato in un gruppo

member.left

Utente uscito da un gruppo

bot.added

Bot aggiunto a un gruppo

bot.removed

Bot rimosso da un gruppo

command.executed

Comando bot eseguito

module.triggered

Azione di un modulo attivata

Endpoints

GET
/api/webhooks

Elenca tutti i webhook configurati

botId
POST
/api/webhooks

Crea un nuovo endpoint webhook

urleventssecret
PATCH
/api/webhooks/:id

Aggiorna la configurazione webhook

urleventsstatus
DELETE
/api/webhooks/:id

Elimina un webhook

id
POST
/api/webhooks/:id/test

Invia un evento di test al tuo webhook

id

Sicurezza Webhook

Verifica della Firma

Tutti i payload webhook includono un header di firma per la verifica:

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!"
  }
}

Politica di Retry

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.

Esplora Altro

Scopri le best practice di sicurezza per la tua integrazione API.

Security Guide