curl -X POST https://api.jasni.ai/api/v1/webhooks \ -H "Authorization: Bearer jsk_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-server.com/webhooks/jasni", "events": ["email.received", "email.sent"], "description": "Production webhook" }'
{ "success": true, "data": { "webhook": { "id": "550e8400-e29b-41d4-a716-446655440000", "url": "https://your-server.com/webhooks/jasni", "events": ["email.received", "email.sent"], "active": true, "description": "Production webhook", "secret": "whsec_abc123def456ghi789...", "created_at": "2024-01-15T10:30:00Z" } } }
Create a new webhook endpoint to receive email events
email.received
email.sent
email.bounced
email.spam
email.deleted
Show properties
true
secret
const crypto = require('crypto'); function verifyWebhookSignature(payload, signature, secret) { const expectedSignature = crypto .createHmac('sha256', secret) .update(payload) .digest('hex'); return crypto.timingSafeEqual( Buffer.from(signature), Buffer.from(expectedSignature) ); }