Subscriptions API
Route events to destinations by type.
See the Subscriptions concept for background.
Create a subscription
Section titled “Create a subscription”POST /v1/subscriptions
Create a new event-type → destination mapping.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
destination_id | string | yes | |
event_type | string | yes | Exact match or wildcard (e.g., ‘order.*’ or ‘order.**’). |
filter | object | no | JSONPath-style filter on event body. Optional second gate after event_type. |
Returns
Section titled “Returns”The subscription object.
Example
Section titled “Example”curl -X POST https://api.harbor.example/v1/subscriptions \ -H "Authorization: Bearer hk_live_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "destination_id": "dest_01HXYZ", "event_type": "order.*"}'Errors
Section titled “Errors”destination_not_foundinvalid_event_type_patterninvalid_filter
List subscriptions
Section titled “List subscriptions”GET /v1/subscriptions
Paginated list, optionally filtered by destination.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
destination_id | string | no | |
cursor | string | no | |
limit | integer | no |
Returns
Section titled “Returns”A page of subscriptions.
Example
Section titled “Example”curl -X GET https://api.harbor.example/v1/subscriptions \ -H "Authorization: Bearer hk_live_your_api_key"Delete a subscription
Section titled “Delete a subscription”DELETE /v1/subscriptions/{id}
Remove a subscription. Future matching events will no longer route to this destination via this subscription.
Returns
Section titled “Returns”204 No Content.
Example
Section titled “Example”curl -X DELETE https://api.harbor.example/v1/subscriptions/dest_01HXYZ \ -H "Authorization: Bearer hk_live_your_api_key"Errors
Section titled “Errors”subscription_not_found