# Webhooks

Source: https://www.pontive.com/docs/api-reference/management/webhooks

Base URL: `https://api.{region}.pontive.com/v1` (operations that name another server say so).

Authentication: send `Authorization: Bearer <token>` with a secret key (`pontive_sk_…`, which implies its instance) or an access token issued for this API. A token that can reach several instances also names one with `X-Pontive-Instance-ID: inst_…`. Secret keys are for servers only.

## List event types

```http
GET https://api.{region}.pontive.com/v1/webhooks/event-types
```

List system and custom event types.

Operation ID: `ListWebhookEventTypes`

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string |  | Filter by kind (system\|custom) |
| `scope` | string |  | Filter by scope (project\|organization) |
| `name` | string |  | Partial name match |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListEventTypesResponse
- `400` Bad Request: ErrResponse

## Get event type

```http
GET https://api.{region}.pontive.com/v1/webhooks/event-types/{event_type_name}
```

Operation ID: `GetWebhookEventType`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `event_type_name` | string | yes | Event type name (e.g. user.created) |

### Responses

- `200` OK: EventType
- `404` Not Found: ErrResponse

## List events

```http
GET https://api.{region}.pontive.com/v1/webhooks/events
```

Query events for inspection, walked by cursor (api-route-review D41): newest first, next_cursor passed as before to page back (null at the end), or as after to poll for what was created since, oldest first.

Operation ID: `ListWebhookEvents`

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string |  | Filter by event type |
| `organization_id` | string |  | Filter by organization (org_…) |
| `from` | string |  | RFC 3339: created at or after |
| `to` | string |  | RFC 3339: created before |
| `after` | string |  | Cursor: events created after it, oldest first (polling) |
| `before` | string |  | Cursor: older events, newest first |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListEventsResponse
- `400` Bad Request: ErrResponse

## Get event

```http
GET https://api.{region}.pontive.com/v1/webhooks/events/{event_id}
```

Operation ID: `GetWebhookEvent`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `event_id` | string | yes | Event id (evt_…) |

### Responses

- `200` OK: Event
- `404` Not Found: ErrResponse

## List webhook subscriptions

```http
GET https://api.{region}.pontive.com/v1/webhooks/subscriptions
```

List webhook subscriptions with filtering and pagination. A token acting for a user through an actor (RFC 8693 act) sees each custom header's name with the value "••••••".

Operation ID: `ListWebhookSubscriptions`

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `scope` | string |  | Filter by scope (project\|organization) |
| `status` | string |  | Filter by status (active\|paused\|failing\|disabled) |
| `organization_id` | string |  | Filter organization-scope subscriptions by organization (org_…) |
| `sort` | string |  | Sort field; prefix with - for descending. Allowed: created_at, updated_at, status, url. Default: -created_at |
| `page` | integer |  | Page number |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListSubscriptionsResponse
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `500` Internal Server Error: ErrResponse

## Create webhook subscription

```http
POST https://api.{region}.pontive.com/v1/webhooks/subscriptions
```

Register an endpoint for event delivery. The Standard Webhooks signing secret ("whsec_…") is returned ONLY in this response — store it now. Omit scope (or pass "project") for a client subscription; scope "organization" with organization_id creates an organization self-service subscription.

Operation ID: `CreateWebhookSubscription`

### Request body (`application/json`, required): CreateSubscriptionRequest

Create subscription payload

### Responses

- `201` Created: Subscription
- `400` Bad Request: ErrResponse
- `401` Unauthorized: ErrResponse
- `403` instance_unclaimed: the instance is unclaimed; claim this instance to subscribe to webhooks (pontive-spec 47): ErrResponse
- `500` Internal Server Error: ErrResponse

## Get webhook subscription

```http
GET https://api.{region}.pontive.com/v1/webhooks/subscriptions/{subscription_id}
```

A token acting for a user through an actor (RFC 8693 act) sees each custom header's name with the value "••••••".

