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

# List vault audit events

Every access and change, allowed or denied, newest first. Never contains a value.

`GET https://api.akua.dev/v1/vaults/{vault}/audit_events`

## Authorizations

- `Authorization: Bearer <token>` (BearerAuth): Bearer token for the authenticated caller.

## Headers

- `akua-context` (string): Optional workspace/scope context for the request. Carries a single workspace wire id (`ws_…`) today. Only needed for broad tokens - a workspace-owned token implies its workspace. Required string length: `1 - 53`. Example: `"ws_j572abc123def4"`.

## Path Parameters

- `vault` (string, required): A vault id chosen by its creator, unique in the Workspace. `default` is the Workspace vault. Pattern: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. Example: `"default"`.

## Query Parameters

- `cursor` (string): Maximum string length: `512`.
- `limit` (integer): Required range: `1 <= x <= 100`.

## Response

### 200: VaultAuditEventList

`application/json`: `VaultAuditEventList`

- `data` (object[], required): Maximum array length: `100 elements`.
  - `sequence` (integer, required)
  - `time` (integer, required): Unix timestamp (seconds). Required range: `x >= 0`.
  - `method` (string, required): Maximum string length: `64`. Example: `"AccessSecretVersion"`.
  - `resource` (string, required): Maximum string length: `256`.
  - `principal` (string, required): A person (`user:<id>`), service agent (`service:<name>`), workload (`workload:<pool>/<id>`) or workforce identity (`workforce:<pool>/<subject>`). Pattern: `^(user:[^\s]{1,64}|service:[a-z][a-z0-9-]{0,62}|(?:workload|workforce):[a-z][a-z0-9-]{0,62}\/[A-Za-z0-9_-]{1,128})$`. Example: `"user:usr_j572abc"`.
  - `act` (object)
    - `sub` (string, required)
      - Any of:
        - `Principal`
          - Any of:
            - `Option 1`
            - `Option 2`
            - `Option 3`
        - `Option 2`
    - `act` (object)
      - `sub` (string, required)
        - Any of:
          - `Principal`
            - Any of:
              - `Option 1`
              - `Option 2`
              - `Option 3`
          - `Option 2`
      - `act` (object)
        - `sub` (string, required)
          - Any of:
            - `Principal`
              - Any of:
                - `Option 1`
                - `Option 2`
                - `Option 3`
            - `Option 2`
        - `act` (object)
          - `sub` (string, required)
            - Any of:
              - `Principal`
                - Any of:
                  - `Option 1`
                  - `Option 2`
                  - `Option 3`
              - `Option 2`
  - `execution` (object)
    - `session_id` (string, required): Required string length: `1 - 256`.
    - `agent` (string): Required string length: `1 - 256`.
  - `via` (string, required): The service or workload that presented the call. Maximum string length: `200`.
  - `decision` (enum<string>, required): Available options: `"ALLOWED"`, `"DENIED"`.
  - `reason` (string | null, required): Maximum string length: `128`.
- `has_more` (boolean, required)
- `next_cursor` (string | null, required): Maximum string length: `512`.

### 400: The request is malformed.

`application/json`: `ApiBadRequest`

- `_tag` (enum<string>, required): Available options: `"Validation"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 401: Missing, invalid or expired credential.

`application/json`: `ApiUnauthorized`

- `_tag` (enum<string>, required): Available options: `"Unauthorized"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 403: The credential may not act in this workspace.

`application/json`: `ApiForbidden`

- `_tag` (enum<string>, required): Available options: `"Forbidden"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 404: The resource was not found in this workspace.

`application/json`: `ApiNotFound`

- `_tag` (enum<string>, required): Available options: `"NotFound"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

### 503: The service is temporarily unavailable.

`application/json`: `ApiServiceUnavailable`

- `_tag` (enum<string>, required): Available options: `"ServiceUnavailable"`.
- `success` (enum<boolean>, required): Available options: `false`.
- `errors` (object[], required): Minimum array length: `1 element`.
  - `code` (integer, required): Machine-readable error code. Required range: `-9007199254740991 <= x <= 9007199254740991`. Example: `7002`.
  - `message` (string, required): Human-readable error message. Example: `"Resource not found"`.
  - `path` (string[]): Field path that caused the error, when applicable. Example: `["body","name"]`.
  - `metadata` (record<string, string>)
- `result` (object, required)

## Example request

```bash
curl --request GET \
  --url 'https://api.akua.dev/v1/vaults/default/audit_events' \
  --header 'Authorization: Bearer <token>'
```

## Example response

`200` `application/json`

```json
{
  "data": [
    {
      "sequence": 123,
      "time": 123,
      "method": "AccessSecretVersion",
      "resource": "<string>",
      "principal": "user:usr_j572abc",
      "act": {
        "sub": "<string>",
        "act": {
          "sub": "<string>",
          "act": {
            "sub": "<string>",
            "act": {
              "sub": "<string>"
            }
          }
        }
      },
      "execution": {
        "session_id": "ags_j572abc123def456",
        "agent": "<string>"
      },
      "via": "<string>",
      "decision": "ALLOWED",
      "reason": "<string>"
    }
  ],
  "has_more": true,
  "next_cursor": "<string>"
}
```
