# Webhook

> Resource Webhook in pulumi-portainer.

<!-- Generated from the pulumi-portainer SDK. -->

Resource Webhook in pulumi-portainer.

Pulumi type: `portainer:index/webhook:Webhook`.

`name` is the Pulumi resource name. Nested object fields are documented under that object. They are not arguments of this resource.

## Example

Only required arguments are set. A string in angle brackets stands in for that argument. Any other value is an option or example written in the SDK description.

```ts
import * as portainer from "pulumi-portainer"

const resource = new portainer.Webhook("webhook", {
  endpointId: 0,
  resourceId: "<resourceId>",
  webhookType: 0,
})
```

## Arguments

| Property           | Type      | Required | Description                                                                                                                                                                                                                                                    |
| ------------------ | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `endpointId`       | `number`  | yes      | Identifier of the Portainer environment (endpoint) the webhook is bound to. Changing this value forces resource recreation.                                                                                                                                    |
| `reassignOnChange` | `boolean` | no       | Whether changing `resourceId` or `webhookType` reassigns the existing webhook instead of replacing it, keeping its token and every URL already handed out. **Business Edition only**; leave it off on CE, which has no reassign endpoint. Defaults to `false`. |
| `registryId`       | `number`  | no       | Identifier of the Portainer registry associated with this webhook. Used when the webhook triggers actions on images from that registry.                                                                                                                        |
| `resourceId`       | `string`  | yes      | Identifier of the target resource (e.g. service ID) the webhook will act upon. Changing this value replaces the webhook unless `reassignOnChange` is set.                                                                                                      |
| `webhookId`        | `string`  | no       |                                                                                                                                                                                                                                                                |
| `webhookType`      | `number`  | yes      | Type of webhook in Portainer (e.g. 1 = service webhook, 2 = container webhook). Changing this value replaces the webhook unless `reassignOnChange` is set.                                                                                                     |

## Outputs

Computed outputs are produced by the provider. They are not constructor arguments.

| Property           | Type      | Computed | Description                                                                                                                                                                                                                                                    |
| ------------------ | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `endpointId`       | `number`  | no       | Identifier of the Portainer environment (endpoint) the webhook is bound to. Changing this value forces resource recreation.                                                                                                                                    |
| `reassignOnChange` | `boolean` | no       | Whether changing `resourceId` or `webhookType` reassigns the existing webhook instead of replacing it, keeping its token and every URL already handed out. **Business Edition only**; leave it off on CE, which has no reassign endpoint. Defaults to `false`. |
| `registryId`       | `number`  | no       | Identifier of the Portainer registry associated with this webhook. Used when the webhook triggers actions on images from that registry.                                                                                                                        |
| `resourceId`       | `string`  | no       | Identifier of the target resource (e.g. service ID) the webhook will act upon. Changing this value replaces the webhook unless `reassignOnChange` is set.                                                                                                      |
| `token`            | `string`  | yes      | Webhook token generated by Portainer. Appended to the webhook URL to authenticate trigger calls.                                                                                                                                                               |
| `webhookId`        | `string`  | no       |                                                                                                                                                                                                                                                                |
| `webhookType`      | `number`  | no       | Type of webhook in Portainer (e.g. 1 = service webhook, 2 = container webhook). Changing this value replaces the webhook unless `reassignOnChange` is set.                                                                                                     |
