> For the complete documentation index, see [llms.txt](https://readme.directual.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://readme.directual.com/api-integrations/webhooks.md).

# Webhooks

**Webhooks** represent automated notifications dispatched by applications in response to specific events. These notifications consist of a message or ***payload*** in JSON format and are directed to a distinct URL. In Directual, you have the capability to generate these unique URLs for receiving such notifications.

### Creating webhooks

Go to **API** section → **Webhooks** → **+ New webhook** and enter system name of a new webhook.  In 99% of cases you will need a scenario for parsing incoming objects. Such a scenario can be created automatically right here.

![](/files/-MYf2I2AkdZd-DCUXRpp)

Copy the Webhook URL and use it with your external service to send messages to Directual.

### Storing incoming messages

After setting up a webhook, Directual automatically generates the corresponding [data structure](/data/data-structures.md) within the ***Integrations*** → ***Webhooks*** folder, and you'll also find a convenient link to it in the webhooks table. The first object in this folder is created by Directual for testing purposes.

![](/files/-MYf4SfXOndQFrMTo-ZY)

There are the following fields in the webhook data structure:

* `id` — usual unique field
* `body, headers, urlData` — fields in JSON format. One or a few of them contain data (depending on a specific third party service)

### Dealing with incoming messages

Objects coming via Webhooks contain data in JSON-format. The best way to deal with them is to [apply JSON-step](/scenarios/editing-scenarios/action-steps/json-step.md) or to apply [templating techniques for parsing JSON](/template-system/basics-of-template-system/advanced-templating-techniques.md#handling-json).

### Changing API-response

The default response is:

```
{
  "result": null,
  "status": "OK"
}
```

Occasionally, a third-party system may necessitate a specific response in JSON or even XML format. Fortunately, this is not a limitation, as you have the flexibility to construct any API response you require. Here's how:

#### 1. Add a synchronous scenario for your webhook

![](/files/-MYf86iyYxMVdC0F8qSn)

Please take note that the scenario needs to be published and run.

<br>

#### 2. Setup an API-response step in the scenario

Have a look at the [API-response step documentation](/scenarios/editing-scenarios/integration-steps/api-response.md).&#x20;

### Practical tip

Take a look at the tutorial on how to update an existing data table using incoming JSON data:

{% embed url="<https://youtu.be/qnc7sBiGkFg>" %}
уы
{% endembed %}
