Webhooks
Webhooks let your application react to events as they happen — incoming email, delivery failures, or new agents — without polling the API.Create a webhook
Register your endpoint in the dashboard under Settings → Webhooks. Provide:- URL — A publicly reachable HTTPS endpoint on your server
- Secret — A string Anima uses to sign each request (generate a random value and store it securely)
- Events — The event types you want to receive
During development, use a tool like ngrok or Cloudflare Tunnel to expose a local server to the internet.
Event types
| Event | Triggered when |
|---|---|
message.received | An agent’s inbox receives a new email |
message.sent | An outbound email is successfully delivered |
message.failed | An outbound email fails to deliver or bounces |
agent.created | A new agent is created in your account |
Payload format
Every webhook request is an HTTP POST with a JSON body. Themessage.received payload looks like this:
Verify signatures
Anima signs each request with HMAC-SHA256 using your webhook secret. The signature is sent in theX-Anima-Signature header as a hex digest of the raw request body.
Retry behavior
If your endpoint returns a non-2xx response or times out, Anima retries the delivery with exponential backoff. Return200 OK as quickly as possible and handle processing asynchronously if your logic is time-intensive.