Skip to content

Signal API Notifications

Overview

You need a Signal account and the Signal app for iOS or Android.

You must also configure the Signal REST API service.

A simple setup might be:

Terminal window
# Create a directory for our configuration to get stored into
mkdir -p $HOME/.signal-api
# Launch a Signal API instance that listens on port 9922
docker run -d --name signal-api --restart=always -p 9922:8080 \
-v $HOME/.signal-api:/home/.local/share/signal-cli \
-e 'MODE=native' -e SIGNAL_CLI_UID=$(id -u) -e SIGNAL_CLI_GID=$(id -g) \
bbernhard/signal-cli-rest-api

If all goes well, you should be able to point your browser to: http://localhost:9922/v1/qrcodelink?device_name=signal-api and from your phone app, follow the instructions to add a Linked Device.

The {FromPhoneNo} must be the number associated with your account.

Valid syntax is as follows:

  • signal://{user}:{password}@{hostname}/{from_phone}
  • signal://{user}:{password}@{hostname}:{port}/{from_phone}
  • signal://{user}:{password}@{hostname}/{from_phone}/{target}
  • signal://{user}:{password}@{hostname}:{port}/{from_phone}/{target}

You can post in multiple chats by simply chaining them at the end of the URL.

  • signal://{user}:{password}@{hostname}:{port}/{from_phone}/{target1}/{target2}/{target3}
  • signals://{user}:{password}@{hostname}:{port}/{from_phone}/{target1}/{target2}/{target3}
VariableRequiredDescription
hostnameYesThe Web Server’s hostname
portNoThe port our Web server is listening on. By default the port is 80 for signal:// and 443 for all signals:// references.
userNoIf your system is set up to use HTTP-AUTH, you can provide username for authentication to it.
passwordNoIf your system is set up to use HTTP-AUTH, you can provide password for authentication to it.
fromYesThis must be a From Phone Number you’ve added to the API service.
to*NoA phone number or group id you wish to send your notification to. If one isn’t specified, then the from is used instead.
batchNoSend multiple specified notifications in a single batch (1 upstream post to the end server). By default this is set to no.
statusNoOptionally include a small ASCII string representing the notification status being sent (inline with it). By default this is set to yes.
VariableDescription
overflowControls messages that exceed a service’s documented limit. The default is upstream.
👉 upstream: Send one message without splitting or truncating it for that limit.
👉 truncate: Keep the portion that fits and discard the rest.
👉 split: Prefer a readable break, fall back to a hard boundary, and send every part in order.
Splitting undeclared or structured content is best effort. Use upstream when the body must remain one intact document.
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.
redirectBy default, Apprise will follow HTTP redirects (3xx responses) issued by the remote server, matching the behaviour of the underlying requests library. If you want to prevent custom headers and credentials from being forwarded to destinations that differ from the original URL, set this 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.
retryThe number of additional delivery attempts to make after the first failure before giving up. Accepts an integer in the range 0 to 10. The default is 0 (no retries — a single attempt is made). When combined with wait, Apprise pauses the specified number of seconds between each attempt.
waitThe number of seconds to pause between retry attempts. Accepts a decimal value in the range 0.0 to 20.0; integer values are promoted to float automatically. The default is 0.5. This value is only meaningful when retry is greater than zero — a service with retry=0 makes exactly one attempt regardless of the wait value.
optionalWhen set to yes, a delivery failure for this service is silently absorbed. The overall notify() call still evaluates as true even if this endpoint was unreachable, provided that every required (non-optional) service in the same batch succeeded. Setting this flag does not skip delivery or bypass retry logic — all configured retry attempts are still made before the failure is absorbed. By default this is set to no, meaning every failure is propagated to the caller.

Groups can be created in the app, or via the Signal Rest API Service. To get a list of available groups and their ids run:

Terminal window
curl -X GET -H "Content-Type: application/json" localhost:9922/v1/groups/+15555551234 | jq

Example output is as follows:

[
{
"name": "Test Group",
"id": "group.abcdefghijklmnop=",
"internal_id": "aabbccdd/eeffgghh=",
"members": ["+1555555551234", "+16666661234"],
"blocked": false,
"pending_invites": [],
"pending_requests": [],
"invite_link": "",
"admins": ["+1555555551234"]
}
]

The value you need is the group’s id (here group.abcdefghijklmnop=). Use it as a target to send a notification to that group.

Add ?format=markdown to send styled messages. Signal supports bold, italic, strikethrough, monospace, and ||spoiler||. Signal has no headings, so titles appear in bold.

Terminal window
apprise -vv -i markdown -t "Build Report" -b "**3** tests _failed_" \
"signal://localhost:9922/15555551234?format=markdown"

Send a Signal Notification (via Signal API):

Terminal window
# Assuming our {Hostname} is localhost (hosting the bbernhard/signal-cli-rest-api)
# Assuming our {FromPhoneNo} is +1-900-555-9999
# Assuming our {PhoneNo} - is in the US somewhere making our country code +1
# - identifies as 800-555-1223
apprise -vv -t "Test Message Title" -b "Test Message Body" \
"signal://localhost/19005559999/18005551223"
# the following would also have worked (spaces, brackets,
# dashes are accepted in a phone no field):
apprise -vv -t "Test Message Title" -b "Test Message Body" \
"signal://localhost/1-(900) 555-9999/1-(800) 555-1223"

Based on my personal experiences, I was able to send a notification to myself by simply doing the following:

Terminal window
# Assuming our {Hostname} is localhost (hosting the bbernhard/signal-cli-rest-api)
# Assuming our {Port} is 9922
# Assuming our {FromPhoneNo} is +1 555 555 1234
apprise -vv -t "Test Message Title" -b "Test Message Body" \
"signal://localhost:9922/15555551234"

If you know the Group ID you want to notify, you can identify it as well on the command line:

Terminal window
# Assuming our {Hostname} is localhost (hosting the bbernhard/signal-cli-rest-api)
# Assuming our {Port} is 9922
# Assuming our {FromPhoneNo} is +1 555 555 1234
# Assuming our {Group} is group.abcdefghijklmnop=
apprise -vv -t "Group Message:" -b "Hello group members" \
"signal://localhost:9922/+1555555551234/group.abcdefghijklmnop="

I could even send an attachment without a problem:

Terminal window
apprise -vv -t -b "test" \
signal://localhost:9922/15555551234 --attach apprise-test.gif

Which produced: image

Signal API sends my SMS message, but Apprise reports a failure

Section titled “Signal API sends my SMS message, but Apprise reports a failure”

The message was sent, but signal-cli-rest-api took longer than Apprise’s default 4-second timeout to confirm it. When using the Apprise API, this may be logged as A Connection error occured sending ..., and a priority chain may continue to the next service. It can be more noticeable on the first message after a Gunicorn worker restarts.

Give the server more time to respond by adding ?rto=8 to the Apprise URL:

signal://localhost:9922/15555551234?rto=8

The value is the number of seconds Apprise will wait. If the URL already has options after a ?, add &rto=8 instead. Use a larger value if needed.

Native mode may also improve response time on some systems. The Docker example above already enables it with:

Terminal window
-e 'MODE=native'

If the problem continues, try moving the Signal API container to a faster or less busy machine.

Questions or Feedback?

Documentation

Notice a typo or an error?

Technical Issues

Having trouble with the code? Open an issue on GitHub:

Made with love from Canada