# Read and configure audit logs

Filter Admin Activity, System Events and Data Access audit logs, turn on Data Access logging by service, and query entries with the API.

Inspect changes, system actions and data reads across your organization or a single project. Reading audit logs and changing Data Access settings requires the **Team** or **Enterprise** plan ([Limits and quotas](/reference/limits#organization-and-access)).

- Reading **Admin Activity** and **System Events** requires Owner, Audit Log Admin, Private Log Viewer or Audit Log Viewer.
- Reading **Data Access** entries requires Owner, Audit Log Admin or Private Log Viewer.
- Changing **Data Access settings** requires Owner or Audit Log Admin.

## Read audit logs in the console [#read-audit-logs-in-the-console]

1. In your organization or project, click **Settings**, then **Audit logs**.
2. Select a tab: **Changes** (Admin Activity and System Events together), **Admin Activity**, **System Events** or **Data Access**.
3. Use the filter bar to narrow entries by person, time range, service or outcome.
4. Click an entry to inspect who made the call, what changed, the request details and any linked triggering or resulting System Events.

## Configure Data Access logging [#configure-data-access-logging]

Secret value reads, dynamic credential issuances and audit log reads are always logged. You can turn on additional Data Access logging per service and call type (`ADMIN_READ`, `DATA_READ`, `DATA_WRITE`).

1. On **Settings** › **Audit logs**, click **Data Access settings**.
2. Select the call types to record for **All services** or individual services (such as `DATA_READ` in LLM Gateway to record model invocations). In a project, boxes turned on by your organization stay locked on.
3. In an organization, optionally enter **Keep Data Access entries for (days)** (default 30, from 1 to 400).
4. Click **Save**.

:::warning
Shortening Data Access retention deletes entries older than the new window across all projects within the hour. Deleted entries can't be recovered.
:::

## Query audit logs with the API [#query-audit-logs-with-the-api]

Set your API key ([Call the API](/get-started/call-the-api)) and your organization's ID:

```sh
export KOSEM_API_KEY='kosem_sk_…'
export KOSEM_ORG='org_01m5r8w2k3e9vbt6g0d4x7qz1h'

curl -s -G "https://api.kosem.ai/v1/organizations/$KOSEM_ORG/logEntries" \
  -H "Authorization: Bearer $KOSEM_API_KEY" \
  --data-urlencode 'filter=log_type != DATA_ACCESS AND time >= "2026-11-01T00:00:00Z"' \
  --data-urlencode 'pageSize=50'
```

Filters support `id`, `cause`, `principal`, `service_name`, `method_name` and `resource_name` with `=`, `log_type` with `=` or `!=`, `status.code` with `=` or `!=`, and `time` with `>=`, `>`, `<=` or `<`. To read one project's entries, call `/v1/projects/$KOSEM_PROJECT/logEntries`.

## Related [#related]

- [Audit logs](/concepts/audit-logs)
- [Roles](/reference/roles#audit-logs)
- [Limits and quotas](/reference/limits#organization-and-access)
