Skip to content

Quick Start

import apprise
apobj = apprise.Apprise()

The add() method registers notification services to your instance.

# Add a single service
apobj.add('json://localhost')
# Add multiple services at once
apobj.add([
'mailto://user:pass@example.com',
'slack://tokenA/tokenB/tokenC'
])

The notify() method sends messages to all registered services.

apobj.notify(
title="Server Alert",
body="CPU usage is at 99%",
)

You can categorize your notifications using NotifyType. This often changes the icon or color of the notification (depending on the receiving service).

from apprise import NotifyType
apobj.notify(
title="Success",
body="Backup completed successfully.",
notify_type=NotifyType.SUCCESS
)
IconTypeDescription
infoNotifyType.INFODefault. General information.
successNotifyType.SUCCESSSuccessful operations.
warningNotifyType.WARNINGIssues that aren’t fatal.
failureNotifyType.FAILURECritical errors.

Tagging allows you to send notifications to specific subgroups of services.

1. Assign Tags

# Assign tags when adding services
apobj.add('slack://...', tag='devops')
apobj.add('mailto://...', tag='management')
apobj.add('discord://...', tag=['devops', 'management']) # Multiple tags

2. Filter by Tags

# Notify ONLY services tagged 'devops'
apobj.notify(title="Deploying", body="...", tag="devops")
# Notify services tagged 'devops' OR 'management'
apobj.notify(title="Update", body="...", tag=["devops", "management"])

Programmatic tag expressions follow:

notify(tag=...) expressionSelected services
"TagA"Has TagA
"TagA,TagB"Has TagA AND TagB
["TagA", "TagB"]Has TagA OR TagB
["TagA,TagC", "TagB"]Has (TagA AND TagC) OR TagB
# Notify services tagged 'product' AND 'create'
apobj.notify(title="Created", body="...", tag="product,create")
# Notify services tagged 'devops' OR 'finance'
apobj.notify(title="Report", body="...", tag=["devops", "finance"])
# Notify services matching ('comment' AND 'create') OR 'admin'
apobj.notify(title="Comment Created", body="...", tag=["comment,create", "admin"])

Tags in configuration files may carry a numeric priority prefix (for example 1:alerts or 5:alerts in YAML). There are two modes depending on whether you include a priority in the filter.

Without a priority prefix — escalation (default)

Services are grouped by their tag priority and dispatched in ascending order. If every service in the lowest-numbered group succeeds, Apprise returns True immediately without running higher-numbered groups. If any fail, Apprise escalates to the next group.

# All 'alerts' services dispatched in ascending priority order.
# Priority-1 entries run first; if they all succeed, priority-5 entries
# are never triggered.
apobj.notify(body="...", tag="alerts")

With a priority prefix — exclusive filter

Only services whose matching tag has exactly that priority are notified. No escalation occurs.

# Notify ONLY 'alerts' entries assigned priority 2
apobj.notify(body="...", tag="2:alerts")

A trailing :N on a tag value overrides each matched service’s configured retry count for this one call only:

# Notify all 'alerts' services, retrying each up to 3 times on failure
apobj.notify(body="...", tag="alerts:3")
# Notify only priority-2 'alerts' services with up to 3 retries
apobj.notify(body="...", tag="2:alerts:3")

The retry count does not permanently modify the service configuration.

You can use the AppriseConfig object to load URLs from external YAML or Text files instead of hardcoding them.

import apprise
# 1. Create the Config Object
config = apprise.AppriseConfig()
# 2. Add configuration sources
config.add('/path/to/my/config.yml')
config.add('https://myserver.com/my/apprise/config')
# 3. Create Apprise instance and ingest the config
apobj = apprise.Apprise()
apobj.add(config)
# 4. Notify as usual (URLs from the file are now loaded)
apobj.notify("Loaded from config!")
Questions or Feedback?

Documentation

Notice a typo or an error? Report it or contribute a fix .

Technical Issues

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

Made with love from Canada