diff options
author | kaniini <nenolod@gmail.com> | 2019-03-03 15:59:15 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2019-03-03 15:59:15 +0000 |
commit | 6c6a2dbfdd7ae4043633c3201693c5c49538ef84 (patch) | |
tree | 20797ce1b269eef2048d768cc0ea528b08a2899d /docs/Admin-API.md | |
parent | b531e366dfffa6b34900dd249492707bff647401 (diff) | |
parent | 08c6aeeed7ff5db242050d06e707f99b6d75684d (diff) | |
download | pleroma-6c6a2dbfdd7ae4043633c3201693c5c49538ef84.tar.gz |
Merge branch 'feature/add-pagination-to-users-admin-api' into 'develop'
Add pagination and search to users
See merge request pleroma/pleroma!873
Diffstat (limited to 'docs/Admin-API.md')
-rw-r--r-- | docs/Admin-API.md | 58 |
1 files changed, 46 insertions, 12 deletions
diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 508981d38..407647645 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -7,17 +7,51 @@ Authentication is required and the user must be an admin. ### 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 + "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`) +- Response: + +```JSON +{ + "page_size": integer, + "count": integer, + "users": [ + { + "deactivated": bool, + "id": integer, + "nickname": string + }, + ... + ] +} ``` ## `/api/pleroma/admin/user` @@ -49,9 +83,9 @@ Authentication is required and the user must be an admin. ```JSON { - "deactivated": bool, - "id": integer, - "nickname": string + "deactivated": bool, + "id": integer, + "nickname": string } ``` @@ -81,8 +115,8 @@ Authentication is required and the user must be an admin. ```JSON { - "is_moderator": bool, - "is_admin": bool + "is_moderator": bool, + "is_admin": bool } ``` @@ -98,8 +132,8 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret ```JSON { - "is_moderator": bool, - "is_admin": bool + "is_moderator": bool, + "is_admin": bool } ``` |