/v1/apps/{app_id}/audit-logs/exportAuthStream 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*stringId of the app.
Query parameters
formatenum (2)Defaults to `ndjson`.
actionstringOnly entries with this action (e.g. `user.signin`).
actor_idstringOnly entries this account performed.
sincestring · date-timeInclusive lower bound on `created_at` (ISO 8601 date or date-time).
untilstring · date-timeInclusive 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_TOKENimport { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const response = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").auditLogs.export();
const text = await response.text();auth.admin.app(…).auditLogs.export(params?, options?): Response