# List Audit Events

See what your company's API keys changed, and what they were refused. Filter with apiKeyId.

`GET https://connect.mindcloud.co/v2/audit-events`

Permissions: `api_key:manage`.

## Parameters

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. Here a key acts in another organization only as one of its members: with "Use this key across all of your organizations" on, in an organization its creator belongs to with a role. Child organizations and MindCloud staff access do not reach this endpoint. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

## Example request

```bash
curl --request GET \
  --url 'https://connect.mindcloud.co/v2/audit-events' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN'
```

## Response fields

- `id` (string): Unique id of the entry.
- `createdOn` (date): When the request was made.
- `requestId` (string): The request id, as the response carried it.
- `actor` (object): Who made it: one of your company's API keys (with the user it acts as), one of your members through their own key from another organization ("Use this key across all of your organizations"; the key is not shown), your parent organization (its key is not shown), or MindCloud support (not shown).
  - `type` (string): api_key, member, parent_organization, or mindcloud_admin.
    Allowed values:
      - `api_key`
      - `member`
      - `parent_organization`
      - `mindcloud_admin`
  - `apiKeyId` (string): For api_key: the key.
  - `userId` (string): For api_key and member: the user the key acts as.
  - `companyId` (string): For parent_organization: the parent organization.
- `apiKeyId` (string): The company's own API key that made it. Empty for a key of another organization: a member's, a parent organization's, or MindCloud's.
- `endpointName` (string): The endpoint, such as v2-update-member.
- `method` (string): POST, PUT, PATCH, or DELETE.
  Allowed values:
    - `POST`
    - `PUT`
    - `PATCH`
    - `DELETE`
- `route` (string): The route, such as /v2/members/:userId.
- `path` (string): The path called.
- `resourceId` (string): The id of the resource it acted on, when there is one.
- `statusCode` (number): The HTTP status it answered. 0 while a write to another company waits for its handler.
- `errorCode` (string): The error code, when it was refused or failed.
- `errorReason` (string): The error's details.reason.
- `durationMs` (number): How long it took, in milliseconds.
