> For the complete documentation index, see [llms.txt](https://tolstoy.gitbook.io/tolstoy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tolstoy.gitbook.io/tolstoy/reference/webhook.md).

# Webhook

Webhooks operations

## List Webhooks

<mark style="color:blue;">`GET`</mark> `https://api.gotolstoy.com/webhooks`

This endpoint returns a list of your webhooks.

#### Headers

| Name          | Type   | Description                      |
| ------------- | ------ | -------------------------------- |
| Authorization | string | Authorization token Bearer Token |

{% tabs %}
{% tab title="200 List of webhooks " %}

```
[{"createdAt":"2021-03-22T13:51:16.322Z","event":"response_summary","owner":"32f9d998-9217-47bb-8f76-c0a6dee4931b","url":"https://my.web.hook.url","id":"d955d84b-046f-4b28-92ab-4d3a228c5c04","updatedAt":"2021-03-22T13:51:16.322Z"}]
```

{% endtab %}
{% endtabs %}

## Add Webhook

<mark style="color:green;">`POST`</mark> `https://api.gotolstoy.com/webhooks/`

Add a Webhook for an event\
Available events:\
\- **response\_summary**\
\- **collected\_info**\
\- **conversion**

#### Headers

| Name          | Type   | Description                        |
| ------------- | ------ | ---------------------------------- |
| Authorization | string | Authorization token - Bearer Token |

#### Request Body

| Name  | Type   | Description                        |
| ----- | ------ | ---------------------------------- |
| event | string | The event you want to subscribe to |
| url   | string | The url to send the event to       |

{% tabs %}
{% tab title="200 The new webhook that was created" %}

```
{"id":"8fde3c42-0d34-4d51-8b48-6930c1a5bf80","url":"https://my.web.hook.url","event":"response_summary","owner":"43a7bd93-c302-4c18-93bc-d7151c586336","__typename":"webhook","createdAt":"2021-05-23T13:44:05.854Z","updatedAt":"2021-05-23T13:44:05.854Z"}
```

{% endtab %}
{% endtabs %}

## Delete Webhook

<mark style="color:red;">`DELETE`</mark> `https://api.gotolstoy.com/webhooks/:id`

Delete a webhook

#### Path Parameters

| Name | Type   | Description          |
| ---- | ------ | -------------------- |
| id   | string | Webhook id to delete |

#### Headers

| Name          | Type   | Description                        |
| ------------- | ------ | ---------------------------------- |
| Authorization | string | Authorization token - Bearer Token |

{% tabs %}
{% tab title="200 Webhooks deleted" %}

```
```

{% endtab %}
{% endtabs %}
