Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

List users

Admin only. Returns a page of user records, each with the name of its branch. The list is active by default, so a deactivated record needs is_active false or all.

GET/api/v1/users
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Query parameters
pageinteger

One based page number. Defaults to 1.

page_sizeinteger

Rows per page, capped at 200. Defaults to 20.

rolestring

Filter to one role, admin or pharmacist. Empty returns every role.

is_activestring

true, false, or all. Defaults to true.

Responses
200

A page of users

totalintegerrequired
min -9007199254740991 · max 9007199254740991
pageintegerrequired
min -9007199254740991 · max 9007199254740991
page_sizeintegerrequired
min -9007199254740991 · max 9007199254740991
itemsobject[]required
Show properties
Array of object
idstringrequired
branch_idstringrequired
emailstringrequired
full_namestringrequired
phonestringrequired
rolestringrequired
is_activebooleanrequired
last_login_atstring | nullrequired
created_atstringrequired
updated_atstringrequired
branch_namestring | nullrequired
401

Not authenticated

detailstringrequired
403

Caller is not an admin

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://localhost:8000/api/v1/users' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "total": -9007199254740991,
  "page": -9007199254740991,
  "page_size": -9007199254740991,
  "items": [
    {
      "id": "string",
      "branch_id": "string",
      "email": "string",
      "full_name": "string",
      "phone": "string",
      "role": "string",
      "is_active": true,
      "last_login_at": "string",
      "created_at": "string",
      "updated_at": "string",
      "branch_name": "string"
    }
  ]
}