diff --git a/develop/404.html b/develop/404.html index a9384a96af..ba3ed4739a 100644 --- a/develop/404.html +++ b/develop/404.html @@ -38,10 +38,10 @@ const path_to_root = ""; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "searchindex-12b75b54.js"; - +
diff --git a/develop/CAPTCHA_SETUP.html b/develop/CAPTCHA_SETUP.html index c38e91a397..c60b459917 100644 --- a/develop/CAPTCHA_SETUP.html +++ b/develop/CAPTCHA_SETUP.html @@ -37,10 +37,10 @@ const path_to_root = ""; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "searchindex-12b75b54.js"; - +
diff --git a/develop/admin_api/account_validity.html b/develop/admin_api/account_validity.html index 6214418a0b..4d1b39cb6e 100644 --- a/develop/admin_api/account_validity.html +++ b/develop/admin_api/account_validity.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
diff --git a/develop/admin_api/client_server_api_extensions.html b/develop/admin_api/client_server_api_extensions.html index ecba5be82b..21e8273dda 100644 --- a/develop/admin_api/client_server_api_extensions.html +++ b/develop/admin_api/client_server_api_extensions.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
diff --git a/develop/admin_api/event_reports.html b/develop/admin_api/event_reports.html index 8aab08bf01..447f49fba0 100644 --- a/develop/admin_api/event_reports.html +++ b/develop/admin_api/event_reports.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
diff --git a/develop/admin_api/experimental_features.html b/develop/admin_api/experimental_features.html index 466201bdff..aba9fd08bf 100644 --- a/develop/admin_api/experimental_features.html +++ b/develop/admin_api/experimental_features.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
diff --git a/develop/admin_api/fetch_event.html b/develop/admin_api/fetch_event.html index 096999234b..dae5ff17bb 100644 --- a/develop/admin_api/fetch_event.html +++ b/develop/admin_api/fetch_event.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
diff --git a/develop/admin_api/media_admin_api.html b/develop/admin_api/media_admin_api.html index 770389766e..f47159a46b 100644 --- a/develop/admin_api/media_admin_api.html +++ b/develop/admin_api/media_admin_api.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
diff --git a/develop/admin_api/purge_history_api.html b/develop/admin_api/purge_history_api.html index aac55e4b67..56673a620d 100644 --- a/develop/admin_api/purge_history_api.html +++ b/develop/admin_api/purge_history_api.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
diff --git a/develop/admin_api/register_api.html b/develop/admin_api/register_api.html index ea6aa3fcc1..286551f2c3 100644 --- a/develop/admin_api/register_api.html +++ b/develop/admin_api/register_api.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
diff --git a/develop/admin_api/room_membership.html b/develop/admin_api/room_membership.html index 92b1700153..d8e2f3d65b 100644 --- a/develop/admin_api/room_membership.html +++ b/develop/admin_api/room_membership.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
diff --git a/develop/admin_api/rooms.html b/develop/admin_api/rooms.html index 359f3fdbb6..51cdec5391 100644 --- a/develop/admin_api/rooms.html +++ b/develop/admin_api/rooms.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
diff --git a/develop/admin_api/scheduled_tasks.html b/develop/admin_api/scheduled_tasks.html index d6589d954b..8737c89a56 100644 --- a/develop/admin_api/scheduled_tasks.html +++ b/develop/admin_api/scheduled_tasks.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
diff --git a/develop/admin_api/server_announcements.html b/develop/admin_api/server_announcements.html new file mode 100644 index 0000000000..d87e83c80c --- /dev/null +++ b/develop/admin_api/server_announcements.html @@ -0,0 +1,361 @@ + + + + + + Server Announcements - Synapse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Keyboard shortcuts

+
+

Press ← or → to navigate between chapters

+

Press S or / to search in the book

+

Press ? to show this help

+

Press Esc to hide this help

+
+
+
+
+ + + + + + + + + + + + + +
+ +
+
+ + + + + + + +
+
+

Server Announcements

+

These APIs read and send to the server announcement rooms configured under +experimental_features.server_announcements.rooms in homeserver.yaml. The +feature is experimental; see the +configuration module +for how to configure the rooms.

+

Each room is identified by the id of its configuration entry, not by its +Matrix room ID.

+

You will need to +authenticate with an access token +for an admin user.

