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

Commit 0da2301

Browse files
dklimpelreivilibre
andauthored
Consolidate the access_token information in the admin api (#11861)
Co-authored-by: reivilibre <[email protected]>
1 parent 02755c3 commit 0da2301

File tree

10 files changed

+30
-95
lines changed

10 files changed

+30
-95
lines changed

changelog.d/11861.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Consolidate the `access_token` information at the top of each relevant page in the Admin API documentation.

docs/admin_api/account_validity.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ This API allows a server administrator to manage the validity of an account. To
44
use it, you must enable the account validity feature (under
55
`account_validity`) in Synapse's configuration.
66

7+
To use it, you will need to authenticate by providing an `access_token`
8+
for a server admin: see [Admin API](../usage/administration/admin_api).
9+
710
## Renew account
811

912
This API extends the validity of an account by as much time as configured in the

docs/admin_api/delete_group.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ This API lets a server admin delete a local group. Doing so will kick all
44
users out of the group so that their clients will correctly handle the group
55
being deleted.
66

7+
To use it, you will need to authenticate by providing an `access_token`
8+
for a server admin: see [Admin API](../usage/administration/admin_api).
9+
710
The API is:
811

912
```
1013
POST /_synapse/admin/v1/delete_group/<group_id>
1114
```
12-
13-
To use it, you will need to authenticate by providing an `access_token` for a
14-
server admin: see [Admin API](../usage/administration/admin_api).

docs/admin_api/event_reports.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
This API returns information about reported events.
44

5+
To use it, you will need to authenticate by providing an `access_token`
6+
for a server admin: see [Admin API](../usage/administration/admin_api).
7+
58
The api is:
69
```
710
GET /_synapse/admin/v1/event_reports?from=0&limit=10
811
```
9-
To use it, you will need to authenticate by providing an `access_token` for a
10-
server admin: see [Admin API](../usage/administration/admin_api).
1112

1213
It returns a JSON body like the following:
1314

@@ -94,8 +95,6 @@ The api is:
9495
```
9596
GET /_synapse/admin/v1/event_reports/<report_id>
9697
```
97-
To use it, you will need to authenticate by providing an `access_token` for a
98-
server admin: see [Admin API](../usage/administration/admin_api).
9998

10099
It returns a JSON body like the following:
101100

docs/admin_api/media_admin_api.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
These APIs allow extracting media information from the homeserver.
44

5+
To use it, you will need to authenticate by providing an `access_token`
6+
for a server admin: see [Admin API](../usage/administration/admin_api).
7+
58
## List all media in a room
69

710
This API gets a list of known media in a room.
@@ -11,8 +14,6 @@ The API is:
1114
```
1215
GET /_synapse/admin/v1/room/<room_id>/media
1316
```
14-
To use it, you will need to authenticate by providing an `access_token` for a
15-
server admin: see [Admin API](../usage/administration/admin_api).
1617

1718
The API returns a JSON body like the following:
1819
```json
@@ -300,8 +301,5 @@ The following fields are returned in the JSON response body:
300301

301302
* `deleted`: integer - The number of media items successfully deleted
302303

303-
To use it, you will need to authenticate by providing an `access_token` for a
304-
server admin: see [Admin API](../usage/administration/admin_api).
305-
306304
If the user re-requests purged remote media, synapse will re-request the media
307305
from the originating server.

docs/admin_api/purge_history_api.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ paginate further back in the room from the point being purged from.
1010
Note that Synapse requires at least one message in each room, so it will never
1111
delete the last message in a room.
1212

13+
To use it, you will need to authenticate by providing an `access_token`
14+
for a server admin: see [Admin API](../usage/administration/admin_api).
15+
1316
The API is:
1417

1518
```
1619
POST /_synapse/admin/v1/purge_history/<room_id>[/<event_id>]
1720
```
1821

19-
To use it, you will need to authenticate by providing an `access_token` for a
20-
server admin: [Admin API](../usage/administration/admin_api)
21-
2222
By default, events sent by local users are not deleted, as they may represent
2323
the only copies of this content in existence. (Events sent by remote users are
2424
deleted.)
@@ -57,9 +57,6 @@ It is possible to poll for updates on recent purges with a second API;
5757
GET /_synapse/admin/v1/purge_history_status/<purge_id>
5858
```
5959

60-
Again, you will need to authenticate by providing an `access_token` for a
61-
server admin.
62-
6360
This API returns a JSON body like the following:
6461

6562
```json

docs/admin_api/room_membership.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ to a room with a given `room_id_or_alias`. You can only modify the membership of
55
local users. The server administrator must be in the room and have permission to
66
invite users.
77

8+
To use it, you will need to authenticate by providing an `access_token`
9+
for a server admin: see [Admin API](../usage/administration/admin_api).
10+
811
## Parameters
912

1013
The following parameters are available:
@@ -23,9 +26,6 @@ POST /_synapse/admin/v1/join/<room_id_or_alias>
2326
}
2427
```
2528

26-
To use it, you will need to authenticate by providing an `access_token` for a
27-
server admin: see [Admin API](../usage/administration/admin_api).
28-
2929
Response:
3030

3131
```json

docs/admin_api/rooms.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ The List Room admin API allows server admins to get a list of rooms on their
44
server. There are various parameters available that allow for filtering and
55
sorting the returned list. This API supports pagination.
66

7+
To use it, you will need to authenticate by providing an `access_token`
8+
for a server admin: see [Admin API](../usage/administration/admin_api).
9+
710
**Parameters**
811

912
The following query parameters are available:
@@ -478,9 +481,6 @@ several minutes or longer.
478481
The local server will only have the power to move local user and room aliases to
479482
the new room. Users on other servers will be unaffected.
480483

481-
To use it, you will need to authenticate by providing an ``access_token`` for a
482-
server admin: see [Admin API](../usage/administration/admin_api).
483-
484484
## Version 1 (old version)
485485

486486
This version works synchronously. That means you only get the response once the server has

docs/admin_api/statistics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
Returns information about all local media usage of users. Gives the
44
possibility to filter them by time and user.
55

6+
To use it, you will need to authenticate by providing an `access_token`
7+
for a server admin: see [Admin API](../usage/administration/admin_api).
8+
69
The API is:
710

811
```
912
GET /_synapse/admin/v1/statistics/users/media
1013
```
1114

12-
To use it, you will need to authenticate by providing an `access_token`
13-
for a server admin: see [Admin API](../usage/administration/admin_api).
14-
1515
A response body like the following is returned:
1616

1717
```json

docs/admin_api/user_admin_api.md

Lines changed: 5 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# User Admin API
22

3+
To use it, you will need to authenticate by providing an `access_token`
4+
for a server admin: see [Admin API](../usage/administration/admin_api).
5+
36
## Query User Account
47

58
This API returns information about a specific user account.
@@ -10,9 +13,6 @@ The api is:
1013
GET /_synapse/admin/v2/users/<user_id>
1114
```
1215

13-
To use it, you will need to authenticate by providing an `access_token` for a
14-
server admin: [Admin API](../usage/administration/admin_api)
15-
1616
It returns a JSON body like the following:
1717

1818
```jsonc
@@ -104,9 +104,6 @@ with a body of:
104104
}
105105
```
106106

107-
To use it, you will need to authenticate by providing an `access_token` for a
108-
server admin: [Admin API](../usage/administration/admin_api)
109-
110107
Returns HTTP status code:
111108
- `201` - When a new user object was created.
112109
- `200` - When a user was modified.
@@ -156,9 +153,6 @@ By default, the response is ordered by ascending user ID.
156153
GET /_synapse/admin/v2/users?from=0&limit=10&guests=false
157154
```
158155

