Skip to main content

List All Users

Retrieve a list of admin and staff users with optional filtering, searching, and pagination.

HTTP Request

GET/api/users/
NOTE: NOT USING THE TRAILING SLASH AT THE END OF THE URL RESULTS TO AN EXTRA REDIRECT WITH 301 STATUS

Authorization

Authorization

  • Required: Yes
  • Permission: Staff with UserPermission or Admin
  • Permission Code: 1222
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Query Parameters

ParameterTypeDefaultDescription
limitinteger10Number of results per page
offsetinteger0Number of results to skip
searchstringSearch term for `id`, `username`, `mobile_number`, `email`, `first_name`, `last_name`
orderingstringField to order by (`id`, `username`, `email`, `gender`, `last_login`, `created_at`, `updated_at`)
id_minintegerMinimum user ID to filter results
id_maxintegerMaximum user ID to filter results
created_datestringExact creation date (YYYY-MM-DD)
updated_datestringExact last update date (YYYY-MM-DD)
created_fromstringUsers created after defined date (YYYY-MM-DD)
updated_fromstringUsers last updated after defined date (YYYY-MM-DD)
created_tostringUsers created before defined date (YYYY-MM-DD)
updated_tostringUsers last updated before defined date (YYYY-MM-DD)
has_emailbooleanFilter users by having/not having an email address
has_avatarbooleanFilter users by having/not having an avatar image
has_phonebooleanFilter users by having/not having a mobile number
has_tokenbooleanFilter users by having/not having an authentication token
has_first_namebooleanFilter users by having/not having a first name
has_last_namebooleanFilter users by having/not having a last name
is_activebooleanFilter by active status
is_onlinebooleanFilter by online status
genderChoices_Filter by gender (Male, Female, Other)
groups_ininteger listFilter users in any of the specified group IDs (comma-separated eg: 1,4,5)
group_idintegerFilter users who belong to a specific group ID
last_login_datestringExact last login date (YYYY-MM-DD)
last_login_fromstringUsers who last logged in after this date (YYYY-MM-DD)
last_login_tostringUsers who last logged in before this date (YYYY-MM-DD)
is_profile_completedboolean_Filter users with complete/incomplete profile information
is_adminbooleanFilter by admin status
is_staffbooleanFilter by staff status
is_customerbooleanFilter by customer status

Example Requests

1import requests
2
3api = requests.Session()
4api.headers.update({'Authorization': 'Token f4e75eab6e0f663a972d145478d6fc4b81762070'})
5response = api.get('http://www.example.com/api/users/', params={
6  'limit': 5,
7  'is_active': True,
8  'ordering': 'username'
9})
10print(response.json())

Response Fields

FieldTypeDescription
countIntegerTotal number of categories
nextStringURL for the next page of results
previousStringURL for the previous page of results
resultsArray[Object]Array of User objects

User Object Structure

FieldTypeDescription
idIntegerUnique ID of the user (unique)
usernameStringUsername of the user (unique)
mobile_numberStringMobile phone number of the user(unique, nullable)
emailStringEmail address of the user(unique, nullable)
is_email_verifiedBooleanShows if the email has been verified
avatarStringURL to the user's avatar image (nullable).
first_nameStringFirst name of the user(nullable)
last_nameStringLast name of the user(nullable)
full_nameStringFull name (nullable).
genderStringGender of the user.(male/female/other)
invited_byObject(InvitingUser)User who has invited current user
invite_codeStringRelated invite code of the user (nullable)
invitees_countIntegerNumber of users invited by the current user(nullable)
is_activeBooleanWhether user account is active.
is_staffBooleanWhether user has staff privileges.
is_adminBooleanWhether user has admin privileges.
is_profile_completedBooleanWhether user profile data are complete or not
last_loginString (ISO 8601)Timestamp of last login (null for new users).
created_atString (ISO 8601)Timestamp when user was created.
updated_atString (ISO 8601)Timestamp when user was last updated.
is_onlineBooleanWhether user is currently online.
groups_dataArray[Object]Array of group objects with detailed info.

Group Data Structure

FieldTypeDescription
idIntegerUnique ID of the group
nameStringName of the group

**Inviting User Structure

FieldTypeDescription
idIntegerThe inviting user id
usernameStringThe inviting user username
full_nameStringFull name of the inviting user

Example Response

{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 2,
"username": "moratti120",
"mobile_number": "09150207212",
"email": "masimo@intermilan.com",
"is_email_verified": false,
"avatar": null,
"first_name": "masimo",
"last_name": "moratti",
"full_name": "masimo moratti",
"gender": "male",
"invited_by": {
"id": 1,
"username": "keegan2255",
"full_name": "kevin keegan"
},
"invite_code": null,
"invitees_count": 0,
"is_active": true,
"is_staff": true,
"is_admin": false,
"is_online": true,
"is_profile_completed": true,
"last_login": "2026-02-21T07:20:25.338627Z",
"created_at": "2026-02-21T07:20:25.859632Z",
"updated_at": "2026-02-21T07:20:25.859657Z"
},
{
"id": 1,
"username": "keegan2255",
"mobile_number": "09150207211",
"email": "kevin@arsenal.com",
"is_email_verified": true,
"avatar": null,
"first_name": "kevin",
"last_name": "keegan",
"full_name": "kevin keegan",
"gender": "male",
"invited_by": null,
"invite_code": "egiZXBO",
"invitees_count": 1,
"is_active": true,
"is_staff": false,
"is_admin": true,
"is_online": false,
"is_profile_completed": true,
"last_login": "2026-02-21T07:13:37.888614Z",
"created_at": "2026-02-21T07:03:21.109234Z",
"updated_at": "2026-02-21T07:03:53.350540Z"
}
]
}

Notes

  • only staff/admin users are displayed in this endpoint (no customer user)