Notify a push gateway about an event.
POST {{baseUrl}}/notify
This endpoint is invoked by HTTP pushers to notify a push gateway about an event or update the number of unread notifications a user has. In the former case it will contain selected information about the event. In either case it may contain numeric counts of the number of unread events of different types the user has. The counts may be sent along with a notification about an event or by themselves.
Notifications about a particular event will normally cause the user to be
alerted in some way. It is therefore necessary to perform duplicate
suppression for such notifications using the event_id
field to avoid
retries of this HTTP API causing duplicate alerts. The operation of
updating counts of unread notifications should be idempotent and
therefore do not require duplicate suppression.
Notifications are sent to the URL configured when the pusher is created. This means that the HTTP path may be different depending on the push gateway.
Request Body
{"notification"=>{"event_id"=>"$3957tyerfgewrf384", "room_id"=>"!slw48wfj34rtnrf:example.com", "type"=>"m.room.message", "sender"=>"@exampleuser:matrix.org", "sender_display_name"=>"Major Tom", "room_name"=>"Mission Control", "room_alias"=>"#exampleroom:matrix.org", "prio"=>"high", "content"=>{"msgtype"=>"m.text", "body"=>"I'm floating in a most peculiar way."}, "counts"=>{"unread"=>2, "missed_calls"=>1}, "devices"=>[{"app_id"=>"org.matrix.matrixConsole.ios", "pushkey"=>"V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/", "pushkey_ts"=>12345678, "tweaks"=>{"sound"=>"bing"}}]}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"rejected":["V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/"]}