> For the complete documentation index, see [llms.txt](https://helpdocumentation.gitbook.io/user-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helpdocumentation.gitbook.io/user-documentation/web-chat-widget/webhook-and-api-key.md).

# Webhook & API Key

#### &#x20;**Create a Webhook**

1. Go to **Web Chat → Webhook**.
2. Click **Add Endpoint**.
3. Open **Webhook.site** and create a new endpoint.
4. In Webhook.site, configure the verification response:
   * **Status Code:** `200`
   * **Content Type:** `text/html`
   * **Response Content:** `$request.query.hub_challenge$`
5. Copy the generated **Webhook URL**.
6. Paste the URL in the **Payload URL** field.
7. Enter a **Webhook Name**.
8. Select the required events:
   * Message Created
   * Conversation Created
   * Conversation Closed
   * Conversation Reopen
9. Enable the webhook and click **Add Endpoint**.
10. Copy and securely save the generated **Secret Key**.

#### Manage Webhook

* **Enable/Disable:** Control whether events are sent.
* **Rotate Secret:** Generate a new secret key.
* If you rotate the secret, update the new key in your integration.

#### API Documentation

1. Click **API Documentation** from the top-right corner.
2. Select the API you want to use.
3. Check the **Endpoint, Request Details, Parameters, Headers, and Response**.
4. Use this information to integrate the API with your own application.

#### Create API Key

1. Go to **API Key**.
2. Click **Add New API Key**.
3. Enter a name for the key.
4. Click **Create Key**.
5. Copy and securely save the API key immediately.
6. Use the key in the **`X-API-Key`** header for API requests.

> **Important:** Webhook secret and API key are sensitive credentials. Never expose them in frontend code or public repositories.

API Documentation : <https://documenter.getpostman.com/view/14215086/2sBY4WowcH#894eeed7-44d3-4c9b-9fde-0bdb28b8bf8f>

{% embed url="<https://www.youtube.com/watch?v=u5Ps1taJUMY>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://helpdocumentation.gitbook.io/user-documentation/web-chat-widget/webhook-and-api-key.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
