# Webhooks

Manage webhook endpoints and view delivery history.

**Event delivery**
When a subscribed event occurs, Propetware POSTs a `WebhookEventEnvelope` JSON body to your URL. Every request includes three headers:
- `X-Propetware-Event` — the event type string (e.g. `customer.created`)
- `X-Propetware-Timestamp` — Unix timestamp of the delivery attempt (seconds)
- `X-Propetware-Signature` — `sha256=<hex>` HMAC-SHA256 signature

**Signature verification**
To verify a delivery, compute `HMAC-SHA256(webhookSecret, "<timestamp>.<rawBody>")` and compare the hex digest to the value of `X-Propetware-Signature` after stripping the `sha256=` prefix. Reject requests where the timestamp is more than 5 minutes old to prevent replay attacks.

**Retry policy**
Failed deliveries (non-2xx or network error) are retried up to 8 times with a 5-minute backoff, for up to 24 hours. 4xx responses are treated as permanent failures and are not retried.


## List webhooks

 - [GET /webhooks](https://developers.propetware.com/apis/openapi-v1/webhooks/listwebhooks.md): Retrieve all webhooks (requires webhooks:manage ability)

## Create webhook

 - [POST /webhooks](https://developers.propetware.com/apis/openapi-v1/webhooks/createwebhook.md): Create a new webhook (requires webhooks:manage ability)

## Update webhook

 - [PATCH /webhooks/{id}](https://developers.propetware.com/apis/openapi-v1/webhooks/updatewebhook.md): Update a webhook (requires webhooks:manage ability)

## Delete webhook

 - [DELETE /webhooks/{id}](https://developers.propetware.com/apis/openapi-v1/webhooks/deletewebhook.md): Delete a webhook (requires webhooks:manage ability)

## Get webhook deliveries

 - [GET /webhooks/{id}/deliveries](https://developers.propetware.com/apis/openapi-v1/webhooks/getwebhookdeliveries.md): Retrieve delivery history for a webhook (requires webhooks:manage ability)

## Test webhook

 - [POST /webhooks/{id}/test](https://developers.propetware.com/apis/openapi-v1/webhooks/testwebhook.md): Send a test delivery to a webhook (requires webhooks:manage ability)

