diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2019-06-05 13:38:01 +0100 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2019-06-05 13:38:01 +0100 |
commit | 40596aec0ec6da1e8918255b75eb5329292901ab (patch) | |
tree | a918b5ebfc4b48f8996b247df7ca75cd7cbb5d0f /docs/admin_api/server_notices.md | |
parent | Lint (diff) | |
parent | Clean up debug logging (#5347) (diff) | |
download | synapse-40596aec0ec6da1e8918255b75eb5329292901ab.tar.xz |
Merge branch 'develop' into m-heroes-empty-room-name
Diffstat (limited to 'docs/admin_api/server_notices.md')
-rw-r--r-- | docs/admin_api/server_notices.md | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/docs/admin_api/server_notices.md b/docs/admin_api/server_notices.md new file mode 100644 index 0000000000..858b052b84 --- /dev/null +++ b/docs/admin_api/server_notices.md @@ -0,0 +1,48 @@ +# Server Notices + +The API to send notices is as follows: + +``` +POST /_synapse/admin/v1/send_server_notice +``` + +or: + +``` +PUT /_synapse/admin/v1/send_server_notice/{txnId} +``` + +You will need to authenticate with an access token for an admin user. + +When using the `PUT` form, retransmissions with the same transaction ID will be +ignored in the same way as with `PUT +/_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}`. + +The request body should look something like the following: + +```json +{ + "user_id": "@target_user:server_name", + "content": { + "msgtype": "m.text", + "body": "This is my message" + } +} +``` + +You can optionally include the following additional parameters: + +* `type`: the type of event. Defaults to `m.room.message`. +* `state_key`: Setting this will result in a state event being sent. + + +Once the notice has been sent, the API will return the following response: + +```json +{ + "event_id": "<event_id>" +} +``` + +Note that server notices must be enabled in `homeserver.yaml` before this API +can be used. See [server_notices.md](../server_notices.md) for more information. |