From e34710b9888d5a3602971111c3a376bf8442fb84 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Mon, 4 Mar 2019 21:33:53 +0300 Subject: Format & update docs --- docs/Admin-API.md | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'docs/Admin-API.md') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 407647645..7f60b768a 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -2,41 +2,16 @@ Authentication is required and the user must be an admin. -## `/api/pleroma/admin/users` +## `/api/pleroma/admin/users?query={query}&local={local}&page={page}&page_size={page_size}` ### List users - Method `GET` - Params: - - `page`: **integer** page number - - `page_size`: **integer** number of users per page (default is `50`) -- Response: - -```JSON -{ - "page_size": integer, - "count": integer, - "users": [ - { - "deactivated": bool, - "id": integer, - "nickname": string - }, - ... - ] -} -``` - -## `/api/pleroma/admin/users/search?query={query}&local={local}&page={page}&page_size={page_size}` - -### Search users by name or nickname - -- Method `GET` -- Params: - - `query`: **string** search term - - `local`: **bool** whether to return only local users - - `page`: **integer** page number - - `page_size`: **integer** number of users per page (default is `50`) + - `query`: **string** *optional* search term + - `local`: **bool** *optional* whether to return only local users + - `page`: **integer** *optional* page number + - `page_size`: **integer** *optional* number of users per page (default is `50`) - Response: ```JSON -- cgit v1.2.3 From 02359d686ca5f7feb1b83d77a35118bd55efdb52 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Mon, 4 Mar 2019 21:36:47 +0300 Subject: local -> only_local --- docs/Admin-API.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/Admin-API.md') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 7f60b768a..24944440a 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -2,14 +2,14 @@ Authentication is required and the user must be an admin. -## `/api/pleroma/admin/users?query={query}&local={local}&page={page}&page_size={page_size}` +## `/api/pleroma/admin/users?query={query}&only_local={only_local}&page={page}&page_size={page_size}` ### List users - Method `GET` - Params: - `query`: **string** *optional* search term - - `local`: **bool** *optional* whether to return only local users + - `only_local`: **bool** *optional* whether to return only local users - `page`: **integer** *optional* page number - `page_size`: **integer** *optional* number of users per page (default is `50`) - Response: -- cgit v1.2.3 From 2d30fc279f2a3a5af68918c32c474a2fe8eaf664 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Tue, 5 Mar 2019 02:11:15 +0300 Subject: Typo --- docs/Admin-API.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/Admin-API.md') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 24944440a..64e112f9b 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -9,7 +9,7 @@ Authentication is required and the user must be an admin. - Method `GET` - Params: - `query`: **string** *optional* search term - - `only_local`: **bool** *optional* whether to return only local users + - `local_only`: **bool** *optional* whether to return only local users - `page`: **integer** *optional* page number - `page_size`: **integer** *optional* number of users per page (default is `50`) - Response: -- cgit v1.2.3 From 76160122f6d7bf52aee929328acb4d216e4c3504 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Wed, 6 Mar 2019 05:01:38 +0300 Subject: Keep heading short --- docs/Admin-API.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/Admin-API.md') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 64e112f9b..2edb31f3c 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -2,12 +2,12 @@ Authentication is required and the user must be an admin. -## `/api/pleroma/admin/users?query={query}&only_local={only_local}&page={page}&page_size={page_size}` +## `/api/pleroma/admin/users` ### List users - Method `GET` -- Params: +- Query Params: - `query`: **string** *optional* search term - `local_only`: **bool** *optional* whether to return only local users - `page`: **integer** *optional* page number -- cgit v1.2.3 From 3cf7539bca56ce1118bbedaba547d371f3f20eed Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Wed, 27 Mar 2019 03:51:59 +0500 Subject: Add more user filters + move search to its own module --- docs/Admin-API.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'docs/Admin-API.md') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 2edb31f3c..84adca6ff 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -8,10 +8,15 @@ Authentication is required and the user must be an admin. - Method `GET` - Query Params: - - `query`: **string** *optional* search term - - `local_only`: **bool** *optional* whether to return only local users - - `page`: **integer** *optional* page number - - `page_size`: **integer** *optional* number of users per page (default is `50`) + - *optional* `query`: **string** search term + - *optional* `filters`: **string** comma-separated string of filters: + - `local`: only local users + - `external`: only external users + - `active`: only active users + - `deactivated`: only deactivated users + - *optional* `page`: **integer** page number + - *optional* `page_size`: **integer** number of users per page (default is `50`) +- Example: `https://mypleroma.org/api/pleroma/admin/users?query=john&filters=local,active&page=1&page_size=10` - Response: ```JSON @@ -22,7 +27,13 @@ Authentication is required and the user must be an admin. { "deactivated": bool, "id": integer, - "nickname": string + "nickname": string, + "roles": { + "admin": bool, + "moderator": bool + }, + "local": bool, + "tags": array }, ... ] @@ -99,7 +110,7 @@ Authentication is required and the user must be an admin. 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 +### Get user user permission groups membership per permission group - Method: `GET` - Params: none -- cgit v1.2.3 From dfae0050af385786c5799ee886de315f69d36a78 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 28 Mar 2019 19:46:30 +0300 Subject: Move out of Gitlab Wiki I understand that this change is quite unreadable and hard to review, sorry for forgetting to do atomic commits. This patch does not change too much content wise, it just * Gets everything from gitlab wiki * Removes some specific gitlab hacks * Formats all documentation file names to be in snake case so they look the same way as our code does --- docs/Admin-API.md | 193 ------------------------------------------------------ 1 file changed, 193 deletions(-) delete mode 100644 docs/Admin-API.md (limited to 'docs/Admin-API.md') diff --git a/docs/Admin-API.md b/docs/Admin-API.md deleted file mode 100644 index 84adca6ff..000000000 --- a/docs/Admin-API.md +++ /dev/null @@ -1,193 +0,0 @@ -# Admin API - -Authentication is required and the user must be an admin. - -## `/api/pleroma/admin/users` - -### List users - -- Method `GET` -- Query Params: - - *optional* `query`: **string** search term - - *optional* `filters`: **string** comma-separated string of filters: - - `local`: only local users - - `external`: only external users - - `active`: only active users - - `deactivated`: only deactivated users - - *optional* `page`: **integer** page number - - *optional* `page_size`: **integer** number of users per page (default is `50`) -- Example: `https://mypleroma.org/api/pleroma/admin/users?query=john&filters=local,active&page=1&page_size=10` -- Response: - -```JSON -{ - "page_size": integer, - "count": integer, - "users": [ - { - "deactivated": bool, - "id": integer, - "nickname": string, - "roles": { - "admin": bool, - "moderator": bool - }, - "local": bool, - "tags": array - }, - ... - ] -} -``` - -## `/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/:nickname/toggle_activation` - -### Toggle user activation - -- Method: `PATCH` -- Params: - - `nickname` -- Response: User’s object - -```JSON -{ - "deactivated": bool, - "id": integer, - "nickname": string -} -``` - -## `/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 per permission group - -- 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/activation_status/:nickname` - -### Active or deactivate a user - -- Method: `PUT` -- Params: - - `nickname` - - `status` BOOLEAN field, false value means deactivation. - -## `/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) -- cgit v1.2.3