Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 2d04466

Browse files
authored
Simplify structure of room admin API docs (#10313)
1 parent bc60f99 commit 2d04466

File tree

2 files changed

+25
-45
lines changed

2 files changed

+25
-45
lines changed

changelog.d/10313.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Simplify structure of room admin API.

docs/admin_api/rooms.md

Lines changed: 24 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
# Contents
22
- [List Room API](#list-room-api)
3-
* [Parameters](#parameters)
4-
* [Usage](#usage)
53
- [Room Details API](#room-details-api)
64
- [Room Members API](#room-members-api)
75
- [Room State API](#room-state-api)
86
- [Delete Room API](#delete-room-api)
9-
* [Parameters](#parameters-1)
10-
* [Response](#response)
117
* [Undoing room shutdowns](#undoing-room-shutdowns)
128
- [Make Room Admin API](#make-room-admin-api)
139
- [Forward Extremities Admin API](#forward-extremities-admin-api)
@@ -19,7 +15,7 @@ The List Room admin API allows server admins to get a list of rooms on their
1915
server. There are various parameters available that allow for filtering and
2016
sorting the returned list. This API supports pagination.
2117

22-
## Parameters
18+
**Parameters**
2319

2420
The following query parameters are available:
2521

@@ -46,6 +42,8 @@ The following query parameters are available:
4642
* `search_term` - Filter rooms by their room name. Search term can be contained in any
4743
part of the room name. Defaults to no filtering.
4844

45+
**Response**
46+
4947
The following fields are possible in the JSON response body:
5048

5149
* `rooms` - An array of objects, each containing information about a room.
@@ -79,17 +77,15 @@ The following fields are possible in the JSON response body:
7977
Use `prev_batch` for the `from` value in the next request to
8078
get the "previous page" of results.
8179

82-
## Usage
80+
The API is:
8381

8482
A standard request with no filtering:
8583

8684
```
8785
GET /_synapse/admin/v1/rooms
88-
89-
{}
9086
```
9187

92-
Response:
88+
A response body like the following is returned:
9389

9490
```jsonc
9591
{
@@ -137,11 +133,9 @@ Filtering by room name:
137133

138134
```
139135
GET /_synapse/admin/v1/rooms?search_term=TWIM
140-
141-
{}
142136
```
143137

144-
Response:
138+
A response body like the following is returned:
145139

146140
```json
147141
{
@@ -172,11 +166,9 @@ Paginating through a list of rooms:
172166

173167
```
174168
GET /_synapse/admin/v1/rooms?order_by=size
175-
176-
{}
177169
```
178170

179-
Response:
171+
A response body like the following is returned:
180172

181173
```jsonc
182174
{
@@ -228,11 +220,9 @@ parameter to the value of `next_token`.
228220

229221
```
230222
GET /_synapse/admin/v1/rooms?order_by=size&from=100
231-
232-
{}
233223
```
234224

235-
Response:
225+
A response body like the following is returned:
236226

237227
```jsonc
238228
{
@@ -304,17 +294,13 @@ The following fields are possible in the JSON response body:
304294
* `history_visibility` - Who can see the room history. One of: ["invited", "joined", "shared", "world_readable"].
305295
* `state_events` - Total number of state_events of a room. Complexity of the room.
306296

307-
## Usage
308-
309-
A standard request:
297+
The API is:
310298

311299
```
312300
GET /_synapse/admin/v1/rooms/<room_id>
313-
314-
{}
315301
```
316302

317-
Response:
303+
A response body like the following is returned:
318304

319305
```json
320306
{
@@ -347,17 +333,13 @@ The response includes the following fields:
347333
* `members` - A list of all the members that are present in the room, represented by their ids.
348334
* `total` - Total number of members in the room.
349335

350-
## Usage
351-
352-
A standard request:
336+
The API is:
353337

354338
```
355339
GET /_synapse/admin/v1/rooms/<room_id>/members
356-
357-
{}
358340
```
359341

360-
Response:
342+
A response body like the following is returned:
361343

362344
```json
363345
{
@@ -378,17 +360,13 @@ The response includes the following fields:
378360

379361
* `state` - The current state of the room at the time of request.
380362

381-
## Usage
382-
383-
A standard request:
363+
The API is:
384364

385365
```
386366
GET /_synapse/admin/v1/rooms/<room_id>/state
387-
388-
{}
389367
```
390368

391-
Response:
369+
A response body like the following is returned:
392370

393371
```json
394372
{
@@ -432,6 +410,7 @@ DELETE /_synapse/admin/v1/rooms/<room_id>
432410
```
433411

434412
with a body of:
413+
435414
```json
436415
{
437416
"new_room_user_id": "@someuser:example.com",
@@ -461,7 +440,7 @@ A response body like the following is returned:
461440
}
462441
```
463442

464-
## Parameters
443+
**Parameters**
465444

466445
The following parameters should be set in the URL:
467446

@@ -491,7 +470,7 @@ The following JSON body parameters are available:
491470

492471
The JSON body must not be empty. The body must be at least `{}`.
493472

494-
## Response
473+
**Response**
495474

496475
The following fields are returned in the JSON response body:
497476

@@ -548,10 +527,10 @@ By default the server admin (the caller) is granted power, but another user can
548527
optionally be specified, e.g.:
549528

550529
```
551-
POST /_synapse/admin/v1/rooms/<room_id_or_alias>/make_room_admin
552-
{
553-
"user_id": "@foo:example.com"
554-
}
530+
POST /_synapse/admin/v1/rooms/<room_id_or_alias>/make_room_admin
531+
{
532+
"user_id": "@foo:example.com"
533+
}
555534
```
556535

557536
# Forward Extremities Admin API
@@ -565,7 +544,7 @@ extremities accumulate in a room, performance can become degraded. For details,
565544
To check the status of forward extremities for a room:
566545

567546
```
568-
GET /_synapse/admin/v1/rooms/<room_id_or_alias>/forward_extremities
547+
GET /_synapse/admin/v1/rooms/<room_id_or_alias>/forward_extremities
569548
```
570549

571550
A response as follows will be returned:
@@ -581,7 +560,7 @@ A response as follows will be returned:
581560
"received_ts": 1611263016761
582561
}
583562
]
584-
}
563+
}
585564
```
586565

587566
## Deleting forward extremities
@@ -594,7 +573,7 @@ If a room has lots of forward extremities, the extra can be
594573
deleted as follows:
595574

596575
```
597-
DELETE /_synapse/admin/v1/rooms/<room_id_or_alias>/forward_extremities
576+
DELETE /_synapse/admin/v1/rooms/<room_id_or_alias>/forward_extremities
598577
```
599578

600579
A response as follows will be returned, indicating the amount of forward extremities

0 commit comments

Comments
 (0)