Skip to main content

Endpoint

GET /clients/business/audits

Headers

Authorization
string
required
Bearer YOUR_ACCESS_TOKEN
SECRET_KEY
string
required
Your API secret key.
businessId
string
required
Your business ID.

Query parameters

page
integer
Page number. Defaults to 1.
limit
integer
Records per page. Defaults to 10.
role
string
Filter by the role of the user who performed the action.
action
string
Filter by the type of action performed, e.g. "login" or "transfer".
type
string
Filter by audit event type.
email
string
Filter by the email address of the user who performed the action.
See Pagination for full usage.

Response

status
boolean
true on success.
message
string
Human-readable outcome.
data
array
Array of audit log entries.
data[].id
string
Unique audit log ID.
data[].email
string
Email of the user who performed the action.
data[].user
string
Full name of the user who performed the action.
data[].action
string
Description of the action taken.
data[].type
string
Category of the event.
data[].date
string
ISO 8601 timestamp of when the action occurred.
data[].role
string
The role of the user at the time of the action.
data[].ipAddress
string
IP address from which the action was performed.
pagination
object
Standard pagination envelope. See Pagination.

Code examples

curl -X GET "https://sandbox.stellasbank.com/api/v1/clients/business/audits?page=1&limit=10" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "SECRET_KEY: YOUR_SECRET_KEY" \
  -H "businessId: YOUR_BUSINESS_ID"

Example response

{
  "status": true,
  "message": "Audit logs retrieved successfully",
  "data": [
    {
      "id": "audit_001",
      "email": "ada@example.com",
      "user": "Ada Lovelace",
      "action": "Initiated a transfer of ₦1,100",
      "type": "transaction",
      "date": "2024-06-09T14:22:00.000Z",
      "role": "Admin",
      "ipAddress": "102.89.23.44"
    }
  ],
  "pagination": {
    "totalCount": 200,
    "hasNextPage": true,
    "hasPreviousPage": false,
    "nextPage": 2,
    "previousPage": 0,
    "limit": 10,
    "lastPage": 20
  }
}