Skip to content

Audit Log

The audit log records who did what, when and from where across your organization. Viewing it requires the Admin role: Organization > Audit.

Entries

Each entry shows the Timestamp, the Actor with its type, the Action, the Resource it acted on with its type, the Result and the IP Address.

Actor types are User, Worker, System, Job and Service. An action taken with an API key is attributed to the user who created the key, with the key's ID in the entry's details; the API Key option in the Actor Type filter matches nothing today.

Resource types cover spaces, stacks, bundles, runs, worker pools and workers, users and invitations, the organization, VCS and cloud integrations, policies, tokens and API keys, and artifacts.

What is recorded

  • Authentication: sign-in and sign-out, registration, password changes and resets, MFA enabled or disabled, sign-in verifications and admin MFA resets; sign-ins through single sign-on (auth.sso_login), an Admin's emergency sign-in while single sign-on is required (auth.sso_break_glass), and a first single sign-on that links an existing account (user.sso_linked) or creates one (user.sso_created).
  • Single sign-on settings: provider set up, changed and deleted (sso_provider.create, sso_provider.update, sso_provider.delete, never the client secret), test sign-ins (sso_provider.test, with the outcome) and Require single sign-on switched on or off (sso.require_on, sso.require_off).
  • Tokens: creation, revocation and refresh of tokens and keys.
  • Resources: create, update and delete of every managed object, with the created object's ID and name.
  • Runs: created, approved, cancelled, completed and failed.
  • Downloads, policy and approvals: download redemptions, policy evaluations and approval gates.
  • Source control: integration created, updated, deleted and verified; connector events.
  • Cloud integrations: created, updated, deleted, verified, attached to and detached from stacks.
  • State: rollbacks of Zenfra-managed state.

Filtering and paging

Filter by Actor Type, Resource Type, Action, Result (Success, Failure, Denied) and a From date / To date range. Changes to webhook endpoints are recorded with the resource type webhook_endpoint and actions such as webhook_endpoint.created and webhook_endpoint.secret_rotated; an endpoint disabled after repeated failures is recorded as webhook_endpoint.disabled by the System actor. The Action filter offers the common actions; sign-in verifications, admin MFA resets, connector events and state rollbacks are recorded but cannot be selected in the filter yet. Pages hold 25 entries by default (10, 25, 50 or 100).

Exporting

An Admin can download the audit log as a file: Export on Organization > Audit downloads the entries that match the current filters and dates, or call the API:

curl -H "Authorization: Bearer zenfra_..." -o audit-log.ndjson \
  "https://api.zenfra.cloud/api/v1/audit-logs/export?from=2026-10-01T00:00:00Z&to=2026-10-15T00:00:00Z"

The export takes the same filters as the list (actor_id, actor_type, resource_type, resource_id, action, result) and a time window:

  • from is included and to is excluded, so adjacent windows neither gap nor overlap at their shared boundary. Each export reads the log as it is when that export starts.
  • Both are optional RFC 3339 times: to defaults to now, from to 90 days before to.
  • A window covers at most 90 days; a longer one is refused with 400 and error code export_range_too_large. Export a longer history as several windows. Entries older than the retention period are already gone.

The file is NDJSON, one entry per line, oldest first, with the same fields as the list: id, timestamp, actor_type, actor_id, actor_name, action, result, resource_type, resource_id, resource_name, details, ip_address, user_agent, request_id and error_code.

The last line is a summary, not an entry:

{"export":{"version":1,"complete":true,"row_count":1234,"max_exported_id":"6ad9…","from":"2026-10-01T00:00:00Z","to":"2026-10-15T00:00:00Z","started_at":"2026-10-15T09:12:03.512Z"}}

Check it before you use the file. A file whose last line is not a summary with "complete": true is incomplete: the export stopped early or the connection broke. An incomplete summary carries an error_code, such as export_timeout. To check the summary and keep only the entries:

tail -n 1 audit-log.ndjson | jq -e '.export.version == 1 and .export.complete == true' && sed '$d' audit-log.ndjson > entries.ndjson

row_count is the number of entries in the file, and from and to are the window actually used.

The export contains the entries that existed when it started: entries recorded while it runs, and entries removed by retention while it runs, do not change it. An export stops after about four and a half minutes; if a file ends with export_timeout, narrow the window or add filters. In the dashboard, the file is assembled in the browser before it is saved, so a very large export is better done through the API.

Each export by an Admin is itself recorded in the audit log as audit_log.export. An export that started records its filters, window and number of entries; an export refused (for example a window over 90 days) or one that did not complete is recorded with a failure result and its error code.

Retention

Each organization keeps its audit log for a retention period of 1 to 365 days, 90 by default. An Admin sets it in Settings > Organization (Audit log retention (days)) or through the API (settings.audit_retention_days on PUT /api/v1/organizations/current).

Entries older than the period are deleted automatically in the background, usually within minutes of becoming due; a large first cleanup, such as after lowering the period on an organization with a long history, can take longer.

Lowering the period deletes older entries permanently: the settings page asks for confirmation first, and the change is recorded in the audit log with the old and new values. Raising it keeps entries longer from then on but does not bring back entries already deleted.