# Schedule ntfy push notifications

Publish push notifications to an [ntfy](https://ntfy.sh) topic on a schedule. Every phone and desktop subscribed to the topic gets it, on ntfy.sh or your own server, with a title, priority, tags, and a link to open.

## Example: a daily reminder on your phone

```json
{
  "name": "Water the plants",
  "cron": { "expression": "0 19 * * SUN,WED", "time_zone": "Europe/Amsterdam" },
  "nodes": [
    { "id": "push", "ntfy_publish": {
        "topic": "home-k7f2q9",
        "title": "Plants",
        "message": "Time to water the plants 🌱",
        "tags": ["seedling"],
        "priority": 3 } }
  ]
}
```

## Example: NAS disk usage, every 6 hours, on your own server

Read a value from any API and push it to a protected topic on a self-hosted ntfy server:

```json
{
  "name": "Disk usage to phone",
  "cron": { "expression": "0 */6 * * *" },
  "nodes": [
    { "id": "disk", "request": { "method": "GET", "endpoint": "https://nas.example.com/api/disk", "credential_id": "YOUR_NAS_TOKEN_ID" } },
    { "id": "push", "ntfy_publish": {
        "server": "https://ntfy.example.com",
        "topic": "nas",
        "title": "NAS disk",
        "message": "{{ $.used_percent }}% used, {{ $.free_gb }} GB free",
        "click": "https://nas.example.com",
        "credential_id": "YOUR_NTFY_TOKEN_ID" } }
  ]
}
```

## Set up

Install the ntfy app and subscribe to a topic. Topics on ntfy.sh are public to anyone who knows the name, so use a hard-to-guess one, or protect it with an access token and save that as a `bearer_token` credential.

## Reference

### Publish an ntfy notification: `ntfy_publish`

**Sends** POST to the ntfy server (default `https://ntfy.sh`) with the topic and message as JSON. **Output** for the next step: The published message.

| Field | Type | Notes |
| --- | --- | --- |
| `server` | string | Your ntfy server. Omit for `https://ntfy.sh`. |
| `topic` | string, required | Letters, digits, `_` and `-`, up to 64 characters. Anyone who knows a public topic can read it, so pick a hard-to-guess name. |
| `message` | string, required | Up to 4,096 characters. Placeholders allowed. |
| `title` | string | Up to 256 characters. Placeholders allowed. |
| `priority` | integer | 1 (min) to 5 (urgent). Omit for the default, 3. |
| `tags` | string[] | Up to 10 tags. Tags that match an emoji short code, like `warning`, show as that emoji. |
| `click` | string | A URL opened when the notification is tapped. Placeholders allowed. |
| `credential_id` | string | The id of a `bearer_token` credential holding an ntfy access token, for protected topics. |

## More ideas

- A bin-day reminder every Tuesday evening: `0 20 * * TUE`.
- A one-time reminder to renew a domain, with `run_at`.
- Your [Stripe balance](/integrations/stripe) every morning.
