Webhook endpoints
The SDK exposes webhook endpoint management under harbor.webhooks. Delivery handling happens on your HTTP server; see Webhook delivery for payload shape and retry semantics.
create
harbor.webhooks.create({
workspaceId: 'ws_018f3a2e4b9c',
url: 'https://api.example.com/harbor/webhooks',
events: ['order.shipped', 'invoice.paid'],
});
Returns: WebhookEndpoint with id, url, events, and secret.
Required scope: webhooks:manage
Store secret immediately. Harbor shows it once at creation.
retrieve
harbor.webhooks.retrieve('wh_0193f1a2d001');
Returns: WebhookEndpoint (secret field omitted)
Required scope: webhooks:manage
list
harbor.webhooks.list({
workspaceId: 'ws_018f3a2e4b9c',
limit: 20,
});
Returns: Page<WebhookEndpoint>
Required scope: webhooks:manage
WebhookEndpoint object
| Field | Type | Description |
|---|---|---|
id | string | Endpoint ID (wh_ prefix) |
url | string | HTTPS destination |
events | string[] | Subscribed event types |
status | string | active or disabled |
createdAt | string | ISO 8601 timestamp |
Next steps
See Webhooks guide for registration and verification. verifyWebhookSignature() params in Client.