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.
Request
- Base URLhttps://matrix.org
- Auth
- API key in query parameter access_token
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
The kind of rule
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
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.
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
Example request
{
"actions": [
"notify"
],
"pattern": "cake*lie"
}Response
The push rule was created/updated.
Changes
No recorded changes to this operation across all 1 revision of this API.