159-
To use it, you will need to authenticate by providing an `access_token` for a
160-
server admin: [Admin API](../usage/administration/admin_api)
161-
162156
A response body like the following is returned:
163157

164158
```json
@@ -278,9 +272,6 @@ GET /_matrix/client/r0/admin/whois/<userId>
278272
See also: [Client Server
279273
API Whois](https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-admin-whois-userid).
280274

281-
To use it, you will need to authenticate by providing an `access_token` for a
282-
server admin: [Admin API](../usage/administration/admin_api)
283-
284275
It returns a JSON body like the following:
285276

286277
```json
@@ -335,9 +326,6 @@ with a body of:
335326
}
336327
```
337328

338-
To use it, you will need to authenticate by providing an `access_token` for a
339-
server admin: [Admin API](../usage/administration/admin_api)
340-
341329
The erase parameter is optional and defaults to `false`.
342330
An empty body may be passed for backwards compatibility.
343331

@@ -394,9 +382,6 @@ with a body of:
394382
}
395383
```
396384

397-
To use it, you will need to authenticate by providing an `access_token` for a
398-
server admin: [Admin API](../usage/administration/admin_api)
399-
400385
The parameter `new_password` is required.
401386
The parameter `logout_devices` is optional and defaults to `true`.
402387

@@ -409,9 +394,6 @@ The api is:
409394
GET /_synapse/admin/v1/users/<user_id>/admin
410395
```
411396

412-
To use it, you will need to authenticate by providing an `access_token` for a
413-
server admin: [Admin API](../usage/administration/admin_api)
414-
415397
A response body like the following is returned:
416398

417399
```json
@@ -439,10 +421,6 @@ with a body of:
439421
}
440422
```
441423

442-
To use it, you will need to authenticate by providing an `access_token` for a
443-
server admin: [Admin API](../usage/administration/admin_api)
444-
445-
446424
## List room memberships of a user
447425

448426
Gets a list of all `room_id` that a specific `user_id` is member.
@@ -453,9 +431,6 @@ The API is:
453431
GET /_synapse/admin/v1/users/<user_id>/joined_rooms
454432
```
455433

456-
To use it, you will need to authenticate by providing an `access_token` for a
457-
server admin: [Admin API](../usage/administration/admin_api)
458-
459434
A response body like the following is returned:
460435

