> ## Documentation Index
> Fetch the complete documentation index at: https://docs.balaipedia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set webhook

> Set your webhook URL (or rotate its secret).

Returns the webhook with a new signing `secret` (shown only once). POST again to change the URL or rotate the secret.

A webhook URL must be a public `https` URL on port 443 with a hostname (no IP addresses, no credentials in the URL). See [Webhooks](https://docs.balaipedia.com/webhooks.md) for events and signature verification.

## Body

**url** `string` *required*

Your public HTTPS endpoint, e.g. `https://example.com/hooks/orders`.

```bash curl theme={null}
curl -X POST https://orders.balaipedia.com/v1/webhook \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/hooks/orders"}'
```

```json 200 OK theme={null}
{"object":"webhook","url":"https://example.com/hooks/orders","enabled":true,"secret":"whsec_...","note":"Store this secret now. It is shown only once; POST again to rotate it."}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.