Quickstart
This guide walks you through registering a webhook, pushing an event, and verifying delivery — all using curl.
-
Register an event type
Terminal window curl -X POST http://localhost:8080/v1/event-types \-H "Content-Type: application/json" \-H "X-API-Key: sk_live_..." \-d '{"name": "order.created","description": "Fires when a new order is placed","active": true}' -
Register a webhook
Terminal window curl -X POST http://localhost:8080/v1/consumers/default/webhooks \-H "Content-Type: application/json" \-H "X-API-Key: sk_live_..." \-d '{"url": "https://testhooks.sarathsadasivan.com/hooks","events": ["order.created"],"active": true}'Save the
webhook_idfrom the response for later use. -
Push an event
Terminal window curl -X POST "http://localhost:8080/v1/consumers/default/events?event=order.created" \-H "Content-Type: application/json" \-H "X-API-Key: sk_live_..." \-d '{"payload": {"order_id": "ord_123","customer": "alice@example.com","total": 49.99},"idempotency_key": "idem_ord_123","ttl_seconds": 3600}' -
Check delivery status
Terminal window curl "http://localhost:8080/v1/consumers/default/deliveries?webhook_id=YOUR_WEBHOOK_ID&limit=10" \-H "X-API-Key: sk_live_..."
What Just Happened?
Section titled “What Just Happened?”- Sparrow stored the event and enqueued it for async processing
- The event worker found the matching subscription (created automatically when you registered the webhook with
events) - A delivery job was created and the webhook worker sent an HTTP POST to your URL
- The delivery status, response code, and response body were recorded
Next Steps
Section titled “Next Steps”- Learn how events, webhooks, and deliveries fit together
- Configure webhook secrets for HMAC signature verification
- Add payload transforms using Go templates
- Generate a client from the OpenAPI spec — see Client Libraries