Merge branch 'captcha' into 'develop'
[akkoma] / docs / Admin-API.md
1 # Admin API
2 Authentication is required and the user must be an admin.
3
4 ## `/api/pleroma/admin/user`
5 ### Remove a user
6 * Method `DELETE`
7 * Params:
8 * `nickname`
9 * Response: User’s nickname
10 ### Create a user
11 * Method: `POST`
12 * Params:
13 * `nickname`
14 * `email`
15 * `password`
16 * Response: User’s nickname
17
18 ## `/api/pleroma/admin/users/tag`
19 ### Tag a list of users
20 * Method: `PUT`
21 * Params:
22 * `nickname`
23 * `tags`
24 ### Untag a list of users
25 * Method: `DELETE`
26 * Params:
27 * `nickname`
28 * `tags`
29
30 ## `/api/pleroma/admin/permission_group/:nickname`
31 ### Get user user permission groups membership
32 * Method: `GET`
33 * Params: none
34 * Response:
35 ```JSON
36 {
37 "is_moderator": bool,
38 "is_admin": bool
39 }
40 ```
41
42 ## `/api/pleroma/admin/permission_group/:nickname/:permission_group`
43 Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist.
44
45 ### Get user user permission groups membership
46 * Method: `GET`
47 * Params: none
48 * Response:
49 ```JSON
50 {
51 "is_moderator": bool,
52 "is_admin": bool
53 }
54 ```
55 ### Add user in permission group
56 * Method: `POST`
57 * Params: none
58 * Response:
59 * On failure: ``{"error": "…"}``
60 * On success: JSON of the ``user.info``
61 ### Remove user from permission group
62 * Method: `DELETE`
63 * Params: none
64 * Response:
65 * On failure: ``{"error": "…"}``
66 * On success: JSON of the ``user.info``
67 * Note: An admin cannot revoke their own admin status.
68
69 ## `/api/pleroma/admin/relay`
70 ### Follow a Relay
71 * Methods: `POST`
72 * Params:
73 * `relay_url`
74 * Response:
75 * On success: URL of the followed relay
76 ### Unfollow a Relay
77 * Methods: `DELETE`
78 * Params:
79 * `relay_url`
80 * Response:
81 * On success: URL of the unfollowed relay
82
83 ## `/api/pleroma/admin/invite_token`
84 ### Get a account registeration invite token
85 * Methods: `GET`
86 * Params: none
87 * Response: invite token (base64 string)
88
89 ## `/api/pleroma/admin/email_invite`
90 ### Sends registration invite via email
91 * Methods: `POST`
92 * Params:
93 * `email`
94 * `name`, optionnal
95
96 ## `/api/pleroma/admin/password_reset`
97 ### Get a password reset token for a given nickname
98 * Methods: `GET`
99 * Params: none
100 * Response: password reset token (base64 string)