# Configure Webhook

<mark style="color:yellow;">`POST`</mark>  `/api/v2/webhooks`

The Configure Webhook endpoint sets a webhook for a specified event\_type. This means all events related to the specified event\_type will be sent to the configured webhook URL.\
\
**Request Body**

<table><thead><tr><th width="300">Name</th><th width="101">Type</th><th width="209">Description</th><th>Required</th></tr></thead><tbody><tr><td>event_type</td><td>integer</td><td>The type of the event. See <a data-mention href="/pages/0rCfa6GBx41GUWZ1WA15">/pages/0rCfa6GBx41GUWZ1WA15</a> for the available event types.</td><td>True</td></tr><tr><td>webhook_url</td><td>string</td><td>The endpoint that will receive webhook requests. This must be a POST endpoint.</td><td>True</td></tr></tbody></table>

###

{% code title="REQUEST" overflow="wrap" %}

```json
{
  "event_type": 1,
  "webhook_url": "https://example.com/api/webhook"
}
```

{% endcode %}

{% tabs %}
{% tab title="RESPONSE" %}

```json
{
  "status": "success",
  "data": {
    "webhook_url": "https://example.com/api/webhook",
    "event_names": null,
    "event_names": null,
    "ip_allowlist": null,
    "id": "01954751-cccd-709a-baee-ee3ddac37e39",
    "event_type": 1,
    "business_id": "06790d62-07e5-7aac-8000-d0462f2c2d94",
    "created_by": "06790d73-154f-7dae-8000-12b54a9a258a",
    "created": "2025-02-26T21:57:18.000+08:00",
    "modified_by": "06790d73-154f-7dae-8000-12b54a9a258a",
    "last_modified": "2025-02-26T21:57:18.000+08:00",
    "webhook_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ospree.io/ospree-api/webhooks/api-endpoints/configure-webhook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
