
# Webhook endpoints

## The webhook endpoint object

```json
{
  "id": "we_…",
  "object": "webhook_endpoint",
  "url": "https://example.com/kibanda",
  "description": "Odoo sync",
  "enabled_events": ["order.paid", "order.delivered"],
  "status": "enabled",
  "created": 1792716000
}
```

## Create

`POST /v1/webhook_endpoints` — `url` (https, required), `enabled_events` (event types, or `["*"]` for all; default all), `description`. The response includes `secret` — the only time it's returned without asking.

## Update, delete

- `POST /v1/webhook_endpoints/{id}` — `url`, `enabled_events`, `description`, `disabled` (`true` pauses delivery).
- `DELETE /v1/webhook_endpoints/{id}`

## Secrets

- `POST /v1/webhook_endpoints/{id}/reveal_secret`
- `POST /v1/webhook_endpoints/{id}/rotate_secret`

## Test

`POST /v1/webhook_endpoints/{id}/test` — sends a signed `ping` now: `{ "ok": true, "status": 200 }`.

## Deliveries

`GET /v1/webhook_endpoints/{id}/deliveries` — recent attempts: `status` (`pending`, `sending`, `succeeded`, `failed`), `attempts`, `response_status`, `error`, `next_attempt`.

### Retry a delivery

`POST /v1/webhook_endpoints/{id}/deliveries/{delivery_id}/retry` — sends it again now.

## Event types

`GET /v1/webhook_endpoints/event_types` — see [Events](https://kibanda.africa/docs/events#types).
