# dokploy_custom_notification (Resource)

A custom webhook notification channel (Settings > Notifications). Dokploy sends each message as a JSON POST to an endpoint of your own.

Each event attribute selects one Dokploy event that sends a message on this channel. All events default to `false`, so a new channel sends nothing until you enable one.

~> Dokploy does not test the channel on create or update. A wrong URL or token applies successfully and fails on the first message.

## Example Usage

```terraform
# Send each event as a JSON POST to an endpoint of your own, with an
# authorization header.
resource "dokploy_custom_notification" "pipeline" {
  name     = "pipeline"
  endpoint = "https://hooks.example.com/dokploy"

  headers = {
    "Authorization" = "Bearer ${var.hooks_token}"
    "X-Source"      = "dokploy"
  }

  app_deploy      = true
  app_build_error = true
  database_backup = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `endpoint` (String) URL that receives the POST.
- `name` (String) Display name. Dokploy does not enforce a unique name.

### Optional

- `app_build_error` (Boolean) Send a message when a build fails. Defaults to `false`.
- `app_deploy` (Boolean) Send a message when an application or a compose deploys. Defaults to `false`.
- `database_backup` (Boolean) Send a message when a database backup runs. Defaults to `false`.
- `docker_cleanup` (Boolean) Send a message when the Docker cleanup runs. Defaults to `false`.
- `dokploy_backup` (Boolean) Send a message when the Dokploy server backup runs. Defaults to `false`.
- `dokploy_restart` (Boolean) Send a message when Dokploy restarts. Defaults to `false`.
- `headers` (Map of String, Sensitive) HTTP headers that each request carries, for example an authorization header. The map is sensitive because it usually holds a credential. If you remove it from the configuration, the provider clears it.
- `server_threshold` (Boolean) Send a message when a server crosses a resource threshold. Defaults to `false`.
- `volume_backup` (Boolean) Send a message when a volume backup runs. Defaults to `false`.

### Read-Only

- `created_at` (String) Creation timestamp from the server.
- `id` (String) Notification id.

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
terraform import dokploy_custom_notification.example INt_PYqh9apo8mmDIoixZ
```