Skip to content

Quickstart

This guide walks you through registering a webhook, pushing an event, and verifying delivery — all using curl.

  1. 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
    }'
  2. 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_id from the response for later use.

  3. 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
    }'
  4. 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_..."
  1. Sparrow stored the event and enqueued it for async processing
  2. The event worker found the matching subscription (created automatically when you registered the webhook with events)
  3. A delivery job was created and the webhook worker sent an HTTP POST to your URL
  4. The delivery status, response code, and response body were recorded