> For the complete documentation index, see [llms.txt](https://whats-application-api.gitbook.io/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whats-application-api.gitbook.io/api-docs/general/webhooks.md).

# Webhooks

Register new webhook endpoint URL for callback notifications.

If you do not know what webhooks are, [read this article](https://markheath.net/post/basic-introduction-webhooks).

**Note**: webhook endpoint URL must be reachable at public Internet level and use a valid domain with proper DNS resolution. E.g: <https://mycompany.com/webhook>

Our system will make an [HTTP request](https://www.tutorialspoint.com/http/http_requests.htm) to the remote endpoint URL you provide every time a new message/device event happens.

Information will be encoded in [JSON](https://www.json.org/) format as part of the HTTP body data.

Your server must accept read the body in the HTTP POST request and process it accodingly.

You server should reply with a 200-209 HTTP status code. Otherwise, it will be considered as a failed notification and it will be retried.

#### Common questions <a href="#common-questions" id="common-questions"></a>

**How data will be notified to my server?**

We notify you by making an HTTP POST method request with a JSON encoded body.

**How to implement a webhooks server?**

This would drastically depend on the technology / programming language you use, but options are multiple here.

Basically, you would simply need an HTTP server running on Internet that can accept HTTP POST requests.

You can also take a look at these resources for more information:

* [Webhook Tester](https://webhook.site/)
* [What are Webhooks](https://codeburst.io/what-are-webhooks-b04ec2bf9ca2)
* [Handling Webhook Requests in PHP](https://lornajane.net/posts/2017/handling-incoming-webhooks-in-php)
* [Webhook server in Go](https://github.com/adnanh/webhook)

**How to secure a webhook server?**

Firstly, we strongly recommend you to use HTTPS (HTTP + TLS encryption) in your server.

Secondly, you can use a custom URL query param with a secret key that only you know. Example: <https://mycompany.com/webhooks?secret=some-secret-token>

<br>
