Skip to main content
Exports the audit log as a CSV file, with the same filters as List Audit Log Entries (cursor and limit do not apply). Dates are written in America/Mexico_City time, and actions use their plain-Spanish label (for example Timbró CFDI) instead of the internal code. Exporting the log is itself recorded in the log (audit_log.exported).
Limit: up to 50,000 rows per export. If the filters match more, the endpoint returns 422 with code AUDIT_EXPORT_TOO_LARGE and no file; narrow the date range or add filters and try again.

Authentication

Accepts either:
  • An API key (X-API-Key: sk_...) with the read:audit-logs scope.
  • A Supabase Bearer session (Authorization: Bearer <token>) with the X-Organization-Id: <org-id> header — the user must be an owner or admin of that organization.

Example Request

With the CLI:

Common Errors

400 Bad Request

Invalid date or filter value.

403 Forbidden

Not an owner or admin, or the API key lacks the read:audit-logs scope.

422 Unprocessable Entity

AUDIT_EXPORT_TOO_LARGE: more than 50,000 entries match.