Event triggersfire when your system sends them an event. You can send it to a specific trigger's address or, with the agent's API key, by name.
Event to a trigger
POST https://csevfgnqeweymrgebayc.supabase.co/functions/v1/agent-triggers/<ID_DEL_DISPARADOR>Content-Type: application/jsonCopy the address and the secret from the trigger's card (How to connect your system). The body is the event's JSON as is, up to 64 KB: the agent receives it as its data.
Authentication
Use any of these methods:
The signature is a base64 HMAC-SHA256 of {webhook-id}.{webhook-timestamp}.{cuerpo}, with the secret without the whsec_ prefix (decoded from base64), sent as v1,<firma>. The timestamp can't differ by more than 5 minutes from the current time.
import crypto from "node:crypto"const secreto = process.env.QAALIA_TRIGGER_SECRET // whsec_…const cuerpo = JSON.stringify({ pedido: "A-1042", total: 820 })const id = crypto.randomUUID()const timestamp = Math.floor(Date.now() / 1000).toString()const clave = Buffer.from(secreto.replace("whsec_", ""), "base64")const firma = crypto.createHmac("sha256", clave).update(`${id}.${timestamp}.${cuerpo}`).digest("base64")await fetch("https://csevfgnqeweymrgebayc.supabase.co/functions/v1/agent-triggers/<ID_DEL_DISPARADOR>", { method: "POST", headers: { "Content-Type": "application/json", "webhook-id": id, "webhook-timestamp": timestamp, "webhook-signature": `v1,${firma}`, }, body: cuerpo,})Event by name
If your system already uses the agent's API key, send the event by its name. It wakes up all active triggers listening to that event (up to 10).
curl -X POST "https://csevfgnqeweymrgebayc.supabase.co/functions/v1/agent-triggers" \ -H "Authorization: Bearer $QAALIA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "evento": "venta_registrada", "datos": { "pedido": "A-1042", "total": 820 }, "id": "evt_1042" }'Response
Qaalia responds 202instantly and the agent works in the background. Follow each run in the trigger's history.
Retries
- Send a unique identifier per event in
webhook-id,Idempotency-Keyor theidfield. - If you resend the same event, Qaalia recognizes it and doesn't wake up the agent again.
total is greater than 500.
