summary refs log tree commit diff
path: root/docs/admin_api
diff options
context:
space:
mode:
authorTravis Ralston <travpc@gmail.com>2021-01-19 13:59:29 -0700
committerTravis Ralston <travpc@gmail.com>2021-01-19 13:59:29 -0700
commit40f96320a2eb0049cb5defaf52530b8e08095a14 (patch)
treea5192ffbc0f48de65b16313409ca5d197c3e79ac /docs/admin_api
parentValidate the server name for the /publicRooms endpoint. (#9161) (diff)
downloadsynapse-40f96320a2eb0049cb5defaf52530b8e08095a14.tar.xz
Add an admin API to get the current room state
This could arguably replace the existing admin API for `/members`, however that is out of scope of this change.

This sort of endpoint is ideal for moderation use cases as well as other applications, such as needing to retrieve various bits of information about a room to perform a task (like syncing power levels between two places). This endpoint exposes nothing more than an admin would be able to access with a `select *` query on their database.
Diffstat (limited to 'docs/admin_api')
-rw-r--r--docs/admin_api/rooms.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/admin_api/rooms.md b/docs/admin_api/rooms.md
index 9e560003a9..d68003853b 100644
--- a/docs/admin_api/rooms.md
+++ b/docs/admin_api/rooms.md
@@ -367,6 +367,36 @@ Response:
 }
 ```
 
+# Room State API
+
+The Room State admin API allows server admins to get a list of all state events in a room.
+
+The response includes the following fields:
+
+* `state` - The current state of the room at the time of request.
+
+## Usage
+
+A standard request:
+
+```
+GET /_synapse/admin/v1/rooms/<room_id>/state
+
+{}
+```
+
+Response:
+
+```json
+{
+  "state": [
+    {"type": "m.room.create", "state_key": "", "etc": true},
+    {"type": "m.room.power_levels", "state_key": "", "etc": true},
+    {"type": "m.room.name", "state_key": "", "etc": true}
+  ]
+}
+```
+
 # Delete Room API
 
 The Delete Room admin API allows server admins to remove rooms from server