skirl

Sending messages

The quickest way: send the text to the topic's address with a token. Every example below uses https://notify.example.com for your server, backups for the topic and tk_replace_with_your_token for a token: put in your own. A topic's Send to this topic tab shows them filled in, and New token there makes a token that may send to that topic only.

curl -H "Authorization: Bearer tk_replace_with_your_token" -d "Backup finished" https://notify.example.com/backups

Skirl answers with the message it stored, as JSON:

{"id":"MGIgkQmdRwKX","time":1795827140,"expires":1798419140,"event":"message","topic":"backups","message":"Backup finished"}

Anything that can send to ntfy can send to Skirl the same way, by giving it your server's address instead of ntfy's: ntfy's apps and tools.

From the app#

A topic's Messages tab has a Send a message form beside the list, for people who may send there. The New topic form on the Topics page is the same, with a Topic name added, for a topic that does not exist yet (Creating a topic).

  • Title is optional. Text may be left empty when a file is attached.
  • Attach a file, or paste or drop a file onto the form. Remove takes it off again. Pictures show in the message (Attachments).
  • Send later, then Send at: a date and time in this device's time zone, at least 10 seconds ahead (Scheduled delivery).
  • Priority: from 1 · Min to 5 · Urgent; 3 · Default unless you change it.

Press Send (Schedule with Send later): the form says "Sent." or "Scheduled for" and the time. Use it to try a topic before anything else sends to it. The form sends a title, text, a priority and a file; tags, Markdown, buttons and the rest come from scripts and tools, with the headers below.

The text is at most 4096 bytes here ("The message is too long"): send a longer one as a file.

Which token to use#

Send the token in an Authorization: Bearer header, as in every example here. A tool that asks for a user name and password instead takes the token as the password, with the user name left empty.

Give each script or tool its own token that may only send to its topic: if it leaks, someone can send to that one topic, nothing more. Tokens, and what each can do: Tokens and access. A topic set to Anyone can send or Public takes messages with no token at all (Who can see a topic).

From a script#

A small function for shell scripts and cron jobs, with the token in a variable rather than repeated:

SKIRL_TOKEN=tk_replace_with_your_token
notify() { curl -fsS -H "Authorization: Bearer $SKIRL_TOKEN" -H "Title: $1" -d "$2" https://notify.example.com/backups >/dev/null; }
notify "Nightly backup finished" "14 VMs, no errors."

-f makes curl exit with an error when Skirl refuses the message, so the script notices; -sS keeps it quiet unless something goes wrong. More for scripts: Shell scripts, Python, and the other senders in Connecting your systems.

Title, priority and tags#

Headers set the rest. Each has short forms, as in ntfy.

curl -H "Authorization: Bearer tk_replace_with_your_token" \
  -H "Title: Disk almost full" \
  -H "Priority: 4" \
  -H "Tags: warning,pve-01" \
  -d "Volume 2 is at 93%." \
  https://notify.example.com/backups
  • Title: up to 1024 bytes. Without one, the inbox shows the text alone and a notification shows the topic's name as its title.
  • Priority: 1 (lowest) to 5 (urgent), or min, low, default, high, max (also urgent). 3 is the default. 4 and 5 show under Urgent in the inbox (Urgent), and people can choose to be notified only from a priority up (Notify me from priority).
  • Tags: words, separated by commas, shown under the message; all of them together at most 512 bytes. A tag that is an emoji name, such as warning, shows as that emoji in front of the title: Emoji tags.

The text is the body, up to 4096 bytes. A longer body, or one that is not text, is stored as a file instead: Attachments.

Sending JSON#

A tool that sends JSON can post it to the server's address itself, with the topic in the body:

curl -H "Authorization: Bearer tk_replace_with_your_token" \
  -d '{"topic":"backups","title":"Disk almost full","message":"Volume 2 is at 93%.","priority":4,"tags":["warning"]}' \
  https://notify.example.com/

The fields are topic (needed), message, title, priority, tags, markdown, click, actions, attach, filename, icon, delay, timezone and sequence_id, each meaning what the header of that name means below.

A tool that can only open an address can send with the message in it: every header can be a lower-case parameter after /publish (or /send, /trigger).

curl -H "Authorization: Bearer tk_replace_with_your_token" "https://notify.example.com/backups/publish?title=Door&message=Front+door+opened&priority=high"

Every header#

Header names may be written in any case, and each also works with X- in front (X-Title), as in ntfy.

Header Short forms What it does
Title t The title
Priority p, prio 1 to 5, or min, low, default, high, max, urgent
Tags Tag, ta Words separated by commas; emoji names show as emoji (Emoji tags)
Message m The text, when the body is a file or empty; \n in it starts a new line
Markdown md yes formats the text (Markdown)
Click An address the message links to (Links and Click)
Actions Action Up to three buttons (Action buttons)
Filename file, f The body is a file of this name (Attachments)
Attach a A link to a file somewhere else (Attachments)
Icon A picture for the message (Icons)
In, At, Delay Send it later (Scheduled delivery)
Timezone The time zone a later time such as "tomorrow, 9am" is read in
Sequence-ID SID Replace or remove it later by this name (Replacing a message)
Template Tpl Make the message from the JSON the tool sends (Templates)
Cache no: not stored. Only tools listening at that moment get it; it never shows in Skirl's app or as a notification

Email and Call (ntfy's e-mail and phone calls) are refused with 400: Skirl sends neither.

When Skirl says no#

Skirl answers with an HTTP status and a short reason in JSON. The common ones:

  • 401: the token is wrong or no longer valid.
  • 403: the token, or no token at all, may not send to this topic; or the topic does not exist and the token may not make topics.
  • 400: something in the request is not right, such as a priority that is not 1 to 5 or a reserved topic name; the reason says which.
  • 413: the message or the file is too large, or the server has no room for the file now.
  • 429: too much too fast. The Retry-After header says how many seconds to wait.

Every message Skirl can answer with, and what to do about it: Error messages.

This page on GitHub