Auth API reference

Auth API · App-Audit

get/v1/apps/{app_id}/audit-logs/exportAuth

Stream this app's audit log as NDJSON or CSV, applying the same `?action=` / `?actor_id=` / `?since=` / `?until=` filters as the list. Newest first. Reading the export is itself audited as `audit.exported`.

The response is streamed: rows are walked in keyset batches and written as they are read, so neither the service nor the client has to hold the whole result set. Works on both lanes — a platform bearer token and a `pcft_live_*` Platform API Key with `auth.audit.read` hit the same route. Hard cap of 1,000,000 rows per call; a wider request is refused with 413 before any body is written, so a truncated file can never masquerade as a complete one.

Path parameters

app_id*string

Id of the app.

Query parameters

formatenum (2)

Defaults to `ndjson`.

actionstring

Only entries with this action (e.g. `user.signin`).

actor_idstring

Only entries this account performed.

sincestring · date-time

Inclusive lower bound on `created_at` (ISO 8601 date or date-time).

untilstring · date-time

Inclusive upper bound on `created_at` (ISO 8601 date or date-time).

Response · 200

Streamed export. `application/x-ndjson` (one JSON object per line) or `text/csv` (RFC 4180, header row first). `Content-Disposition` names the file.

Example

Request

GET https://api.auth.productcraft.co/v1/apps/{app_id}/audit-logs/export
Authorization: Bearer YOUR_TOKEN