Skip to content

Sending messages

The task: send a message to your channel with a single HTTP request — from a script, server, CI or CMS — and get it as a notification on your device.

  1. A channel. Open the Channels section in the side menu of the dashboard at app.notifly.ru and click Create channel (on first login the first-run wizard does this for you). A channel’s messages are visible to its owner and to the people the channel is shared with.
  2. The channel’s app token (prefix A) — shown in the channel row; click it to reveal and copy. For individual scripts and CI it is better to issue a separate machine key for the channel — it can be revoked without touching the others.
  3. A receiver — the Android app or an open dashboard tab with notifications allowed (see First login). Without one the message lands in the feed, but there is no notification.

The minimal working request is curl with the app token in the X-Notifly-Key header and a JSON body:

Окно терминала
curl -X POST "https://api.notifly.ru/message" \
-H "X-Notifly-Key: <apptoken>" \
-H "Content-Type: application/json" \
-d '{"title": "my title", "message": "my message", "priority": 5}'

On success the server responds with 200 and returns the created message:

{
"id": 25,
"appid": 5,
"message": "my message",
"title": "my title",
"priority": 5,
"date": "2026-09-27T10:00:00Z"
}
  • A 200 response with an id — the message was accepted and stored.
  • The message appeared in the channel feed in the dashboard.
  • The receiving device showed a notification. How prominent it is depends on the priority (see parameters).

Got 200 but no notification? See Notifications not arriving.

CodeWhen
200The message was accepted
400The message field is missing or the body could not be parsed
401The token is missing, invalid, revoked or expired
403The token has no write access (for example, view delegated access) or the channel is a system channel
429The daily event quota is exhausted (see Quotas and plans) or a rate limit was hit

Only the message parameter is required. Other fields (title, priority, extras) are optional. If priority is not set, the channel’s default priority (defaultPriority) is used. Priority is a number from 0 to 10: it determines how prominent the notification is on the phone, the minimum-priority filter of escalation and whether the message breaks through quiet hours.

The message API accepts an extras property that conveys additional information with the message and describes how clients should behave regarding this message. See message extras for more information.

Not just one-way messages: besides regular push notifications you can send interactive questions with answer options and receive a reply back. See interactive questions.

You can use curl, HTTPie or any other HTTP client. The request body is JSON (Content-Type: application/json). The app token is passed in the X-Notifly-Key header, in an Authorization: Bearer <apptoken> header or as the token parameter in the URL.

Окно терминала
$ http POST https://api.notifly.ru/message X-Notifly-Key:"<apptoken>" title="my title" message="my message" priority:=5

In Microsoft PowerShell use the built-in cmdlets Invoke-RestMethod or Invoke-WebRequest, passing the body as JSON:

Окно терминала
PS> $body = @{title="my title"; message="my message"; priority=5} | ConvertTo-Json
PS> Invoke-RestMethod -Uri "https://api.notifly.ru/message" -Method POST -Headers @{"X-Notifly-Key"="<apptoken>"} -ContentType "application/json; charset=utf-8" -Body $body # the result is automatically parsed into a PowerShell object
PS> Invoke-WebRequest -Uri "https://api.notifly.ru/message" -Method POST -Headers @{"X-Notifly-Key"="<apptoken>"} -ContentType "application/json; charset=utf-8" -Body $body # the result as a raw response

Tip: the token can also be passed in the URL (?token=<apptoken>) — handy where you cannot set a header. Keep in mind that a URL with a token ends up in proxy logs and shell history, so a header is safer in scripts.

You can also use the Notifly CLI to send messages. The CLI saves the URL and token in the configuration file.

Окно терминала
$ notifly push -t "my title" -p 10 "my message"
$ echo my message | notifly push

How to install the Notifly CLI. Here are many more examples of sending messages in various languages.

If you need to create channels from code, use an API token (prefix M) with write access. The application path is kept for compatibility with the Gotify protocol — it is the same channel:

Окно терминала
curl -X POST https://api.notifly.ru/application \
-H "X-Notifly-Key: <api-token>" \
-H "Content-Type: application/json" \
-d '{"name": "test", "description": "tutorial"}'

The new channel’s app token is returned in the response. See the API documentation.

Method and pathPurposeAuthentication
POST /messageSend a message to a channelApp token (X-Notifly-Key, Authorization: Bearer or ?token=)
POST /applicationCreate a channelAPI token
GET /applicationList channelsAPI token

POST /message request fields: message (required), title, priority (if not set — the channel’s defaultPriority), extras (see message extras).