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

List audit entries

Admin only. Returns a page of the trail, newest first, with the user name on each row. Filters are optional and combined; search spans entity, id, action, user name, and payloads.

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

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

Query parameters
entitystring

Exact entity name, for example sales.

actionstring

Exact action name, for example update.

branch_idstring

Exact branch the entry was written against.

user_idstring

Exact user who performed the change.

searchstring

Free text matched against the entity, ids, action, user name, and payloads.

from_datestring

Oldest day to include, as YYYY-MM-DD, read with the store's day boundary.

to_datestring

Newest day to include, as YYYY-MM-DD, read with the store's day boundary.

pageinteger

One based page number. Defaults to 1.

page_sizeinteger

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

Responses
200

A page of audit entries

totalintegerrequired
min -9007199254740991 · max 9007199254740991
pageintegerrequired
min -9007199254740991 · max 9007199254740991
page_sizeintegerrequired
min -9007199254740991 · max 9007199254740991
itemsobject[]required
Show properties
Array of object
idstringrequired
user_idstringrequired
branch_idstringrequired
device_idstring | nullrequired
entitystringrequired
entity_idstring | nullrequired
actionstringrequired
before_jsonstring | nullrequired
after_jsonstring | nullrequired
ipstringrequired
created_atstringrequired
user_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/audit' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "total": -9007199254740991,
  "page": -9007199254740991,
  "page_size": -9007199254740991,
  "items": [
    {
      "id": "string",
      "user_id": "string",
      "branch_id": "string",
      "device_id": "string",
      "entity": "string",
      "entity_id": "string",
      "action": "string",
      "before_json": "string",
      "after_json": "string",
      "ip": "string",
      "created_at": "string",
      "user_name": "string"
    }
  ]
}