# Webhook

The webhook action can be used to invoke any third-party **REST API** and sends the sample in the request body.

The HTTP method, multiple custom headers, content type, and authentication method can easily be specified.<br>

Authentication flows (e.g. Oauth2) are not yet supported.

{% hint style="info" %}
The whole sample will be forwarded to the invoked endpoint. Make sure you trust the API in question and don't include sensitive data in the sample.
{% endhint %}

![Webhook template](https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2Fo1gegxan4BnuwNHVXsap%2Fscreely-1685093202840.png?alt=media\&token=1f2e04eb-2227-4a76-8356-2dc71358e8d5)

### Templating

It is possibly the dynamically customize the webhook url by using template variables. For example `https://webhook-url.com?deviceId={{deviceId}}`. Available variables are listed [here](https://docs.akenza.io/akenza.io/get-started/reference/message-templating).

Notably, each template will be url encoded.

```
template: https://example.com/{{data.param1}}/{{data.param2}}
data.param1: workspaces
data.param2: devices
result: https://example.com/workspaces/devices
```

Avoid to template the full path as `/`  will also be encoded:

```
template: https://example.com/{{data.param1}}
data.param1: workspaces/devices
result: https://example.com/workspaces%2Fdevices
```
