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

# Read audit events with the API

> List the audit events of an environment with your API key: who changed what, when, and from where. Filter by actor, target, action and date.

End Close records audit events when a person, an API key, an agent or End Close itself changes your data. Examples are a reconciliation rule that is updated (`reconciliation_rule.updated`), a manual match or write-off with its reason (`reconciliation_match.created`), and an API key that is deleted (`api_key.deleted`). Each event says who acted, what they acted on, what changed, and how the change reached End Close.

Use `GET /audit_events` to read these events into your own systems, such as a SIEM or a compliance archive.

## Prerequisites

* An [API key](https://endclose.com/docs/api-reference/authentication.md) for the environment. Agent run keys can't read audit events and get `403`.

## What the API returns

* Only the events of the API key's environment. Events that belong to the organization and not to one environment, such as changes to members and invitations, are not returned.
* Events newest first, ordered by `occurred_at` and then `id`.
* Events that never change. End Close does not edit or delete an event after it records it.

Each event has:

| Field | What it holds |
| - | - |
| `action` | What happened, as `<subject>.<verb>`, for example `reconciliation_rule.updated`. |
| `occurred_at` | When it happened, in UTC. |
| `actor` | Who acted: `type` (`user`, `api_key`, `agent` or `system`), `id` and `label`. |
| `target` | What was acted on: `type`, `id` and `label`. `null` when there is no single target. |
| `changes` | Changed attributes as `{ "attribute": [before, after] }`. Secrets and tokens are redacted. |
| `metadata` | More detail, such as the record ids of a manual match and its `adjustment_reason`. Its keys depend on the action. |
| `source` | How the change reached End Close, for example `web`, `api`, `mcp` or `job`. |
| `request_id`, `ip_address`, `user_agent` | The request that caused the change, when there was one. |

An `actor.label` and a `target.label` keep the value they had when the event was recorded. An event still reads correctly after the actor or the target is deleted. An API key's label is a masked form of its token, never the full token.

## List events

```bash cURL theme={"dark"}
curl "https://api.endclose.com/v1/audit_events?limit=100" \
  -H "X-API-Key: $ENDCLOSE_API_KEY"
```

```json theme={"dark"}
{
  "data": [
    {
      "id": "0193a1c2-7d4e-7b8a-9f10-2c3d4e5f6a7b",
      "action": "reconciliation_rule.updated",
      "occurred_at": "2026-11-05T15:02:11.482Z",
      "actor": { "type": "api_key", "id": "0192f0aa-1b2c-7d3e-8f40-5a6b7c8d9e0f", "label": "sk_live_…9f3a" },
      "target": { "type": "ReconciliationRule", "id": "0193a1b0-0c1d-7e2f-8a3b-4c5d6e7f8a9b", "label": null },
      "changes": { "priority": [3, 1] },
      "metadata": {},
      "source": "api",
      "environment_id": "0192e000-aaaa-7bbb-8ccc-dddddddddddd",
      "request_id": "4f1d2c3b-5a6e-4f70-8b9c-0d1e2f3a4b5c",
      "ip_address": "203.0.113.24",
      "user_agent": "curl/8.7.1"
    }
  ],
  "next_cursor": "MjAyNi0xMS0wNVQxNTowMjoxMS40ODIwMDBafDAxOTNhMWMy",
  "limit": 100
}
```

To read every event, pass each response's `next_cursor` back as `cursor` until `next_cursor` is `null`. Send the same filters with every page. See [Pagination](https://endclose.com/docs/api-reference/pagination.md).

## Filter events

All filters are optional query parameters. When you send more than one, an event must match all of them.

**actor\_type** `string`

`user`, `api_key`, `agent` or `system`. Any other value gets `422`.

**actor\_id** `string`

Only events by the actor with this id.

**target\_type** `string`

Only events on this kind of object, for example `Reconciliation` or `ReconciliationRule`.

**target\_id** `string`

Only events on the object with this id.

**event\_action** `string`

Only events with this action, for example `reconciliation_rule.updated`. The parameter is `event_action`, not `action`.

**from** `string`

Only events at or after this time. An ISO 8601 date-time, or a date. A date starts at 00:00:00 UTC.

**to** `string`

Only events at or before this time. An ISO 8601 date-time, or a date. A date includes the whole day in UTC.

This request returns every change made to one reconciliation in November 2026:

```bash cURL theme={"dark"}
curl "https://api.endclose.com/v1/audit_events?target_type=Reconciliation&target_id=$RECONCILIATION_ID&from=2026-11-01&to=2026-11-30" \
  -H "X-API-Key: $ENDCLOSE_API_KEY"
```

## Read one event

```bash cURL theme={"dark"}
curl "https://api.endclose.com/v1/audit_events/$AUDIT_EVENT_ID" \
  -H "X-API-Key: $ENDCLOSE_API_KEY"
```

An event of another environment gets `404`.


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