Operation ID: `GetWebhookSubscription`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription_id` | string | yes | Subscription id (whs_…) |

### Responses

- `200` OK: Subscription
- `404` Not Found: ErrResponse

## Update webhook subscription

```http
PATCH https://api.{region}.pontive.com/v1/webhooks/subscriptions/{subscription_id}
```

Patch mutable fields (url, description, event_types, headers, metadata). A token acting for a user through an actor (RFC 8693 act) may not set headers (403 actor_refused: custom headers can hold credentials) and sees them masked ("••••••") in the response.

Operation ID: `UpdateWebhookSubscription`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription_id` | string | yes | Subscription id (whs_…) |

### Request body (`application/json`, required): UpdateSubscriptionRequest

Update payload

### Responses

- `200` OK: Subscription
- `400` Bad Request: ErrResponse
- `403` instance_unclaimed: the instance is unclaimed; claim this instance to subscribe to webhooks (pontive-spec 47): ErrResponse
- `404` Not Found: ErrResponse

## Delete webhook subscription

```http
DELETE https://api.{region}.pontive.com/v1/webhooks/subscriptions/{subscription_id}
```

Operation ID: `DeleteWebhookSubscription`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription_id` | string | yes | Subscription id (whs_…) |

### Responses

- `204` No Content
- `404` Not Found: ErrResponse

## List deliveries

```http
GET https://api.{region}.pontive.com/v1/webhooks/subscriptions/{subscription_id}/deliveries
```

List a subscription's delivery attempts (full request/response records), walked by cursor as the events are (api-route-review D41). A token acting for a user through an actor (RFC 8693 act) sees the recorded request and response headers' names with the value "••••••".

Operation ID: `ListWebhookDeliveries`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription_id` | string | yes | Subscription id (whs_…) |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | string |  | Filter by status (pending\|inflight\|success\|failed\|error) |
| `event_id` | string |  | Filter by event (evt_…) |
| `from` | string |  | RFC 3339: created at or after |
| `to` | string |  | RFC 3339: created before |
| `after` | string |  | Cursor: attempts made after it, oldest first (polling) |
| `before` | string |  | Cursor: older attempts, newest first |
| `limit` | integer |  | Items per page |

### Responses

- `200` OK: ListDeliveriesResponse
- `400` Bad Request: ErrResponse

## Get delivery

```http
GET https://api.{region}.pontive.com/v1/webhooks/subscriptions/{subscription_id}/deliveries/{delivery_id}
```

A token acting for a user through an actor (RFC 8693 act) sees the recorded request and response headers' names with the value "••••••".

Operation ID: `GetWebhookDelivery`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription_id` | string | yes | Subscription id (whs_…) |
| `delivery_id` | string | yes | Delivery id (del_…) |

### Responses

- `200` OK: Delivery
- `404` Not Found: ErrResponse

## Retry delivery

```http
POST https://api.{region}.pontive.com/v1/webhooks/subscriptions/{subscription_id}/deliveries/{delivery_id}/retry
```

Manually re-attempt a failed or errored delivery: a fresh attempt is scheduled immediately and the prior attempt's retried_by is set to it. Allowed once per attempt — one that already has a successor (automatic rung or earlier manual retry) answers 409.

Operation ID: `RetryWebhookDelivery`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription_id` | string | yes | Subscription id (whs_…) |
| `delivery_id` | string | yes | Delivery id (del_…) |

### Responses

- `202` Accepted: Delivery
- `400` Bad Request: ErrResponse
- `404` Not Found: ErrResponse
- `409` Conflict: ErrResponse

## Pause webhook subscription

```http
POST https://api.{region}.pontive.com/v1/webhooks/subscriptions/{subscription_id}/pause
```

