# Setting Up a Webhook

BoldSign supports two types of webhooks: **App-Level** and **Account-Level**. Follow these instructions to configure each webhook type effectively.

## App-Level Webhook

### Step 1: Create an OAuth App

- Navigate to the **API → OAuth Apps** section in BoldSign.
- Click **Create OAuth App**, provide the required details, and click **Save**.

    ![OAuth app](/static/images/webhooks/oauth-app.webp)

    ![OAuth save](/static/images/webhooks/oauth-save.webp)

### Step 2: Add a Webhook

- Navigate to **API → Webhooks**.
- Click **Add Webhook**.

![Create webhook](/static/images/webhooks/create-webhook.webp)

### Step 3: Configure Webhook Details

Fill out the webhook configuration form:

- Select **App Level**.
- Choose the OAuth application created in Step 1.
- Enter a descriptive name for the webhook.
- Provide a valid publicly accessible **HTTPS webhook URL**.
- Select the desired events that trigger webhook callbacks.

    ![Select AP Ps level](/static/images/webhooks/select-AP-Ps-level.webp)

    ![Select application](/static/images/webhooks/select-application.webp)

    ![Webhook name](/static/images/webhooks/webhook-name.webp)

    ![Https url](/static/images/webhooks/https-url.webp)

### Step 4: Verify Webhook URL

Click **Verify** to initiate URL verification. BoldSign sends an HTTP POST request with the following JSON payload:

 ![Click verify button](/static/images/webhooks/click-verify-button.webp)

```json
{
    "event": {
        "id": "7c872a5b-xxxx-xxxx-xxxx-92530a83a8b9",
        "created": 1617180024,
        "eventType": "Verification",
        "clientId": "17c97f7a-xxxx-xxxx-xxxx-fef97b6544a7",
        "environment": "Test"
    }
}
```

Your endpoint must respond with **HTTP 200 OK** within **10 seconds**. Successful verification will show an acknowledgment message.
![URL verification](/static/images/webhooks/url-verification.webp)

You can subscribe and listen to individual events or all the events that happen in a document from a webhook.

![Trigger events](/static/images/webhooks/trigger-events.png)

### Step 5: Save the Webhook

After successful verification, click **Save** to complete the webhook setup.

![Submit form](/static/images/webhooks/submit-form.webp)


## Account-Level Webhook

### Step 1: Add a Webhook

- Navigate to **API → Webhooks**.
- Click **Add Webhook**.

  ![Create webhook](/static/images/webhooks/create-webhook.webp)

### Step 2: Configure Webhook Details

Complete the webhook configuration form:

- Select **Account Level**.
- Enter a descriptive name for your webhook.
- Provide a valid publicly accessible **HTTPS webhook URL**.
- Choose the specific events to trigger webhook callbacks.

    ![Account level](/static/images/webhooks/account-level.png)

    ![Account name](/static/images/webhooks/enter-account-name.png)

    ![Verify account url](/static/images/webhooks/verify-account-url.png)

### Step 3: Verify Webhook URL

Click **Verify**. BoldSign will send a verification HTTP POST request with this JSON payload:

![Verified url](/static/images/webhooks/verified-url.png)

```json
{
    "event": {
        "id": "7c872a5b-xxxx-xxxx-xxxx-92530a83a8b9",
        "created": 1617180024,
        "eventType": "Verification",
        "environment": "Test"
    }
}
```

Ensure your endpoint responds with **HTTP 200 OK** within **10 seconds**. Upon successful verification, you'll receive an acknowledgment message.

![Verified url](/static/images/webhooks/verified-url.png)

You can subscribe and listen to individual events or all the events that happen in a document from a webhook.

![Trigger events](/static/images/webhooks/trigger-events.png)

### Step 4: Save the Webhook

Click **Save** to finalize the webhook setup.

![Submit account level](/static/images/webhooks/submit-account-level.png)
