> ## Documentation Index
> Fetch the complete documentation index at: https://docs.interstellas.stellas.africa/llms.txt
> Use this file to discover all available pages before exploring further.

# List audit logs

> Retrieve the audit trail of actions taken within your business account.

## Endpoint

```
GET /clients/business/audits
```

## Headers

<ParamField header="Authorization" type="string" required>
  `Bearer YOUR_ACCESS_TOKEN`
</ParamField>

<ParamField header="SECRET_KEY" type="string" required>
  Your API secret key.
</ParamField>

<ParamField header="businessId" type="string" required>
  Your business ID.
</ParamField>

## Query parameters

<ParamField query="page" type="integer">
  Page number. Defaults to `1`.
</ParamField>

<ParamField query="limit" type="integer">
  Records per page. Defaults to `10`.
</ParamField>

<ParamField query="role" type="string">
  Filter by the role of the user who performed the action.
</ParamField>

<ParamField query="action" type="string">
  Filter by the type of action performed, e.g. `"login"` or `"transfer"`.
</ParamField>

<ParamField query="type" type="string">
  Filter by audit event type.
</ParamField>

<ParamField query="email" type="string">
  Filter by the email address of the user who performed the action.
</ParamField>

See [Pagination](/essentials/pagination) for full usage.

## Response

<ResponseField name="status" type="boolean">
  `true` on success.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable outcome.
</ResponseField>

<ResponseField name="data" type="array">
  Array of audit log entries.
</ResponseField>

<ResponseField name="data[].id" type="string">
  Unique audit log ID.
</ResponseField>

<ResponseField name="data[].email" type="string">
  Email of the user who performed the action.
</ResponseField>

<ResponseField name="data[].user" type="string">
  Full name of the user who performed the action.
</ResponseField>

<ResponseField name="data[].action" type="string">
  Description of the action taken.
</ResponseField>

<ResponseField name="data[].type" type="string">
  Category of the event.
</ResponseField>

<ResponseField name="data[].date" type="string">
  ISO 8601 timestamp of when the action occurred.
</ResponseField>

<ResponseField name="data[].role" type="string">
  The role of the user at the time of the action.
</ResponseField>

<ResponseField name="data[].ipAddress" type="string">
  IP address from which the action was performed.
</ResponseField>

<ResponseField name="pagination" type="object">
  Standard pagination envelope. See [Pagination](/essentials/pagination).
</ResponseField>

## Code examples

<CodeGroup>
  ```bash cURL theme={null}
  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"
  ```

  ```js Node.js theme={null}
  const res = await fetch(
    "https://sandbox.stellasbank.com/api/v1/clients/business/audits?page=1&limit=10",
    {
      headers: {
        Authorization: "Bearer YOUR_ACCESS_TOKEN",
        SECRET_KEY: "YOUR_SECRET_KEY",
        businessId: "YOUR_BUSINESS_ID",
      },
    }
  );
  const { data, pagination } = await res.json();
  ```

  ```python Python theme={null}
  import requests

  res = requests.get(
      "https://sandbox.stellasbank.com/api/v1/clients/business/audits",
      headers={
          "Authorization": "Bearer YOUR_ACCESS_TOKEN",
          "SECRET_KEY": "YOUR_SECRET_KEY",
          "businessId": "YOUR_BUSINESS_ID",
      },
      params={"page": 1, "limit": 10},
  )
  print(res.json())
  ```
</CodeGroup>

## Example response

```json theme={null}
{
  "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
  }
}
```