461436
```json
@@ -574,9 +549,6 @@ The API is:
574549
GET /_synapse/admin/v1/users/<user_id>/media
575550
```
576551

577-
To use it, you will need to authenticate by providing an `access_token` for a
578-
server admin: [Admin API](../usage/administration/admin_api)
579-
580552
A response body like the following is returned:
581553

582554
```json
@@ -691,9 +663,6 @@ The API is:
691663
DELETE /_synapse/admin/v1/users/<user_id>/media
692664
```
693665

694-
To use it, you will need to authenticate by providing an `access_token` for a
695-
server admin: [Admin API](../usage/administration/admin_api)
696-
697666
A response body like the following is returned:
698667

699668
```json
@@ -766,9 +735,6 @@ The API is:
766735
GET /_synapse/admin/v2/users/<user_id>/devices
767736
```
768737

769-
To use it, you will need to authenticate by providing an `access_token` for a
770-
server admin: [Admin API](../usage/administration/admin_api)
771-
772738
A response body like the following is returned:
773739

774740
```json
@@ -834,9 +800,6 @@ POST /_synapse/admin/v2/users/<user_id>/delete_devices
834800
}
835801
```
836802

837-
To use it, you will need to authenticate by providing an `access_token` for a
838-
server admin: [Admin API](../usage/administration/admin_api)
839-
840803
An empty JSON dict is returned.
841804

842805
**Parameters**
@@ -858,9 +821,6 @@ The API is:
858821
GET /_synapse/admin/v2/users/<user_id>/devices/<device_id>
859822
```
860823

861-
To use it, you will need to authenticate by providing an `access_token` for a
862-
server admin: [Admin API](../usage/administration/admin_api)
863-
864824
A response body like the following is returned:
865825

866826
```json
@@ -906,9 +866,6 @@ PUT /_synapse/admin/v2/users/<user_id>/devices/<device_id>
906866
}
907867
```
908868

909-
To use it, you will need to authenticate by providing an `access_token` for a
910-
server admin: [Admin API](../usage/administration/admin_api)
911-
912869
An empty JSON dict is returned.
913870

914871
**Parameters**
@@ -935,9 +892,6 @@ DELETE /_synapse/admin/v2/users/<user_id>/devices/<device_id>
935892
{}
936893
```
937894

938-
To use it, you will need to authenticate by providing an `access_token` for a
939-
server admin: [Admin API](../usage/administration/admin_api)
940-
941895
An empty JSON dict is returned.
942896

943897
**Parameters**
@@ -956,9 +910,6 @@ The API is:
956910
GET /_synapse/admin/v1/users/<user_id>/pushers
957911
```
958912

959-
To use it, you will need to authenticate by providing an `access_token` for a
960-
server admin: [Admin API](../usage/administration/admin_api)
961-
962913
A response body like the following is returned:
963914

964915
```json
@@ -1053,9 +1004,6 @@ To un-shadow-ban a user the API is:
10531004
DELETE /_synapse/admin/v1/users/<user_id>/shadow_ban
10541005
```
10551006

1056-
To use it, you will need to authenticate by providing an `access_token` for a
1057-
server admin: [Admin API](../usage/administration/admin_api)
1058-
10591007
An empty JSON dict is returned in both cases.
10601008

10611009
**Parameters**
@@ -1078,9 +1026,6 @@ The API is:
10781026
GET /_synapse/admin/v1/users/<user_id>/override_ratelimit
10791027
```
10801028

1081-
To use it, you will need to authenticate by providing an `access_token` for a
1082-
server admin: [Admin API](../usage/administration/admin_api)
1083-
10841029
A response body like the following is returned:
10851030

10861031
```json
@@ -1120,9 +1065,6 @@ The API is:
11201065
POST /_synapse/admin/v1/users/<user_id>/override_ratelimit
11211066
```
11221067

1123-
To use it, you will need to authenticate by providing an `access_token` for a
1124-
server admin: [Admin API](../usage/administration/admin_api)
1125-
11261068
A response body like the following is returned:
11271069

11281070
```json
@@ -1165,9 +1107,6 @@ The API is:
11651107
DELETE /_synapse/admin/v1/users/<user_id>/override_ratelimit
11661108
```
11671109

1168-
To use it, you will need to authenticate by providing an `access_token` for a
1169-
server admin: [Admin API](../usage/administration/admin_api)
1170-
11711110
An empty JSON dict is returned.
11721111

11731112
```json
@@ -1196,7 +1135,5 @@ The API is:
11961135
GET /_synapse/admin/v1/username_available?username=$localpart
11971136
```
11981137

1199-
The request and response format is the same as the [/_matrix/client/r0/register/available](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available) API.
1200-
1201-
To use it, you will need to authenticate by providing an `access_token` for a
1202-
server admin: [Admin API](../usage/administration/admin_api)
1138+
The request and response format is the same as the
1139+
[/_matrix/client/r0/register/available](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available) API.

0 commit comments

Comments
 (0)