> For the complete documentation index, see [llms.txt](https://docs.8pay.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.8pay.network/api/variable-recurring/webhook.md).

# Webhook

A webhook can be set up to receive notifications of events that occur on a plan.

## Set a webhook

<mark style="color:orange;">`PUT`</mark> `https://api.8pay.network/v1/:chain/variable-recurring/plans/:planId/webhook`

#### Path Parameters

| Name   | Type   | Description                                 |
| ------ | ------ | ------------------------------------------- |
| planId | string | ID of the plan                              |
| chain  | string | [chain identifier](/api/overview.md#chains) |

#### Headers

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| Authorization | string | Bearer \<api-key> |

#### Request Body

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| webhook | string | webhook url |

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

```
{
    "webhook": "http://mywebhook.com/path/file.php"
}
```

{% endtab %}
{% endtabs %}

## Get a webhook

<mark style="color:blue;">`GET`</mark> `https://api.8pay.network/v1/:chain/variable-recurring/plans/:planId/webhook`

#### Path Parameters

| Name   | Type   | Description                                 |
| ------ | ------ | ------------------------------------------- |
| planId | string | ID of the plan                              |
| chain  | string | [chain identifier](/api/overview.md#chains) |

#### Headers

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| Authorization | string | Bearer \<api-key> |

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

```
{
    "webhook": "http://mywebhook.com/path/file.php"
}
```

{% endtab %}
{% endtabs %}

## Delete a webhook

<mark style="color:red;">`DELETE`</mark> `https://api.8pay.network/v1/:chain/variable-recurring/plans/:planId/webhook`

#### Path Parameters

| Name   | Type   | Description                                 |
| ------ | ------ | ------------------------------------------- |
| planId | string | ID of the plan                              |
| chain  | string | [chain identifier](/api/overview.md#chains) |

#### Headers

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| Authorization | string | Bearer \<api-key> |

{% tabs %}
{% tab title="204 " %}

```
```

{% endtab %}
{% endtabs %}
