Skip to main content
Driftstack DRIFTSTACK

Audit log

Driftstack writes an immutable audit entry for every meaningful account mutation — API key mints, session lifecycle, profile changes, team membership events, MFA changes, billing, more. This page covers what's captured, how to query it, and how long entries are kept.

Endpoint

GET /v1/account/audit-log
Authorization: Bearer ds_live_…

The endpoint is reachable with any authenticated key — there is no per-scope gate on read. Each caller sees only their own account's entries (or the team owner's entries when the call passes X-Driftstack-Account; see Team RBAC below). For a CSV / JSON dump of the whole window, use GET /v1/account/audit-log/export?format=csv (10,000-row ceiling, signalled by x-driftstack-export-truncated on the response).

Response envelope

{
  "data": [
    {
      "id": "b1a2c3d4-…-uuid",
      "account_id": "acc_…",
      "actor_type": "customer",
      "actor_account_id": "acc_…",
      "actor_key_id": "key_…",
      "action": "api_key.minted",
      "target_resource_id": "api_key_key_…",
      "payload": { "name": "ci-bot", "scopes": ["read"] },
      "ip_address": "203.0.113.42",
      "user_agent": "DriftstackCLI/2.3.1",
      "timestamp": "2026-05-11T13:42:00.000Z"
    }
  ],
  "next_cursor": null
}

Entry ids are raw UUIDs (no aud_ prefix). The response envelope uses data and next_cursor — there is no items field.

Actions captured

A non-exhaustive list of the actions you'll see (the canonical set is enforced server-side):

Actor types

The actor_type field is one of:

Filters

All filters compose; combine freely with pagination cursors.

GET /v1/account/audit-log?action=api_key.minted&from=2026-05-01Z&to=2026-05-31Z
Authorization: Bearer ds_live_…

Pagination

Standard cursor pagination — see /docs/pagination. Sort order is timestamp DESC with id DESC tiebreaker, so newest entries appear first.

Team RBAC: whose audit log do I see?

When a team member calls GET /v1/account/audit-log with the X-Driftstack-Account: acc_<owner-uuid> header, the server returns the owner's audit log — both member and admin team roles are read-allowed on this surface ( effectiveAccountId behaviour). Without the header, callers see their own account's entries.

The same effective-account header gate applies to /v1/account/audit-log/export.

Retention

TierAudit-log retention
Free30 days
Solo / API Starter90 days
Team / API Builder1 year
Agency / API Scale3 years
EnterpriseCustom (default 7 years for compliance)

Past the retention window, entries are pruned by a nightly sweep. For longer retention, export via the API regularly and store copies on your side — most enterprise customers ship a daily cron that calls the endpoint with from=yesterday&to=today and forwards the response into their SIEM.

Immutability

Audit entries are append-only. There's no delete or update endpoint; even staff cannot mutate existing entries. If a correction is needed (e.g. a misattributed action), staff append an admin.support_note pointing at the original entry rather than editing it.

Webhook subscriptions for audit events

The audit log itself does not emit a per-entry webhook event — that would create a feedback loop (writing a webhook delivery would itself generate an audit entry). Subscribe to the underlying resource webhooks instead (api_key.revoked, session.completed, etc.) — see /docs/webhooks.

Support

Compliance / audit-export questions: [email protected]. Technical questions about the endpoint: [email protected].