# Register a webhook endpoint

`POST /v1/orgs/{orgId}/webhooks`

Register an HTTPS endpoint (webhooks:manage, AAL2). Production requires the staff production-API grant. The signing secret is returned once.

When to use it: Once per receiving URL. Store the signing secret from the response; it is shown once. Private, loopback and link-local addresses are rejected.


Requires: permission webhooks:manage; second factor for browser sessions

## Request body

- `url` (string (uri), required): 
- `description` (string): 
- `events` (enum[], required):  One of payment.updated, withdrawal.updated, onboarding.updated, platform_customer.updated.

```json
{
  "url": "https://hooks.acme-robotics.example/payezy",
  "description": "Production webhook receiver",
  "events": [
    "payment.updated",
    "withdrawal.updated",
    "onboarding.updated",
    "platform_customer.updated"
  ]
}
```

Errors: invalid_url, events_required, invalid_event

```bash
curl -X POST "https://sandbox-api.payezy.io/v1/orgs/$ORG_ID/webhooks" \
  -H "Authorization: Bearer $PAYEZY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://hooks.acme-robotics.example/payezy",
  "description": "Production webhook receiver",
  "events": [
    "payment.updated",
    "withdrawal.updated",
    "onboarding.updated",
    "platform_customer.updated"
  ]
}'
```
