Skip to content

Quickstart

This walks you through creating a destination, subscribing to an event type, sending an event, and watching the delivery land. You’ll use test mode so nothing touches real customers.

For this quickstart, use a disposable receiver. Open webhook.site in another tab and copy the unique URL it gives you. This is what Harbor will POST to.

Terminal window
curl -X POST https://api.harbor.example/v1/destinations \
-H "Authorization: Bearer hk_test_your_test_key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://webhook.site/your-unique-id",
"name": "Quickstart receiver"
}'

The response includes the destination’s id (dest_...) and its signing_secret — this is shown once. Save it; you’ll need it to verify payloads in a real receiver. See Signing & verification.

Terminal window
curl -X POST https://api.harbor.example/v1/subscriptions \
-H "Authorization: Bearer hk_test_your_test_key" \
-H "Content-Type: application/json" \
-d '{
"destination_id": "dest_01HXYZ",
"event_type": "order.created"
}'
Terminal window
curl -X POST https://api.harbor.example/v1/events \
-H "Authorization: Bearer hk_test_your_test_key" \
-H "Content-Type: application/json" \
-d '{
"type": "order.created",
"body": { "order_id": "ord_123", "amount_cents": 4500 }
}'

Refresh webhook.site — you should see a POST with the event body and a Harbor-Signature header. Meanwhile:

Terminal window
curl https://api.harbor.example/v1/deliveries \
-H "Authorization: Bearer hk_test_your_test_key"

One delivery, status succeeded, response_code: 200.

That’s the whole loop. From here: