> For the complete documentation index, see [llms.txt](https://guide.tiledesk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.tiledesk.com/apps-and-integrations/whatsapp-business/how-to-set-up-a-webhook-for-your-whatsapp-updates.md).

# How to set up a webhook for your WhatsApp updates

In this article you will learn how to set up a webhook to receive **Real Time Updates** for your [WhatsApp Broadcasts](/apps-and-integrations/whatsapp-business/how-to-perform-a-whatsapp-broadcast-using-tiledesk.md) and all Whatsapp Updates for your standard conversations.

For any doubt on how to connect you WhatsApp Business account with Tiledesk and how perform WhatsApp Broadcasts, please refer to the following guides:

* [How to configure a WhatsApp Business account](/apps-and-integrations/whatsapp-business/how-to-configure-a-whatsapp-business-account.md)
* [How to connect Tiledesk with WhatsApp Business](/apps-and-integrations/whatsapp-business/how-to-connect-tiledesk-with-whatsapp-business.md)
* [How to perform a WhatsApp broadcast using Tiledesk](/apps-and-integrations/whatsapp-business/how-to-perform-a-whatsapp-broadcast-using-tiledesk.md)

**Receive Real Time Update for a WhatsApp Broadcast**[**#**](https://gethelp.tiledesk.com/articles/how-to-set-up-a-webhook-for-your-whatsapp-updates/#receive-real-time-update-for-a-whatsapp-broadcast)

After starting a broadcast operation, you can receive all updates regarding it. Tiledesk will send these updates automatically, so you just need to create your own webhook endpoint and subscribe to the correct event.

Login to [Tiledesk Dashboard](https://panel.tiledesk.com/v3/dashboard/#/projects), select a project and go to *Settings → Project Settings → Developer → Manage Webhook.*

Then click on **Add Subscription** to create a new subscription.&#x20;

Select from the dropdown menu the event ‘**Event Emit**', type your webhook endpoint address and click on **Create Subscription**.

<figure><img src="https://1328774413-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVguk6y5OMn3pAaHZSiwU%2Fuploads%2FWVXuSJP9y8zCzD91PS4n%2F2mbels-Screenshot%202024-01-08%20alle%2013.27.07.png?alt=media&amp;token=08213660-37ca-4d8d-bba0-2afe94cbef18" alt=""><figcaption></figcaption></figure>

From now on you will receive all events on your webhook.

In order to discriminate the events that concern a broadcast, simply add on your webhook the following code:

```
app.post('/hook', async (req, res) => {
	if (req.body?.payload?.name === "tiledesk.whatsapplog") {
    	let whatsapp_log = req.body.payload.attributes?.messageLog;
    	console.log(whatsapp_log);
  	}
});
```

👉 Check out the [Public example on Glitch ](https://glitch.com/edit/#!/tiledesk-whatsapp-hook?path=index.js%3A37%3A0)

**Receive all updates from WhatsApp**[**#**](https://gethelp.tiledesk.com/articles/how-to-set-up-a-webhook-for-your-whatsapp-updates/#receive-all-updates-from-whatsapp)

Similarly to the previous case,  the only thing you need is to create your own webhook endpoint and subscribe to the correct event.

Again, login to [Tiledesk Dashboard](https://panel.tiledesk.com/v3/dashboard/#/projects), select a project and go to *Settings → Project Settings → Developer → Manage Webhook.*

Then click on **Add Subscription** to create a new subscription.&#x20;

Select from the dropdown menu the event ‘**Event Emit**', type your webhook endpoint address and click on **Create Subscription**. Feel free to choose the same endpoint then before or a new one. Just be careful how to discriminate this type of event on your webhook, for which you will have to follow the following code:

```
app.post('/hook', async (req, res) => {
 	if (req.body?.payload?.name === "tiledesk.whatsappfw") {
    	let whatsapp_body = req.body.payload.attributes?.whatsappBody;
    	console.log(whatsapp_body);
  	}
});
```

👉 Check out the [Public example on Glitch ](https://glitch.com/edit/#!/tiledesk-whatsapp-hook?path=index.js%3A37%3A0)

If you have any questions, feel free to contact us live on chat or at [support@tiledesk.com](mailto:info@tiledesk.com) 📧&#x20;

For more info on who we are, what we do, or what is our shtick, visit the [Tiledesk Website](https://tiledesk.com/) 👩‍🚀


---

# 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://guide.tiledesk.com/apps-and-integrations/whatsapp-business/how-to-set-up-a-webhook-for-your-whatsapp-updates.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.
