What are Webhooks?
Webhooks are the trigger mechanism that awakens your AI agent. Instead of your agent constantly checking for new emails, webhooks notify it instantly when something happens—a new email arrives, a message bounces, or a delivery fails.Instant Awareness
Your agent knows the moment an email arrives
Resource Efficient
No wasted cycles polling—agents only wake when needed
Secure
Signed payloads ensure events are authentic
Reliable
Automatic retries guarantee delivery
Quick Start
1. Create a Webhook Endpoint
Create an HTTP endpoint that will wake your agent when events occur:2. Register the Webhook
Use the API to register your endpoint:3. Save the Secret
The response includes asecret - save it securely:
4. Verify Signatures
Always verify that webhooks are from Jasni:Available Events
| Event | Trigger |
|---|---|
email.received | New email arrives in mailbox |
email.sent | Email sent successfully |
email.bounced | Email delivery failed |
email.spam | Email marked as spam |
email.deleted | Email was deleted |
Event Reference
See detailed payload schemas for each event
Webhook Payload
Every webhook includes all the context your agent needs to act:Headers
Each webhook request includes:| Header | Description |
|---|---|
Content-Type | application/json |
X-Webhook-Signature | HMAC-SHA256 signature |
X-Webhook-Timestamp | Unix timestamp |
X-Webhook-Event | Event type |
User-Agent | JasniAI-Webhooks/1.0 |
Retry Policy
If your endpoint fails (non-2xx response or timeout), Jasni retries:| Attempt | Delay |
|---|---|
| 1st | Immediate |
| 2nd | 10 seconds |
| 3rd | 60 seconds |
| 4th | 5 minutes |
Best Practices

Acknowledge fast, process async
Acknowledge fast, process async
Return a
200 response immediately, then queue the event for your agent to process. Webhooks timeout after 30 seconds.
Design for idempotency
Design for idempotency
The same event might be delivered multiple times. Your agent should handle duplicates gracefully.

Always verify signatures
Always verify signatures
Verify the
X-Webhook-Signature header to ensure events are genuinely from Jasni—not spoofed.
Use HTTPS
Use HTTPS
Always use HTTPS endpoints in production to protect email content in transit.