Push notifications

Add or change a push rule.

This endpoint allows the creation and modification of user defined push rules.

If a rule with the same rule_id already exists among rules of the same kind, it is updated with the new parameters, otherwise a new rule is created.

If both after and before are provided, the new or updated rule must be the next most important rule with respect to the rule identified by before.

If neither after nor before are provided and the rule is created, it should be added as the most important user defined rule among rules of the same kind.

When creating push rules, they MUST be enabled by default.

put/_matrix/client/v3/pushrules/global/{kind}/{ruleId}

Request

Path parameters

kind'override' | 'underride' | 'sender' | 'room' | 'content' required

The kind of rule

ruleIdstring required

The identifier for the rule. If the string starts with a dot ("."), the request MUST be rejected as this is reserved for server-default rules. Slashes ("/") and backslashes ("\") are also not allowed.

Query parameters

beforestring

Use 'before' with a rule_id as its value to make the new rule the next-most important rule with respect to the given user defined rule. It is not possible to add a rule relative to a predefined server rule.

afterstring

This makes the new rule the next-less important rule relative to the given user defined rule. It is not possible to add a rule relative to a predefined server rule.

Request body

patternstring

Only applicable to content rules. The glob-style pattern to match against.

Example request

{
  "actions": [
    "notify"
  ],
  "pattern": "cake*lie"
}

Response

The push rule was created/updated.

object required

Changes

No recorded changes to this operation across all 1 revision of this API.