Skip to content

Ntfy Notifications

Overview

  • Source: https://ntfy.sh/
  • Image Support: No
  • Attachment Support: Yes
  • Message Character Limits:
    • Body: 32768

Ntfy is a easy to use messaging service.

Ntfy can send notifications through the following modes:

Valid syntax is as follows:

  • ntfy://{topic}
  • ntfy://{host}/{topic}
  • ntfy://{host}:{port}/{topics}
  • ntfy://{user}@{host}/{topics}
  • ntfy://{user}@{host}:{port}/{topics}
  • ntfy://{user}:{password}@{host}/{topics}
  • ntfy://{user}:{password}@{host}:{port}/{topics}
  • ntfy://{token}@{hostname}/{topics}

The secure versions:

  • ntfys://{topic}
  • ntfys://{host}/{topic}
  • ntfys://{host}:{port}/{topics}
  • ntfys://{user}@{host}/{topics}
  • ntfys://{user}@{host}:{port}/{topics}
  • ntfys://{user}:{password}@{host}/{topics}
  • ntfys://{user}:{password}@{host}:{port}/{topics}
  • ntfys://{token}@{hostname}/{topics}

You can specify more then 1 topic such as:

  • ntfy://{user}:{password}/{hostname}/{topic1}/{topic2}
VariableRequiredDescription
user*NoThe user account to perform the authentication with
password*NoThe password to perform the authentication with
hostname*NoThe ntfy server you’re sending your notification to.
portNoThe port the ntfy server is listening on. By default the port is 80 for ntfy:// and 443 for all ntfys:// references.
topicYesAll notifications to a ntfy server MUST have at least one topic defined.
tokenNoThis is detected, but can otherwise be explicitly specified as a parameter.
modeNoThe authentication mode is automatically detected based what it parses from the URL provided. You only need to set this if you feel it is being detected incorrectly. The possible modes are private and cloud and are explained above.
authNoCan be set to either basic (default) or token . basic is for User/Password authentication with the Ntfy server while token assumes that the provided credentials was a Authorization Token and authenticates in a different fashion.
emailNoAn email to associate the ntfy post with.
tagsNoThe ntfy tags to associate with the ntfy post. Use a comma and/or space to specify more then one.
attachNoSpecify a web URL pointing at a remote attachment you would like the post to reference.
filenameNoThis is only used if the attach was also provided. The ntfy server is smart enough to determine what the filename is automatically from this; however if you wish to provide a custom-override to this value, this is where you do it from.
clickNoProvide a hyperlink that you want users who receive your notification to advance to if they click on it.
priorityNoProvide a priority such as max, high, default, low, or min. By default default is used if one isn’t otherwise provided.
actionsNontfy action buttons variable
delayNoIdentify a delay for the message reception
imageNoThis defaults to ‘Yes’ and hauls in the image associated with the notification
avatar_urlNoOptionally over-ride the Apprise Icon notifications and explicitly identify your own

Send a ntfy notification to our server

Terminal window
# Assuming our {hostname} is localhost
# Assuming our {topic} is great-place
apprise -vv -t "Test Message Title" -b "Test Message Body" \
ntfy://localhost/great-place

We can also send a notification to the ntfy.sh server:

Terminal window
# Assuming our {topic} is great-place
apprise -vv -t "Test Message Title" -b "Test Message Body" \
ntfy://great-place

Ntfy also supports Markdown; if you want to leverage this, simply add ?format=markdown to your Apprise URL; eg:

Terminal window
# Assuming our {hostname} is localhost
# Assuming our {topic} is great-place
# Assuming we want to leverage the markdown support
apprise -vv -t "Test Message Title" -b "# Markdown Support" \
"ntfy://localhost/great-place?format=markdown"

If your Ntfy server is behind an HTTPS (Secure) hosted setup, then you simply use ntfys://:

VariableDescription
overflowThis parameter can be set to either split, truncate, or upstream. This determines how Apprise delivers the message you pass it. By default this is set to upstream
👉 upstream: Do nothing at all; pass the message exactly as you received it to the service.
👉 truncate: Ensure that the message will fit within the service’s documented upstream message limit. If more information was passed then the defined limit, the overhead information is truncated.
👉 split: similar to truncate except if the message doesn’t fit within the service’s documented upstream message limit, it is split into smaller chunks and they are all delivered sequentially there-after.
formatThis parameter can be set to either text, html, or markdown. Some services support the ability to post content by several different means. The default of this varies (it can be one of the 3 mentioned at any time depending on which service you choose). You can optionally force this setting to stray from the defaults if you wish. If the service doesn’t support different types of transmission formats, then this field is ignored.
verifyExternal requests made to secure locations (such as through the use of https) will have certificates associated with them. By default, Apprise will verify that these certificates are valid; if they are not then no notification will be sent to the source. In some occasions, a user might not have a certificate authority to verify the key against or they trust the source; in this case you will want to set this flag to no. By default it is set to yes.
ctoThis stands for Socket Connect Timeout. This is the number of seconds Requests will wait for your client to establish a connection to a remote machine (corresponding to the connect()) call on the socket. The default value is 4.0 seconds.
rtoThis stands for Socket Read Timeout. This is the number of seconds the client will wait for the server to send a response. The default value is 4.0 seconds.
emojisEnable Emoji support (such as providing :+1: would translate to 👍). By default this is set to no.
Note: Depending on server side settings, the administrator has the power to disable emoji support at a global level; but default this is not the case.
tzIdentify the IANA Time Zone Database you wish to operate as. By default this is detected based on the configuration the server hosting Apprise is running on. You can set this to things like America/Toronto, or any other properly formated Timezone describing your area.
Terminal window
# Assuming our SECURE {hostname} is localhost
# Assuming our {topic} is great-topic
apprise -vv -t "Test Secure Message Title" -b "Test Message Body" \
ntfys://localhost/great-topic

Sends a ntfy message leveraging the action=

Terminal window
apprise -vv -t "Title" -b "Message content" \
ntfy://ntfy.selfhostedexample.com/mytopic?actions=view%2CGoogle%2Chttps://www.google.com%3Bview%2CBing%2Chttps://www.bing.com