> For the complete documentation index, see [llms.txt](https://helpdocumentation.gitbook.io/user/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/messaging-channels/whatsapp-api/managing-your-whatsapp-api/set-webhook-url-to-receive-delivery-reports-message-statues-from-meta-for-your-whatsapp-api.md).

# Set Webhook Url to Receive Delivery Reports / Message Statues From Meta For Your WhatsApp API

* Go to **Channels → Webhook** and click **Add Webhook**.
* Open **webhook.site** in a new tab and click **New** to generate a test webhook.
* Click the **Edit** option and configure the response:
  * Status Code = **200**
  * Content Type = **text/html**
  * Content = **$request.query.challange$**
* Save the changes and copy the **unique webhook URL**.
* Go back to **Channels → Webhook**, paste the URL, and give your webhook a **title**.
* Select the required **channel events** (incoming messages, calls, outgoing messages, etc.).
* Click **Add Webhook** to save.
* Once confirmed, incoming webhook events will start appearing instantly.
* Make sure your **server URL responds with the challenge query**, otherwise verification will fail.

*<mark style="background-color:blue;">**It is Important that your server URL responds with the Challange Query**</mark>*

### PHP Code For Webhook Challenge Response

```
<?php
//Check if method is GET
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    //Check if query contains the challange parameter
    if (isset($_GET['challange'])) {
        //Get parameter value
        $challenge = $_GET['challange'];
        echo $challenge;
    } else {
        //No Parameter Found
        echo "no challange";
    }
}
?>
```

### Node JS Code For Webhook Challange Response

```
app.get('/your_webhook_endpoint',(req, res) => {
  try {
    res.send(req.query['challange']);
  } catch (error) {
    res.send(error.message);
  }
});
```

### Video Tutorial

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


---

# 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 dynamically by asking a question.

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

```
GET https://helpdocumentation.gitbook.io/user/messaging-channels/whatsapp-api/managing-your-whatsapp-api/set-webhook-url-to-receive-delivery-reports-message-statues-from-meta-for-your-whatsapp-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
