Skip to content

Get All Users

Get a paginated list of all users. Requires authentication.

Endpoint

GET /v1/accounts/user/

Authentication

Required

Query Parameters

Parameter Type Required Description
page integer Yes Page number (starts at 1)
count integer Yes Items per page (max 100)
search string No Search by email, phone, or full name (case-insensitive)
role string No Filter by role (1 user, 2 admin, 3 store)
is_active boolean No Filter by activation status (true / false)

Response

Success (200 OK)

{
  "count": 50,
  "data": [
    {
      "id": 1,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john.doe@example.com",
      "phone": "+994501234567",
      "profile_photo": "",
      "preferred_language": "AZERBAIJANI",
      "role": "1",
      "created": "2025-01-15T10:30:00Z"
    }
  ]
}

Error Responses

Unauthorized (401)

{
  "error": "Missing token on header!"
}

Pagination Error (400)

{
  "error": "page cannot be zero or minus"
}

Example Request

curl -X GET "https://api.luxmart.site/v1/accounts/user/?page=1&count=20&search=john&role=1&is_active=true" \
  -H "Authorization: Token your_access_token"

Notes

  • Only returns non-deleted users
  • Search matches against email, phone, or full name (first_name + last_name)
  • Optional filters: role (1 user, 2 admin, 3 store), is_active (true / false)
  • Results are ordered by ID descending (newest first)