User Activity Report
GET
Get User Activity Report
Retrieve a paginated list of user and customer activity logs with optional filtering by type, user, customer, branch, log name, and date range.
GET
/reports/user-activities
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Conditional | Filter by causer type. Allowed values: user, customer. Required when using branch_id, user_id, or customer_id. |
| branch_id | integer | Conditional | Filter by branch ID (must exist and be active). Only allowed when type=user. |
| user_id | integer | Conditional | Filter by user ID (must exist). Required when type=user. Only allowed when type is user. |
| customer_id | integer | Conditional | Filter by customer ID (must exist). Required when type=customer. Only allowed when type is customer. |
| log_name | string | Optional | Filter by activity log name (e.g., auth, admin_user, product, sale, etc.) |
| from_date | string (Y-m-d) | Optional | Start date for filtering activities. Required when to_date is provided. Must be before or equal to to_date. |
| to_date | string (Y-m-d) | Optional | End date for filtering activities. Required when from_date is provided. Must be after or equal to from_date. |
| page | integer | Optional | Page number for pagination |
| per_page | integer | Optional | Number of items per page (default: 15) |
Available Log Names
The log_name parameter accepts the following values:
auth
admin_user
product
product_category
sale
purchase
customer
supplier
branch
warehouse
expense
fund_transfer
And more... See ActivityLogNameEnum for the full list.
Type Filter Behavior
The type parameter controls which causer activities are returned:
type=user
Returns only admin user activities. user_id becomes required. branch_id filter becomes available.
type=customer
Returns only customer activities. customer_id becomes required. branch_id is not allowed.
Response
200 OKStatus Code
HTTP status code (200)
Message
Human-readable description
Data
Paginated list of user activity logs