Skip to content

Create Webhook

POST {{BASE_HABITAT_URL}}/api/webhooks

Required scope: webhooks:write

Registers a webhook destination for your operator. First sends JSON POST requests when matching order lifecycle statuses or opted-in events occur.

Field Type Required Notes
url string (HTTPS URI) Yes Destination URL. A literal $ is replaced with the order’s externalId at send time. Use HTTPS and avoid secrets in the URL.
event_filter array | null No Lifecycle status_v3 values plus event keys "ready_now" and "Refunded". null or omitted receives all events; an empty array receives none.
active boolean No Defaults to true. Set to false to pause delivery without deleting configuration.
description string | null No Human-readable label shown in Dispatch.
http_options.headers object No Private headers sent with every delivery. Values are encrypted at rest and masked by List Webhooks. This is the supported place for receiver authentication.
  • Use a dedicated endpoint and rotating bearer token or shared secret in http_options.headers.
  • Subscribe only to events your consumer handles.
  • Return 2xx quickly after durable enqueue; process asynchronously.
  • Implement durable idempotency and periodic order reconciliation.
  • Sending event_filter: ["ready_now"] receives only the Ready Now event. The payload keeps the order’s current status_v3 and adds event: "ready_now" plus readyAt.

Unknown fields are rejected with 400. See Webhook Events for payload examples and delivery behavior.

{
"url": "https://my-api.example.com/first-delivery/webhook",
"description": "Production order event consumer",
"active": true,
"event_filter": [
"scheduled",
"ready_now",
"en_route_pickup",
"arrived_pickup",
"en_route_dropoff",
"arrived_dropoff",
"completed",
"cancelled",
"reassign",
"Refunded"
],
"http_options": {
"headers": {
"Authorization": "Bearer YOUR_SERVER_TOKEN"
}
}
}
Terminal window
curl --request POST '${BASE_HABITAT_URL}/api/webhooks' \
--data '{
"url": "https://my-api.example.com/first-delivery/webhook",
"description": "Production order event consumer",
"active": true,
"event_filter": [
"scheduled",
"ready_now",
"en_route_pickup",
"arrived_pickup",
"en_route_dropoff",
"arrived_dropoff",
"completed",
"cancelled",
"reassign",
"Refunded"
],
"http_options": {
"headers": {
"Authorization": "Bearer YOUR_SERVER_TOKEN"
}
}
}'
{
"type": "success",
"webhook": {
"id": "30202232-d3ae-4840-ab20-d6cb5a379b95",
"created_at": "2023-03-17 17:51:42.790555+00",
"operator_id": 1,
"url": "https://webhooks.firstdelivery.com",
"http_options": null,
"active": true,
"event_filter": null
}
}