Operation ID: `PauseWebhookSubscription`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription_id` | string | yes | Subscription id (whs_…) |

### Responses

- `200` OK: Subscription
- `404` Not Found: ErrResponse

## Resume webhook subscription

```http
POST https://api.{region}.pontive.com/v1/webhooks/subscriptions/{subscription_id}/resume
```

Reactivate a paused, failing, or disabled subscription.

Operation ID: `ResumeWebhookSubscription`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription_id` | string | yes | Subscription id (whs_…) |

### Responses

- `200` OK: Subscription
- `404` Not Found: ErrResponse

## Rotate webhook signing secret

```http
POST https://api.{region}.pontive.com/v1/webhooks/subscriptions/{subscription_id}/rotate-secret
```

Mint a new Standard Webhooks signing secret. The previous secret keeps signing beside the new one for expire_previous_in seconds (0 to 604800, default 86400; 0 ends it now): during the overlap each delivery's webhook-signature header carries one signature per secret, so subscribers rotate with zero downtime. The NEW plaintext secret is returned only here.

Operation ID: `RotateWebhookSecret`

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription_id` | string | yes | Subscription id (whs_…) |

### Request body (`application/json`): RotateSecretRequest

Rotation options

### Responses

- `200` OK: Subscription
- `400` Bad Request: ErrResponse
- `404` Not Found: ErrResponse

## Get webhook usage

```http
GET https://api.{region}.pontive.com/v1/webhooks/usage
```

Billing-relevant delivery counters for a period (YYYY-MM; defaults to the current month).

Operation ID: `GetWebhookUsage`

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `period` | string |  | Billing period (YYYY-MM) |

### Responses

- `200` OK: Usage
- `400` Bad Request: ErrResponse

## Schemas

### ListEventTypesResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | EventType[] |  |  |
| `object` | string |  |  |
| `pagination` | Pagination |  | Pagination is the page answered (api-route-review D9). |

### ErrResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | ErrBody |  |  |

### EventType

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `created_at` | string |  |  |
| `description` | string |  |  |
| `name` | string |  |  |
| `object` | string |  |  |
| `payload_schema` | string |  |  |
| `schema_mode` | "strict" \| "lenient" |  |  |
| `scope` | "project" \| "organization" |  |  |
| `type` | "system" \| "custom" |  |  |
| `updated_at` | string |  |  |

### ListEventsResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | Event[] |  |  |
| `next_cursor` | string |  |  |
| `object` | string |  |  |

### Event

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `created_at` | string |  |  |
| `data` | object |  |  |
| `id` | string |  |  |
| `object` | string |  |  |
| `organization_id` | string |  |  |
| `previous_attributes` | object |  |  |
| `source` | "system" \| "custom" \| "meta" \| "test" |  |  |
| `type` | string |  |  |

### ListSubscriptionsResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | Subscription[] |  |  |
| `object` | string |  |  |
| `pagination` | Pagination |  | Pagination is the page answered (api-route-review D9). |

### CreateSubscriptionRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allow_private_ips` | boolean |  |  |
| `description` | string |  |  |
| `event_types` | string[] | yes |  |
| `headers` | Headers |  |  |
| `metadata` | Metadata |  |  |
| `organization_id` | string |  |  |
| `scope` | "project" \| "organization" |  |  |
| `url` | string | yes |  |

