X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=docs%2FAPI%2Fadmin_api.md;h=f64983a9041a9e479637737a4533e509f09a0331;hb=9d29a5063cfbed13db633b8c9cfaf5dc7ff567dd;hp=e8232225c6f969428f35567eb267c4523f17a447;hpb=24eecc3cb4a35376124b1fc792183d8b8dd0a9cc;p=akkoma diff --git a/docs/API/admin_api.md b/docs/API/admin_api.md index e8232225c..f64983a90 100644 --- a/docs/API/admin_api.md +++ b/docs/API/admin_api.md @@ -46,7 +46,7 @@ Authentication is required and the user must be an admin. } ``` -## `DELETE /api/pleroma/admin/users` +## DEPRECATED `DELETE /api/pleroma/admin/users` ### Remove a user @@ -54,6 +54,14 @@ Authentication is required and the user must be an admin. - `nickname` - Response: User’s nickname +## `DELETE /api/pleroma/admin/users` + +### Remove a user + +- Params: + - `nicknames` +- Response: Array of user nicknames + ### Create a user - Method: `POST` @@ -149,14 +157,26 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret } ``` -## `POST /api/pleroma/admin/users/:nickname/permission_group/:permission_group` +## DEPRECATED `POST /api/pleroma/admin/users/:nickname/permission_group/:permission_group` -### Add user in permission group +### Add user to permission group - Params: none - Response: - On failure: `{"error": "…"}` - - On success: JSON of the `user.info` + - On success: JSON of the user + +## `POST /api/pleroma/admin/users/permission_group/:permission_group` + +### Add users to permission group + +- Params: + - `nicknames`: nicknames array +- Response: + - On failure: `{"error": "…"}` + - On success: JSON of the user + +## DEPRECATED `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group` ## `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group` @@ -165,16 +185,55 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret - Params: none - Response: - On failure: `{"error": "…"}` - - On success: JSON of the `user.info` + - On success: JSON of the user - Note: An admin cannot revoke their own admin status. -## `PUT /api/pleroma/admin/users/:nickname/activation_status` +## `DELETE /api/pleroma/admin/users/permission_group/:permission_group` -### Active or deactivate a user +### Remove users from permission group - Params: - - `nickname` - - `status` BOOLEAN field, false value means deactivation. + - `nicknames`: nicknames array +- Response: + - On failure: `{"error": "…"}` + - On success: JSON of the user +- Note: An admin cannot revoke their own admin status. + +## `PATCH /api/pleroma/admin/users/activate` + +### Activate user + +- Params: + - `nicknames`: nicknames array +- Response: + +```json +{ + users: [ + { + // user object + } + ] +} +``` + +## `PATCH /api/pleroma/admin/users/deactivate` + +### Deactivate user + +- Params: + - `nicknames`: nicknames array +- Response: + +```json +{ + users: [ + { + // user object + } + ] +} +``` ## `GET /api/pleroma/admin/users/:nickname_or_id` @@ -216,6 +275,14 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret - Response: - On success: URL of the unfollowed relay +## `GET /api/pleroma/admin/relay` + +### List Relays + +- Params: none +- Response: + - On success: JSON array of relays + ## `POST /api/pleroma/admin/users/invite_token` ### Create an account registration invite token @@ -305,11 +372,12 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret } ``` -## `PATCH /api/pleroma/admin/users/:nickname/force_password_reset` +## `PATCH /api/pleroma/admin/users/force_password_reset` ### Force passord reset for a user with a given nickname -- Params: none +- Params: + - `nicknames` - Response: none (code `204`) ## `GET /api/pleroma/admin/reports` @@ -658,7 +726,6 @@ Copy settings on key `:pleroma` to DB. Copy all settings from DB to `config/prod.exported_from_db.secret.exs` with deletion from DB. -- Method `GET` - Params: none - Response: