# Notifications

Hear about a low balance or a credited top-up on Discord, Slack or ntfy.sh. No email involved.

Unaligned has no email address for you, so it can’t write to you. Instead, you give it a webhook: an address of a chat service where it posts a short message. Set it in [Dashboard → Account](https://unaligned.pw/dashboard/account), under Notifications.

## What you get

- **Low balance.** One message when your balance goes below the amount you chose. It isn’t repeated until the balance has gone back above it.
- **Top-up credited.** One message for each top-up, with the amount credited and the new balance.

```
Unaligned: low balance. $4.12 left (alert below $5.00).
Unaligned: top-up credited, +$20.00. Balance: $24.12.
```

Messages come in the language the site was in when you saved the webhook. The low-balance alert follows the account’s balance, not the balance of a key that has its own.

## Getting a webhook URL

### Discord

1. Open the channel’s settings, then **Integrations → Webhooks**.
2. Create a webhook and copy its URL. It starts with `https://discord.com/api/webhooks/`.

### Slack

1. Create an app at api.slack.com/apps and turn on **Incoming Webhooks**.
2. Add a webhook to a channel and copy its URL. It starts with `https://hooks.slack.com/services/`.

### ntfy.sh

1. Pick a long, random topic name: anyone who knows it can read what is posted there.
2. Subscribe to that topic in the ntfy app, on your phone or computer. No account is needed.
3. Your URL is `https://ntfy.sh/` followed by the topic.

> **Note:** Only these three services are accepted. Unaligned never calls an address of your own: a server you run would learn where our API calls from.

## Checking it works

After saving, **Send a test** posts a message right away. If the service refuses it, the page says so: check the URL.

## When a webhook stops working

- A message that fails is tried again for about an hour, then dropped.
- If the service says the webhook no longer exists, or it keeps failing, we stop sending and the page shows it as stopped. Saving it again switches it back on.

## Privacy

- A message holds amounts only: never your account ID, your keys or a payment reference.
- The URL is the only thing we keep. It is stored encrypted, and deleted when you remove the webhook or delete your account.
- The service you choose sees the messages, and knows the channel belongs to you. If that matters, use ntfy.sh with a random topic.
- For a program, there is nothing to set up: [the balance endpoint](https://unaligned.pw/docs/balance.md) tells it what is left.
