ntfy
| Schemes | ntfy://, ntfys:// |
| Cargo feature | service-ntfy |
| Service | https://ntfy.sh/ |
| Body formats | text (first is the default) |
| Attachments | yes |
| Title length | 200 characters |
| Body length | 7,600 characters |
| Body lines | unlimited |
| Request throttle | none |
| Vendor URLs accepted | yes |
URL formats
{schema}://{topic}
{schema}://{host}/{targets}
{schema}://{host}:{port}/{targets}
{schema}://{user}@{host}/{targets}
{schema}://{user}@{host}:{port}/{targets}
{schema}://{user}:{password}@{host}/{targets}
{schema}://{user}:{password}@{host}:{port}/{targets}
{schema}://{token}@{host}/{targets}
{schema}://{token}@{host}:{port}/{targets}
{schema} is one of ntfy://, ntfys://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{host} | Hostname | string | no | ||
{password} | Password | string | no | secret | |
{port} | Port | int, 1 to 65535 | no | ||
{targets} | Targets | list | yes | any of topic; separated by / | |
{token} | Token | string | no | secret | |
{topic} | Topic | string | no | must match ^[a-z0-9_-]{1,64}$ | |
{user} | Username | string | no |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
actions | Actions | string | ||
attach | Attach | string | ||
auth | Authentication Type | choice | basic (usually; depends on the URL) | one of basic, token |
avatar_url | Avatar URL | string | ||
click | Click | string | ||
delay | Delay | string | ||
email | string | |||
filename | Attach Filename | string | ||
image | Include Image | bool | yes | |
mode | Mode | choice | private (usually; depends on the URL) | one of cloud, private |
priority | Priority | choice | default | one of max, high, default, low, min |
to | Targets | list | sets {targets} | |
token | Token | string | sets {token} | |
xtags | Tags | string | also tags |
The common URL parameters (format, overflow, verify, redirect, cto, rto, retry, wait, store, tag, tz, user, password, port, optional, emojis) apply as well.
Examples
Accepted URLs (tokens are fake):
ntfys://my-topic
ntfy://localhost/topic
ntfy://user@localhost/topic/
ntfy://ntfy.sh/topic1/topic2/
ntfy://tk_abcd123456@localhost/topic1
https://ntfy.sh?to=topic
ntfys://user:pass@localhost?to=topic
https://ntfy.sh/topicA/topicB?priority=5
Rejected URLs:
ntfys://user:web/token@localhost/topic/?mode=invalid
ntfys://token@localhost/topic/?auth=invalid
ntfys://user:web@-_/topic1/topic2/?mode=private
Send one from the command line:
mercurio -t 'Backup' -b 'Finished in 42s' 'ntfys://my-topic'
Notes
ntfy (ntfy://, ntfys://, https://ntfy.sh/topic): publishes to ntfy topics.