Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into feature/digest...
[akkoma] / docs / api / admin_api.md
index ea9b9308c8dbed8e96f70e3e461dcbd175488be8..8befa8ea0033bd57d1edad482f7ebe3d81e01649 100644 (file)
@@ -1,5 +1,4 @@
 # Admin API
-# Admin API
 
 Authentication is required and the user must be an admin.
 
@@ -59,6 +58,26 @@ Authentication is required and the user must be an admin.
   - `password`
 - Response: User’s nickname
 
+## `/api/pleroma/admin/user/follow`
+### Make a user follow another user
+
+- Methods: `POST`
+- Params:
+ - `follower`: The nickname of the follower
+ - `followed`: The nickname of the followed
+- Response:
+ - "ok"
+
+## `/api/pleroma/admin/user/unfollow`
+### Make a user unfollow another user
+
+- Methods: `POST`
+- Params:
+ - `follower`: The nickname of the follower
+ - `followed`: The nickname of the followed
+- Response:
+ - "ok"
+
 ## `/api/pleroma/admin/users/:nickname/toggle_activation`
 
 ### Toggle user activation
@@ -150,6 +169,17 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
   - `nickname`
   - `status` BOOLEAN field, false value means deactivation.
 
+## `/api/pleroma/admin/users/:nickname`
+
+### Retrive the details of a user
+
+- Method: `GET`
+- Params:
+  - `nickname`
+- Response:
+  - On failure: `Not found`
+  - On success: JSON of the user
+
 ## `/api/pleroma/admin/relay`
 
 ### Follow a Relay
@@ -170,12 +200,65 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
 
 ## `/api/pleroma/admin/invite_token`
 
-### Get a account registeration invite token
+### Get an account registration invite token
 
 - Methods: `GET`
-- Params: none
+- Params:
+  - *optional* `invite` => [
+    - *optional* `max_use` (integer)
+    - *optional* `expires_at` (date string e.g. "2019-04-07")
+  ]
 - Response: invite token (base64 string)
 
+## `/api/pleroma/admin/invites`
+
+### Get a list of generated invites
+
+- Methods: `GET`
+- Params: none
+- Response:
+
+```JSON
+{
+
+  "invites": [
+    {
+      "id": integer,
+      "token": string,
+      "used": boolean,
+      "expires_at": date,
+      "uses": integer,
+      "max_use": integer,
+      "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
+    },
+    ...
+  ]
+}
+```
+
+## `/api/pleroma/admin/revoke_invite`
+
+### Revoke invite by token
+
+- Methods: `POST`
+- Params:
+  - `token`
+- Response:
+
+```JSON
+{
+  "id": integer,
+  "token": string,
+  "used": boolean,
+  "expires_at": date,
+  "uses": integer,
+  "max_use": integer,
+  "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`)
+
+}
+```
+
+
 ## `/api/pleroma/admin/email_invite`
 
 ### Sends registration invite via email
@@ -183,7 +266,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
 - Methods: `POST`
 - Params:
   - `email`
-  - `name`, optionnal
+  - `name`, optional
 
 ## `/api/pleroma/admin/password_reset`