Channel: send messages

No code: ntfy

Packlets understands ntfy calls: the server is the Packlets URL, the topic is your key.

Open as Markdown

ntfy is a popular way to send push notifications from scripts and server tools. Packlets understands the same calls: many tools with an ntfy option can send straight to Packlets. The server is the Packlets address, the topic is the key of your packlet.

You don't write any code for this. You don't need an ntfy server or the ntfy app.

Connect in the app

When connecting, tap Integrations and choose ntfy. Name and animal are already filled in. Packlets then shows Server and Topic to copy; you enter them in your tool's ntfy setting.

Server and topic

Field in the toolValue
Server (server URL)https://api.packlets.app
Topic<PACKLETS_KEY>

If the tool asks for a single address, it's both together: https://api.packlets.app/<PACKLETS_KEY>.

The topic is your key here. Treat it like a password. If you create a new key in the app, the old topic stops working immediately.

If the tool has a field of its own for an access token or a password, you can enter the key there instead and pick any topic, for example backup. Packlets then takes the key from Authorization: Bearer … or from the password of the Basic login.

Where this works

AreaTools
Smart homeHome Assistant, Node-RED, ioBroker
MonitoringUptime Kuma, Healthchecks.io, Gatus, Changedetection.io, Beszel
ServersWatchtower, Proxmox, Unraid, Diun, Backrest, borgmatic
MediaSonarr, Radarr, Jellyseerr
Anything with AppriseApprise addresses ntfys://… (without a path of its own in the server)
Your own scriptsAnything that already sends to ntfy: swap the server, done

Quick test

Shell
curl -d "Backup done 🎉" https://api.packlets.app/<PACKLETS_KEY>

With title, priority and link:

Shell
curl https://api.packlets.app/<PACKLETS_KEY> \
  -H "Title: NAS" \
  -H "Priority: high" \
  -H "Tags: warning" \
  -H "Click: https://nas.example.com" \
  -d "Disk 95% full"

Packlets answers like ntfy with JSON (id, time, event, message). In the packlet's activity log, the call shows up with "ntfy:" in front.

The three ways

WayExample
Text as body, details in headersPOST https://api.packlets.app/<PACKLETS_KEY> (also PUT)
Everything in the addressGET https://api.packlets.app/<PACKLETS_KEY>/publish?message=Hello&title=Test (also /send, /trigger)
JSON to the serverPOST https://api.packlets.app/ with {"topic":"<PACKLETS_KEY>","message":"Hello"}

As with ntfy, with the first way the body is always the message, even if it looks like JSON.

What Packlets picks up

Headers work in all of ntfy's spellings (Title, X-Title, t); the same names work as parameters in the address.

ntfyIn Packlets
Body or MessageMessage text. Empty: "Triggered", or "Ausgelöst" with the header Accept-Language: de.
TitleTitle
Priority 1–2 (min, low)Priority silent
Priority 3 (default)normal
Priority 4–5 (high, urgent, max)high
Tags like warning, tada, white_check_markEmoji before the title (otherwise before the text). Tags without an emoji are dropped.
ClickLink of the message
Attach with an image link (.png, .jpg, …)Image of the message; other links become the link
Actions with viewUp to 3 buttons that open the link
Markdown: yesFormatting as in Packlets, links [text](url) become the link
Umlauts in headers (RFC 2047 or UTF-8)handled correctly

Responses

StatusResponseMeaning
200JSON with id and event: "message"Saved, the push is on its way.
400JSON with code and errorNot a valid message, no JSON on the JSON way, or a file as an attachment.
401JSON with invalid_keyKey wrong or packlet removed.
404JSON with code 40401The topic is not a key, and there is none in the token or password either.
429JSON with rate_limitedToo many calls. The same limit applies as for POST /v1/push.

Limits

  • Packlets only accepts messages. Subscribing (/json, /sse, /ws) isn't available; messages land in the Packlets app.
  • Uploading files as attachments doesn't work. Images work as a link with Attach.
  • Packlets leaves out http and broadcast actions, Delay, Email, Call and Icon.