Add docs/Admin-API.md
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Mon, 31 Dec 2018 11:13:17 +0000 (12:13 +0100)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Mon, 31 Dec 2018 11:27:46 +0000 (12:27 +0100)
[ci skip]

docs/Admin-API.md [new file with mode: 0644]
docs/Pleroma-API.md
mix.exs

diff --git a/docs/Admin-API.md b/docs/Admin-API.md
new file mode 100644 (file)
index 0000000..3b19d1a
--- /dev/null
@@ -0,0 +1,100 @@
+# Admin API
+Authentication is required and the user must be an admin.
+
+## `/api/pleroma/admin/user`
+### Remove a user
+* Method `DELETE`
+* Params:
+    * `nickname`
+* Response: User’s nickname
+### Create a user
+* Method: `POST`
+* Params:
+    * `nickname`
+    * `email`
+    * `password`
+* Response: User’s nickname
+
+## `/api/pleroma/admin/users/tag`
+### Tag a list of users
+* Method: `PUT`
+* Params:
+    * `nickname`
+    * `tags`
+### Untag a list of users
+* Method: `DELETE`
+* Params:
+    * `nickname`
+    * `tags`
+
+## `/api/pleroma/admin/permission_group/:nickname`
+### Get user user permission groups membership
+* Method: `GET`
+* Params: none
+* Response:
+```JSON
+{
+       "is_moderator": bool,
+       "is_admin": bool
+}
+```
+
+## `/api/pleroma/admin/permission_group/:nickname/:permission_group`
+Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist.
+
+### Get user user permission groups membership
+* Method: `GET`
+* Params: none
+* Response:
+```JSON
+{
+       "is_moderator": bool,
+       "is_admin": bool
+}
+```
+### Add user in permission group
+* Method: `POST`
+* Params: none
+* Response:
+    * On failure: ``{"error": "…"}``
+    * On success: JSON of the ``user.info``
+### Remove user from permission group
+* Method: `DELETE`
+* Params: none
+* Response:
+    * On failure: ``{"error": "…"}``
+    * On success: JSON of the ``user.info``
+* Note: An admin cannot revoke their own admin status.
+
+## `/api/pleroma/admin/relay`
+### Follow a Relay
+* Methods: `POST`
+* Params:
+    * `relay_url`
+* Response:
+    * On success: URL of the followed relay
+### Unfollow a Relay
+* Methods: `DELETE`
+* Params:
+    * `relay_url`
+* Response:
+    * On success: URL of the unfollowed relay
+
+## `/api/pleroma/admin/invite_token`
+### Get a account registeration invite token
+* Methods: `GET`
+* Params: none
+* Response: invite token (base64 string)
+
+## `/api/pleroma/admin/email_invite`
+### Sends registration invite via email
+* Methods: `POST`
+* Params:
+    * `email`
+    * `name`, optionnal
+
+## `/api/pleroma/admin/password_reset`
+### Get a password reset token for a given nickname
+* Methods: `GET`
+* Params: none
+* Response: password reset token (base64 string)
index 84a5924fa17f32380a3c0b421114976bf20f8eab..da58babf9e670656787f97aa81d3d3f53e65836f 100644 (file)
@@ -92,4 +92,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi
        "statusnet_blocking": false,
        "statusnet_profile_url": "https://pleroma.soykaf.com/users/lain"
 }
-```
\ No newline at end of file
+```
+
+## `/api/pleroma/admin/`…
+See [Admin-API](Admin-API.md)
diff --git a/mix.exs b/mix.exs
index 837a005523b42a0b3292c8ca7a13c1d4b492c957..efdd4b7eda04536fb5424fa4a5fb9d89558d3271 100644 (file)
--- a/mix.exs
+++ b/mix.exs
@@ -21,7 +21,7 @@ defmodule Pleroma.Mixfile do
       homepage_url: "https://pleroma.social/",
       docs: [
         logo: "priv/static/static/logo.png",
-        extras: ["README.md", "docs/config.md", "docs/Pleroma-API.md"],
+        extras: ["README.md", "docs/config.md", "docs/Pleroma-API.md", "docs/Admin-API.md"],
         main: "readme",
         output: "priv/static/doc"
       ]