+

List announcement rooms

+
GET /_synapse/admin/v1/server_announcements
+
+

Returns the configured announcement rooms:

+
{
+    "management_user_id": "@_server_announcements:example.com",
+    "rooms": [
+        {
+            "id": "general",
+            "room_id": "!abc:example.com",
+            "room_name": "Server announcements",
+            "room_topic": "Planned maintenance and incidents",
+            "room_avatar_url": "mxc://example.com/xyz",
+            "allowed_user_ids": ["@comms:example.com"],
+            "excluded_user_ids": []
+        }
+    ]
+}
+
+
    +
  • management_user_id: the user that creates and manages the rooms, and sends +the announcements posted through this API.
  • +
  • rooms: one entry per configured room, in configuration order. Empty if no +rooms are configured. +
      +
    • id: the id of the configuration entry.
    • +
    • room_id: the Matrix room ID. null if the room has not been created, +which happens after the room is purged while Synapse is running. Synapse +creates it again on the next restart.
    • +
    • room_name, room_topic, room_avatar_url: the values from the +configuration, which Synapse applies to the room at startup. Use the +room details API for the room’s current state.
    • +
    • allowed_user_ids, excluded_user_ids: as configured.
    • +
    +
  • +
+

Rooms whose configuration entry was removed are not listed.

+

Get an announcement room

+
GET /_synapse/admin/v1/server_announcements/{id}
+
+

Returns a single entry of rooms above, or a 404 with M_NOT_FOUND if id is +not in the configuration.

+

Send an announcement

+
POST /_synapse/admin/v1/server_announcements/{id}/send
+
+

or:

+
PUT /_synapse/admin/v1/server_announcements/{id}/send/{txnId}
+
+

Sends an event into the announcement room with configuration id, as the +management user. The event reaches every user that the room is delivered to. +No rate limit applies.

+

When using the PUT form, retransmissions with the same transaction ID will be +ignored in the same way as with PUT /_matrix/client/v3/rooms/{roomId}/send/{eventType}/{txnId}. When Synapse +delegates authentication to the Matrix Authentication Service, the PUT form +needs an access token with a device.

+

The request body should look something like the following:

+
{
+    "content": {
+        "msgtype": "m.text",
+        "body": "Maintenance tonight at 22:00 UTC"
+    }
+}
+
+

You can optionally include the following additional parameter:

+
    +
  • +

    type: the type of event. Defaults to m.room.message. Any non-state event +type except m.room.member is accepted, so an announcement can be edited by +sending an m.room.message with m.new_content and m.relates_to. To +retract an announcement, send an m.room.redaction with the ID of the event +to redact in content.redacts, whatever the room version. Synapse moves it +to the top level of the event for rooms before version 11:

    +
    {
    +    "type": "m.room.redaction",
    +    "content": {"redacts": "$event_id"}
    +}
    +
    +
  • +
+

State events cannot be sent: Synapse manages the room state from the +configuration, and a request with a state_key is rejected with +M_INVALID_PARAM.

+

Once the event has been sent, the API will return the following response:

+
{
+    "event_id": "<event_id>",
+    "room_id": "<room_id>"
+}
+
+

The API returns a 400 if no announcement rooms are configured, and a 404 if +id is not in the configuration.

+

Push notifications are not yet sent for announcements.

+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/develop/admin_api/server_notices.html b/develop/admin_api/server_notices.html index fc6fe65e07..b6d93e2347 100644 --- a/develop/admin_api/server_notices.html +++ b/develop/admin_api/server_notices.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
@@ -237,7 +237,7 @@ can be used. See the server notices documentati - @@ -251,7 +251,7 @@ can be used. See the server notices documentati - diff --git a/develop/admin_api/statistics.html b/develop/admin_api/statistics.html index 45b566b80f..1ad6a2cc23 100644 --- a/develop/admin_api/statistics.html +++ b/develop/admin_api/statistics.html @@ -37,10 +37,10 @@ const path_to_root = "../"; const default_light_theme = "light"; const default_dark_theme = "navy"; - window.path_to_searchindex_js = "../searchindex-fc00cfc0.js"; + window.path_to_searchindex_js = "../searchindex-12b75b54.js"; - +
@@ -312,7 +312,7 @@ in the database.