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
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | 10 | Number of results per page |
| offset | integer | 0 | Number of results to skip |
| search | string | — | Search term for `id`, `username`, `mobile_number`, `email`, `first_name`, `last_name` |
| ordering | string | — | Field to order by (`id`, `username`, `email`, `gender`, `last_login`, `created_at`, `updated_at`) |
| id_min | integer | — | Minimum user ID to filter results |
| id_max | integer | — | Maximum user ID to filter results |
| created_date | string | — | Exact creation date (YYYY-MM-DD) |
| updated_date | string | — | Exact last update date (YYYY-MM-DD) |
| created_from | string | — | Users created after defined date (YYYY-MM-DD) |
| updated_from | string | — | Users last updated after defined date (YYYY-MM-DD) |
| created_to | string | — | Users created before defined date (YYYY-MM-DD) |
| updated_to | string | — | Users last updated before defined date (YYYY-MM-DD) |
| has_email | boolean | — | Filter users by having/not having an email address |
| has_avatar | boolean | — | Filter users by having/not having an avatar image |
| has_phone | boolean | — | Filter users by having/not having a mobile number |
| has_token | boolean | — | Filter users by having/not having an authentication token |
| has_first_name | boolean | — | Filter users by having/not having a first name |
| has_last_name | boolean | — | Filter users by having/not having a last name |
| is_active | boolean | — | Filter by active status |
| is_online | boolean | — | Filter by online status |
| gender | Choices | _ | Filter by gender (Male, Female, Other) |
| groups_in | integer list | — | Filter users in any of the specified group IDs (comma-separated eg: 1,4,5) |
| group_id | integer | — | Filter users who belong to a specific group ID |
| last_login_date | string | — | Exact last login date (YYYY-MM-DD) |
| last_login_from | string | — | Users who last logged in after this date (YYYY-MM-DD) |
| last_login_to | string | — | Users who last logged in before this date (YYYY-MM-DD) |
| is_profile_completed | boolean | _ | Filter users with complete/incomplete profile information |
| is_admin | boolean | — | Filter by admin status |
| is_staff | boolean | — | Filter by staff status |
| is_customer | boolean | — | Filter by customer status |
Example Requests
- 🐍 Python
- 🌐 Curl
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())1curl "http://www.example.com/api/users/?limit=5&is_active=true&ordering=username" -H "Authorization: Token XXXXXXXXXXXXXXXXXXXXXX"Response Fields
| Field | Type | Description |
|---|---|---|
| count | Integer | Total number of categories |
| next | String | URL for the next page of results |
| previous | String | URL for the previous page of results |
| results | Array[Object] | Array of User objects |
User Object Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the user (unique) |
| username | String | Username of the user (unique) |
| mobile_number | String | Mobile phone number of the user(unique, nullable) |
| String | Email address of the user(unique, nullable) | |
| is_email_verified | Boolean | Shows if the email has been verified |
| avatar | String | URL to the user's avatar image (nullable). |
| first_name | String | First name of the user(nullable) |
| last_name | String | Last name of the user(nullable) |
| full_name | String | Full name (nullable). |
| gender | String | Gender of the user.(male/female/other) |
| invited_by | Object(InvitingUser) | User who has invited current user |
| invite_code | String | Related invite code of the user (nullable) |
| invitees_count | Integer | Number of users invited by the current user(nullable) |
| is_active | Boolean | Whether user account is active. |
| is_staff | Boolean | Whether user has staff privileges. |
| is_admin | Boolean | Whether user has admin privileges. |
| is_profile_completed | Boolean | Whether user profile data are complete or not |
| last_login | String (ISO 8601) | Timestamp of last login (null for new users). |
| created_at | String (ISO 8601) | Timestamp when user was created. |
| updated_at | String (ISO 8601) | Timestamp when user was last updated. |
| is_online | Boolean | Whether user is currently online. |
| groups_data | Array[Object] | Array of group objects with detailed info. |
Group Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the group |
| name | String | Name of the group |
**Inviting User Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | The inviting user id |
| username | String | The inviting user username |
| full_name | String | Full 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)