### Subscription

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allow_private_ips` | boolean |  |  |
| `created_at` | string |  |  |
| `description` | string |  |  |
| `event_types` | string[] |  |  |
| `headers` | Headers |  |  |
| `id` | string |  |  |
| `instance_id` | string |  |  |
| `last_failure` | SubscriptionLastFailure |  |  |
| `metadata` | Metadata |  |  |
| `object` | string |  |  |
| `organization_id` | string |  |  |
| `scope` | "project" \| "organization" |  |  |
| `secret` | string |  | Secret is the plaintext Standard Webhooks signing secret ("whsec_…"). Present only in create/rotate-secret responses; never readable again. |
| `secret_preview` | string |  |  |
| `stats` | SubscriptionStats |  |  |
| `status` | "active" \| "paused" \| "failing" \| "disabled" |  |  |
| `updated_at` | string |  |  |
| `url` | string |  |  |

### UpdateSubscriptionRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  |  |
| `event_types` | string[] |  |  |
| `headers` | Headers |  |  |
| `metadata` | Metadata |  |  |
| `url` | string |  |  |

### ListDeliveriesResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | Delivery[] |  |  |
| `next_cursor` | string |  |  |
| `object` | string |  |  |

### Delivery

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `attempt_number` | integer |  |  |
| `created_at` | string |  |  |
| `delivered_at` | string |  |  |
| `duration_ms` | integer |  |  |
| `error` | string |  |  |
| `event_id` | string |  |  |
| `id` | string |  |  |
| `next_retry_at` | string |  |  |
| `object` | string |  |  |
| `request` | DeliveryRequestInfo |  |  |
| `response` | DeliveryResponseInfo |  |  |
| `response_code` | integer |  |  |
| `retried_by` | string |  | RetriedBy is the id of the attempt that superseded this one — the next automatic rung or a manual retry. Absent until a successor exists; an attempt that has one cannot be retried again. |
| `status` | "pending" \| "inflight" \| "success" \| "failed" \| "error" |  |  |
| `subscription_id` | string |  |  |

### RotateSecretRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expire_previous_in` | integer |  | ExpirePreviousIn is how long the previous signing secret keeps signing beside the new one, in seconds: 0 to 604800; absent is 86400, and 0 ends it now. |

### Usage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `deliveries_count` | integer |  |  |
| `failed_count` | integer |  |  |
| `object` | string |  |  |
| `period` | string |  |  |
| `retried_count` | integer |  |  |

### Pagination

Pagination is the page answered (api-route-review D9).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer |  | Limit is the maximum number of items per page. |
| `page` | integer |  | Page is the 1-based index of the returned page. |
| `total` | integer |  | Total is the total number of items across all pages. |
| `total_pages` | integer |  | TotalPages is the total number of pages available. |

### ErrBody

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string |  | Code is the spec's machine-readable code for this error, in snake case: a domain code such as seat_limit_reached where the refusal has one, otherwise a generic one such as permission_denied, not_found, conflict, invalid_request or service_unavailable. |
| `details` | ErrDetail[] |  | Details are per-field findings, present only on a refusal that has them, e.g. a 422 invalid_theme names each invalid value by its path, a 422 package_invalid each problem, and a 409 capability_in_use each count by its name. |
| `doc_url` | string |  | DocURL links to documentation about this error, when available. |
| `message` | string |  | Message is a human-readable description of what went wrong. |
| `object` | string |  | Object is the discriminator; always "error". |
| `param` | string |  | Param names the request parameter this error refers to, when applicable. |
| `type` | "validation_error" \| "authentication_error" \| "authorization_error" \| "not_found" \| "conflict_error" \| "rate_limit_error" \| "internal_error" |  | Type is the error's category, set by its HTTP status: one of validation_error, authentication_error, authorization_error, not_found, conflict_error, rate_limit_error, internal_error. |

### Headers

Type: Record<string, string>

### Metadata

Type: Record<string, string>

### SubscriptionLastFailure

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | string |  |  |
| `response_code` | integer |  |  |
| `timestamp` | string |  |  |

### SubscriptionStats

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `last_24h` | { delivered: integer; failed: integer } |  |  |

### DeliveryRequestInfo

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `headers` | Record<string, string> |  |  |
| `method` | string |  |  |
| `url` | string |  |  |

### DeliveryResponseInfo

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `body_preview` | string |  |  |
| `code` | integer |  |  |
| `headers` | Record<string, string> |  |  |

### ErrDetail

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `field` | string |  | Field is where the finding is: for a theme, its dotted path. |
| `message` | string |  | Message is what is wrong there. |
