Push Notifications API

Push Rules

Push rules control which events generate notifications.

Get All Push Rules

GET /_matrix/client/v3/pushrules

Returns global rules with default rules included dynamically:

{
  "global": {
    "override": [...],
    "room": [...],
    "sender": [...],
    "content": [...],
    "underride": [...]
  }
}

Default rules (m.push_rules and m.ignored_user_list) are injected into every /sync response's account data.

Get Push Rule

GET /_matrix/client/v3/pushrules/{scope}/{kind}/{ruleId}

Create Push Rule

PUT /_matrix/client/v3/pushrules/{scope}/{kind}/{ruleId}
{
  "actions": [
    "notify",
    { "set_tweak": "sound", "value": "default" },
    { "set_tweak": "highlight", "value": true }
  ],
  "conditions": [
    { "kind": "event_match", "key": "type", "pattern": "m.room.message" }
  ],
  "enabled": true
}

Update Push Rule Actions

PUT /_matrix/client/v3/pushrules/{scope}/{kind}/{ruleId}/actions

Delete Push Rule

DELETE /_matrix/client/v3/pushrules/{scope}/{kind}/{ruleId}

Pushers

Pushers define where notifications are sent.

Get Pushers

GET /_matrix/client/v3/pushers

Add Pusher

POST /_matrix/client/v3/pushers
{
  "pushkey": "device_push_key",
  "kind": "http",
  "app_id": "com.example.app",
  "app_display_name": "Example App",
  "device_display_name": "My Phone",
  "profile_tag": "tag1",
  "url": "https://example.com/push",
  "lang": "en"
}

Delete Pusher

DELETE /_matrix/client/v3/pushers/{pushkey}

Notification Actions

Push rules define actions that determine notification behavior:

ActionDescription
notifyGenerate a notification
dont_notifySuppress notification
coalesceCoalesce with other notifications
set_tweak: soundPlay a notification sound
set_tweak: highlightHighlight the notification

Push Rule Types

TypeScopeDescription
overrideglobalConditions-based rules
roomglobalRules per room
senderglobalRules per sender
contentglobalContent pattern matching
underrideglobalDefault fallback rules

Pusher Delivery

The PusherDeliveryWorker handles outbound push delivery with:

  • Exponential backoff retry (max 2 retries, 5-minute intervals)
  • HTTP POST to the configured push gateway URL
  • Event push summary tracking in event_push_summary table