# Audit

The record of governance and access events.

API reference. Base URL: `https://api.mirabase.dev`

## Read audit events

`GET /v2/audit/events`

Governance and access events, newest first, kept for 365 days. Requires `tenant_admin` and a key without Space restrictions. Needs no capability.

**Capability** No capability is checked.

Guide: [Permissions](https://mirabase.io/developers/permissions.md#narrowing)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `cursor` | Query | `DevCursor` | Optional | The `next_cursor` of the previous page. Omit it to start from the first page. length 1..1024 |
| `limit` | Query | `integer` | Optional | How many items a page holds at most: 1 to 100, 20 by default. 1..100, default: 20 |
| `space_id` | Query | `DevSpaceRef` | Optional | Only events in this Space. `default` names your default Space, as it does in a path. length 1..256 |
| `key_id` | Query | `DevId` | Optional | Events by this key, and governance events on it: issuance, revocation, and rotation. length 1..256 |
| `actor_id` | Query | `DevId` | Optional | Only events by this principal. length 1..256 |

### Responses

- `200` `application/json`

200 response:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `DevAuditEvent[]` | Required | The items on this page. |
| `next_cursor` | `DevCursor` | Optional | Pass it as `cursor` to get the next page. Absent on the last page. |

### Error statuses

`400` `401` `403` `404` `422` `429` `500` `503` See [Errors](https://mirabase.io/developers/conventions.md#errors) for the error shape and [Error codes](https://mirabase.io/developers/errors.md) for what each code means.

### Example request

```bash
curl "https://api.mirabase.dev/v2/audit/events" \
  -H "Authorization: Bearer $MIRABASE_API_KEY"
```

### Example response

```json
{
  "data": [
    {
      "id": "<id>",
      "action": "<action>",
      "outcome": "allowed",
      "principal_id": "<principal_id>",
      "resource_kind": "<resource_kind>",
      "created_at": "2026-11-06T00:00:00Z"
    }
  ]
}
```
