> For the complete documentation index, see [llms.txt](https://petercheng7788.gitbook.io/developer-note/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://petercheng7788.gitbook.io/developer-note/web-communication/rest-api/web-hook.md).

# Web Hook

## Introduction

![](https://1374779285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFW3x2aqEO8GF2kr3VU%2Fuploads%2FoRDIY1uNhDSOcKmBV78q%2Fimage.png?alt=media\&token=30ee3ec6-43be-4775-9f95-2914c3843eb8)

* It is in a publish-and-subscribe format
* Client is required to enter endpoint url to web hook provider in order to subscribe the event
* When there is a event, the provider will send the post request to the endpoint actively in order to publish the new message to the client

## Web hook vs API

* It can be treated as API in reverse, the server send to client actively , instead of client make a request to server
* Once subscribed to provider, the provider will keep sending event to client continuously, instead of client send the request to server with constant time interval which is called polling
