# dokploy_ntfy_notification (Resource)

An ntfy notification channel (Settings > Notifications). Dokploy publishes each message to a topic on an ntfy server.

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.

~> **Dokploy stores and returns `access_token` in cleartext.** The attribute is sensitive, so Terraform does not print it, but anyone with API access to the server can read it. The `access_token_wo` companion keeps it out of the Terraform state.

## Example Usage

```terraform
# Publish to a protected topic on ntfy.sh.
resource "dokploy_ntfy_notification" "phone" {
  name       = "phone"
  server_url = "https://ntfy.sh"
  topic      = "my-org-dokploy"
  priority   = 4

  access_token_wo         = var.ntfy_access_token
  access_token_wo_version = 1

  app_deploy      = true
  app_build_error = true
}

# A public topic needs no token.
resource "dokploy_ntfy_notification" "public" {
  name       = "public"
  server_url = "https://ntfy.sh"
  topic      = "my-org-dokploy-public"

  dokploy_restart = true
}
```

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

### Required

- `name` (String) Display name. Dokploy does not enforce a unique name.
- `server_url` (String) URL of the ntfy server, for example `https://ntfy.sh`.
- `topic` (String) Topic that receives the message.

### Optional

> **NOTE**: [Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments) are supported in Terraform 1.11 and later.

- `access_token` (String, Sensitive) Access token for a protected topic. Omit it for a public topic. Do not set it together with `access_token_wo`. If you remove both from the configuration, the provider clears it.
- `access_token_wo` (String, Sensitive, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) Write-only form of `access_token`. Terraform keeps it out of the plan and the state. It needs Terraform 1.11 or later. Do not set it together with `access_token`. A new value reaches the server only when `access_token_wo_version` changes.
- `access_token_wo_version` (Number) Version of `access_token_wo`. Change it to send the current `access_token_wo` value to the server. It needs `access_token_wo`.
- `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`.
- `priority` (Number) Message priority from 1 (min) to 5 (max). Defaults to `3`.
- `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_ntfy_notification.example INt_PYqh9apo8mmDIoixZ
```