# dokploy_gotify_notification (Resource)

A Gotify notification channel (Settings > Notifications). Dokploy pushes each message to a Gotify 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. Set `verify_connection = true` to test the channel before the write.

~> **Dokploy stores and returns `app_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 `app_token_wo` companion keeps it out of the Terraform state.

## Example Usage

```terraform
# Push messages to a self-hosted Gotify server.
resource "dokploy_gotify_notification" "phone" {
  name       = "phone"
  server_url = "https://gotify.example.com"
  priority   = 8

  app_token_wo         = var.gotify_app_token
  app_token_wo_version = 1

  app_build_error  = true
  server_threshold = true
}
```

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

### Required

- `name` (String) Display name. Dokploy does not enforce a unique name.
- `server_url` (String) URL of the Gotify server.

### Optional

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

- `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`.
- `app_token` (String, Sensitive) Token of the Gotify application. Set this attribute or `app_token_wo`.
- `app_token_wo` (String, Sensitive, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) Write-only form of `app_token`. Terraform keeps it out of the plan and the state. It needs Terraform 1.11 or later. Set exactly one of `app_token` and `app_token_wo`. A new value reaches the server only when `app_token_wo_version` changes.
- `app_token_wo_version` (Number) Version of `app_token_wo`. Change it to send the current `app_token_wo` value to the server. It needs `app_token_wo`.
- `database_backup` (Boolean) Send a message when a database backup runs. Defaults to `false`.
- `decoration` (Boolean) Include emoji and formatting in the message. Defaults to `true`.
- `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, 1 or higher. Defaults to `5`.
- `server_threshold` (Boolean) Send a message when a server crosses a resource threshold. Defaults to `false`.
- `verify_connection` (Boolean) Test the connection with `notification.testGotifyConnection` before the provider creates or updates the record. If the test fails, the apply fails with the server message, and the provider writes nothing. The default is no check: `null` and `false` both skip the test. Dokploy stores no value for this attribute, so `terraform import` leaves it `null`. The test sends a real test message to the channel.
- `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:

In Terraform v1.5.0 and later, the [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used with the `id` attribute, for example:

```terraform
import {
  to = dokploy_gotify_notification.phone
  id = "INt_PYqh9apo8mmDIoixZ"
}
```

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

```shell
terraform import dokploy_gotify_notification.phone INt_PYqh9apo8mmDIoixZ
```