# Configure Webhooks

A webhook is configured the same way regardless of how you set it up, with a destination `url`, at least one trigger, and optionally how WHITELABEL authenticates to your endpoint. See [Events and Triggers](/docs/webhooks/events) for the full catalog of events you can select.

<Tabs>
  <Tab title="Dashboard">
    1. Navigate to the **Developers** tab
    2. Click **Webhooks**
    3. Click **Add webhook**

    A sidebar will open where you'll configure:

    * **Name**: Identify your webhook
    * **Endpoint URL**: Your server URL to receive notifications
    * **x-api-key**: Your API key, sent in notification headers (`api_key` via the API)
    * **x-secret**: Your secret, sent in notification headers (`secret` via the API)
    * **Use OAuth2 Authentication**: Optional checkbox for OAuth2
    * **Use HMAC Authentication**: Optional checkbox for HMAC signature verification
    * **Trigger on**: Select which events will trigger this webhook (enrollment, payment, subscription, etc.)

    Once configured, the webhook will send notifications whenever the selected events occur. The image below shows the side panel to add a webhook.

    <Frame><img src="/images/reference/configure-webhooks/image1.png" /></Frame>

    In the [WHITELABEL dashboard](https://dashboard.whitelabel.com/) Developers tab, you can activate and deactivate webhooks using the **Status** toggle button.
  </Tab>
  <Tab title="API">
    Send the destination `url`, a unique `name`, and at least one trigger to [Create a Webhook](/reference/webhooks/create-webhook):

    ```bash cURL
    curl -X POST 'https://api-sandbox.whitelabel.com/v1/webhooks' \
      -H 'public-api-key: <YOUR_PUBLIC_API_KEY>' \
      -H 'private-secret-key: <YOUR_PRIVATE_SECRET_KEY>' \
      -H 'Content-Type: application/json' \
      -d '{
        "account_id": "<ACCOUNT_ID>",
        "name": "Order updates",
        "url": "https://your-endpoint.example.com/whitelabel-webhooks",
        "payment_triggers": ["AUTHORIZE", "PURCHASE"]
      }'
    ```

    The response includes the `id` you use to [retrieve](/reference/webhooks/retrieve-webhook), [update](/reference/webhooks/update-webhook), or [delete](/reference/webhooks/delete-webhook) it. See the full [Webhooks API reference](/reference/webhooks) for every field, including delivery authentication and error responses.
  </Tab>
</Tabs>

Access the [Payloads and Examples](/docs/webhooks/object-and-examples) page to check examples for payment, enrollment, and many other notification events.

### HMAC authentication

Check **Use HMAC Authentication** in the dashboard, or set `hmac_client_secret` via the API. Either way, WHITELABEL uses that key to generate an HMAC-SHA256 signature and sends it in the `x-hmac-signature` header with each delivery, so you can verify a webhook genuinely came from WHITELABEL and wasn't tampered with.

See the [Verify Webhook Signatures (HMAC)](/docs/webhooks/verify-webhook-signatures-hmac) guide for implementation details.

### OAuth2

Check **Use OAuth2 Authentication** in the dashboard, or set the matching fields via the API, so WHITELABEL can obtain the token it sends with each delivery:

| Dashboard field | API field | Description |
| :--------------- | :-------- | :----------- |
| Authentication URL | `oauth2_authentication_url` | Your token endpoint, over HTTPS. |
| Client ID | `oauth2_client_id` | The client identifier WHITELABEL authenticates with. |
| Client Secret | `oauth2_client_secret` | The client secret WHITELABEL authenticates with. |
| Grant Type | `oauth2_grant_type` | The grant type WHITELABEL requests the token with, typically `client_credentials`. |

<Note>
The API also exposes `oauth2_scope`, `oauth2_authorization_name` (the header WHITELABEL sends the token in, defaults to `Authorization`), and `oauth2_include_client_id`. These don't have a dashboard equivalent yet. See [OAuth2](/reference/webhooks#oauth2) for the full field reference.
</Note>

<Frame><img src="/images/reference/configure-webhooks/image2.png" /></Frame>