Export the (filtered) audit trail
const url = 'https://api.emite.cr/v1/audit/export?actor=user%3A3f6b2a1c-9d4e-4f5a-8b7c-6d5e4f3a2b1c&resourceType=invoice&environment=sandbox&from=2026-01-01&to=2026-12-31&page=1&format=csv&pageSize=50';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.emite.cr/v1/audit/export?actor=user%3A3f6b2a1c-9d4e-4f5a-8b7c-6d5e4f3a2b1c&resourceType=invoice&environment=sandbox&from=2026-01-01&to=2026-12-31&page=1&format=csv&pageSize=50' \ --header 'Authorization: Bearer <token>'Honors the same filters as the list endpoint. format is csv (default), xlsx, or ndjson (one entry per line, for SIEM ingestion). Capped at 50,000 rows — when the cap is hit the response carries X-Audit-Truncated: true and the client MUST tell the user, because a silently short compliance export is worse than no export. Entries come newest first, so the cap drops the oldest: narrow from/to to fetch them. The export itself is audited (audit.exported): a tool that records data leaving the system records its own.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Filter by category. Repeat the param to include several.
Filter by exact action(s). Repeat the param to include several.
Filter to entries produced by a specific user (uuid).
Example
user:3f6b2a1c-9d4e-4f5a-8b7c-6d5e4f3a2b1cFilter to entries produced by ONE actor, any kind: user:<uuid>, key:<uuid>, partner:<uuid>, platform (anything the EmiteCR team did in the account, from its backoffice — each entry names the person in actorLabel), or system (actor-less events). Unlike actorUserId, this also covers API-key, partner and EmiteCR actors — pair with GET /v1/audit/actors to enumerate them.
Filter to entries affecting a specific resource (uuid).
Example
invoiceFilter by resource kind (invoice, item, member, …). Pair with resourceId to get the full history of one record.
Filter transactional entries by environment. Config events are env-independent (environment is null) and are EXCLUDED when this filter is set.
Free-text search, case- and accent-insensitive, up to 120 characters. An entry matches when every word (of two or more characters) appears in its actor or resource label, when every word appears in its metadata (a clave, a rejection reason…), or when the whole text appears in its action.
Example
2026-01-01Lower bound for createdAt. A bare YYYY-MM-DD is a Costa Rica calendar day (midnight CR = 06:00Z); a full ISO 8601 instant is used verbatim. Inclusive.
Example
2026-12-31Upper bound for createdAt. A bare YYYY-MM-DD covers that whole Costa Rica calendar day (up to, but excluding, midnight CR of the next day). A full ISO 8601 instant is an inclusive cut at that exact instant.
Example
11-indexed page number. Default 1.
Export serialization. csv (default) for spreadsheets, xlsx for a styled workbook, ndjson for SIEM ingestion. Ignored by the list endpoint.
Example
50Rows per page. Default 50, max 200.
Responses
Section titled “Responses”The file, named audit-log_<from>-<to> after the from/to of the request (a side not sent reads inicio), or audit-log_<YYYY-MM-DD> (the Costa Rica day of the export) without either, plus .csv, .xlsx or .ndjson. CSV and XLSX carry one row per entry with English column names (createdAt, category, action, actorLabel, actorRole, …, changedFields space-separated, before/after/metadata as JSON in beforeJson/afterJson/metadataJson); the CSV is UTF-8 with a byte-order mark and CRLF line endings. NDJSON carries one AuditLogEntryDto per line — the shape of the items of GET /v1/audit — with nothing flattened.
Examplegenerated
binaryHeaders
Section titled “Headers”attachment; filename="audit-log_….<csv|xlsx|ndjson>".
true when the 50,000-row cap cut the export short, false otherwise.
Entries written to the file.
Missing or invalid credentials.
Plan does not include the audit module (FEATURE_NOT_IN_PLAN).
Caller lacks the audit:read scope.