API Docs
Users Model
List all Users
10min
api endpoint documentation /api/users description this endpoint allows you to fetch a list of users you can optionally filter the users based on their type and search by keyword endpoint get https //\<your site>/api/users?type=user,editor\&keyword=john query parameters type string comma separated list of user types to filter by (e g , user , editor , admin ) (example shown above is for all basic users and editors) keyword string a keyword to search for users leave empty to return all users matching the specified types (example shown above is for case insensitive "john") headers accept application/json specifies that the request expects a json response authorization bearer \<jwt token> a json web token (jwt) that authenticates the request replace \<jwt token> with a valid token method get sends a request to retrieve a list of users based on the specified filters and optional keyword search example request (node js) const fetch = require('node fetch'); const url = 'https //\<your site>/api/users?type=user,editor\&keyword='; const options = { method 'get', headers { 'accept' 'application/json', 'authorization' 'bearer eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9 ' } }; fetch(url, options) then(response => response json()) then(data => console log(data)) catch(error => console error('error ', error)); response the api will return a json response containing user data matching the request filters success response (200) { "data" \[ { "id" "630f68e2c059e9775a633c7f", "name" "user1", "email" "user1\@example com", "type" "user", }, { "id" "640f68e2c059e9775a633c80", "name" "editor1", "email" "editor1\@example com", "type" "editor", } ], "status" "success" } error response (400/401) { "message" "invalid token or request", "status" "error" } authentication this api requires a valid jwt token for authentication ensure that the token is included in the authorization header as bearer \<jwt token> usage notes ensure that the type parameter correctly filters users (e g , user , editor , admin ) you can pass an empty keyword parameter to return all users of the specified type the request will return an error if the authorization token is invalid or missing