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

# List Audit Events

> See every user added, re-roled or removed in your business, who did it, and the roles before and after 🧾

## Endpoint

```json theme={null}
GET https://api.connectly.ai/external/v1/businesses/{businessId}/user_audit_events
```

| Parameter | Location | Description |
| - | - | - |
| `businessId` | Path | Your Connectly business ID. |
| `X-API-Key` | Header | A [User Management key](https://docs.connectly.ai/user-management-api/overview.md#get-an-api-key). |
| `event_types` | Query | Optional, repeatable. `USER_AUDIT_EVENT_TYPE_USER_ADDED`, `USER_AUDIT_EVENT_TYPE_USER_ROLE_CHANGED` or `USER_AUDIT_EVENT_TYPE_USER_REMOVED`. All types when omitted. |
| `from` | Query | Optional. Only events at or after this time, in RFC 3339 (`2026-12-01T00:00:00Z`). |
| `to` | Query | Optional. Only events before this time. |
| `page_size` | Query | Optional. 1 to 500, default 100. |
| `page_token` | Query | Optional. The `nextPageToken` of the previous page. |

The log covers changes made on the dashboard's Users page, including by Connectly support signed in to your business, and through this API. Changes Connectly makes with its internal admin tools are not included. The log starts on the day the API was released.

***

## Example

```bash theme={null}
curl --request GET \
  --url 'https://api.connectly.ai/external/v1/businesses/<business_id>/user_audit_events?event_types=USER_AUDIT_EVENT_TYPE_USER_ROLE_CHANGED&page_size=50' \
  --header 'X-API-Key: <YOUR_KEY_HERE>'
```

***

## Response

Events come newest first.

```json theme={null}
{
  "events": [
    {
      "id": "8812734",
      "type": "USER_AUDIT_EVENT_TYPE_USER_ROLE_CHANGED",
      "occurredAt": "2026-12-01T12:45:50Z",
      "actor": {
        "type": "AUDIT_ACTOR_TYPE_API_KEY",
        "apiKeyId": "5f0c1e2a-9b7d-4c3e-8a61-2d4f6b8e0c13",
        "apiKeyName": "HR sync"
      },
      "targetUser": { "id": "2438ac3c-37eb-4902-adef-ed16b4431030", "email": "ana@example.com" },
      "rolesBefore": ["ROLE_AGENT"],
      "rolesAfter": ["ROLE_MARKETING"]
    }
  ],
  "nextPageToken": "ODgxMjczNA"
}
```

| Field | Description |
| - | - |
| `id` | The event's ID. |
| `type` | `USER_AUDIT_EVENT_TYPE_USER_ADDED`, `USER_AUDIT_EVENT_TYPE_USER_ROLE_CHANGED` or `USER_AUDIT_EVENT_TYPE_USER_REMOVED`. |
| `occurredAt` | When the change was made. |
| `actor` | Who made it. See [Actors](#actors). |
| `targetUser` | The user the change was about: their `id` and the `email` they had at the time. |
| `rolesBefore` | The roles before the change. Empty for an add. |
| `rolesAfter` | The roles after the change. Empty for a removal. |
| `outcome` | On an add, what the add did, as in [Add a user](https://docs.connectly.ai/user-management-api/add-user.md#outcome). |

`rolesBefore` and `rolesAfter` hold the roles exactly as stored, so an older account can show more than one.

### Actors

| `actor.type` | Who | Fields |
| - | - | - |
| `AUDIT_ACTOR_TYPE_USER` | A person in the dashboard | `userId`, `email` |
| `AUDIT_ACTOR_TYPE_API_KEY` | An API key | `apiKeyId`, `apiKeyName` |
| `AUDIT_ACTOR_TYPE_CONNECTLY_STAFF` | Connectly support acting for your business | none |

***

## Paging

When `nextPageToken` is missing or empty, there are no more events. To read the whole log, call again with `page_token` set to the last `nextPageToken` until it is empty. Keep the same `event_types`, `from` and `to` on every page.

***

## Error responses

| HTTP status | Meaning |
| - | - |
| `400` | Unknown event type, `page_size` outside 1 to 500, or a `page_token` that is not one this endpoint returned. |

See [Errors](https://docs.connectly.ai/user-management-api/overview.md#errors) for the responses every endpoint can return.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.