Skip to content

Export the (filtered) audit trail

GET
/v1/audit/export
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.

category
Array<string>
Allowed values: rbac api_keys credentials settings billing invoices proformas documents parties items tenant reports partner auth platform

Filter by category. Repeat the param to include several.

action
Array<string>
Allowed values: member.invited member.invitation_accepted member.invitation_revoked member.role_updated member.removed member.sessions_revoked member.ownership_transferred role.created role.updated role.deleted api_key.created api_key.revoked api_key.rotated credentials.uploaded credentials.replaced credentials.deleted credentials.rejected credentials.restored settings.updated security_policy.updated fiscal_profile.updated fiscal_obligation.updated whatsapp.linked whatsapp.unlinked branch.created branch.updated branch.deleted terminal.created terminal.updated terminal.deleted sequence.adjusted webhook_endpoint.created webhook_endpoint.deleted webhook_endpoint.disabled webhook_endpoint.paused webhook_endpoint.resumed webhook_endpoint.secret_rotated email_attachment.added email_attachment.removed email_attachment.updated subscription.created subscription.plan_changed subscription.canceled subscription.reactivated prepaid.purchased prepaid_lot.revoked prepaid_lot.granted audit_addon.toggled overage.toggled whatsapp_addon.toggled usage.charged refund.recorded billing_review.resolved plan_quote.created plan_quote.sent plan_quote.withdrawn plan_quote.expired plan_quote.accepted plan_quote.superseded plan_quote.ended plan_quote.schedule_dropped plan_quote.commitment_released plan_request.created plan_request.quoted plan_request.declined plan_request.withdrawn invoice.created invoice.signed invoice.submitted invoice.accepted invoice.rejected invoice.attachment_added invoice.attachment_removed invoice.attachment_updated invoice.schedule_send invoice.schedule_canceled invoice.downloaded invoice.exported recurring_schedule.created recurring_schedule.updated recurring_schedule.toggled recurring_schedule.deleted proforma.created proforma.updated proforma.deleted proforma.converted proforma.exported documents.imported received_document.accepted received_document.partially_accepted received_document.rejected party.created party.updated party.deleted parties.imported item.created item.updated item.deleted items.imported tenant.updated tenant.logo_updated tenant.logo_deleted tenant.sandbox_reset tenant.accessed legal.accepted legal.acceptance_requested identification_claim.opened identification_claim.contested identification_claim.released identification_claim.closed tenant.closure_scheduled tenant.closure_canceled tenant.closed tenant.reopened report.exported audit.exported partner.tenant_provisioned partner.api_key_created partner.api_key_revoked partner.credentials_updated partner.config_updated partner.access_granted partner.webhook_endpoint_created partner.webhook_endpoint_deleted partner.webhook_endpoint_disabled partner.webhook_endpoint_paused partner.webhook_endpoint_resumed partner.webhook_endpoint_secret_rotated partner.production_enabled partner.limits_changed partner.tenant_detached partner.tenant_released auth.login auth.login_failed auth.logout auth.sessions_revoked auth.password_changed auth.password_reset_requested auth.password_reset_completed auth.email_verified auth.totp_enabled auth.totp_replaced auth.email_otp_enabled auth.two_factor_disabled auth.recovery_codes_regenerated auth.recovery_code_used auth.mfa_challenge_locked auth.two_factor_reset platform_operator.created platform_operator.role_changed platform_operator.disabled platform_operator.reactivated platform_operator.session_started platform_operator.invited platform_operator.invitation_revoked platform_operator.onboarded platform_operator.email_changed platform_operator.access_recovery_requested platform_operator.access_recovery_approved platform_operator.access_recovery_rejected platform_operator.access_recovery_locked platform_operator.access_recovery_completed feedback_form.published feedback_prompt.settings_changed account.closure_scheduled account.closure_canceled account.closed

Filter by exact action(s). Repeat the param to include several.

actorUserId
string

Filter to entries produced by a specific user (uuid).

actor
string
Example
user:3f6b2a1c-9d4e-4f5a-8b7c-6d5e4f3a2b1c

Filter 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.

resourceId
string

Filter to entries affecting a specific resource (uuid).

resourceType
string
Example
invoice

Filter by resource kind (invoice, item, member, …). Pair with resourceId to get the full history of one record.

environment
string
Allowed values: sandbox production

Filter transactional entries by environment. Config events are env-independent (environment is null) and are EXCLUDED when this filter is set.

q
string

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.

from
string
Example
2026-01-01

Lower 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.

to
string
Example
2026-12-31

Upper 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.

page
number
Example
1

1-indexed page number. Default 1.

format
string
Allowed values: csv xlsx ndjson

Export serialization. csv (default) for spreadsheets, xlsx for a styled workbook, ndjson for SIEM ingestion. Ignored by the list endpoint.

pageSize
number
Example
50

Rows per page. Default 50, max 200.

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.

string format: binary
Content-Disposition
string

attachment; filename="audit-log_….<csv|xlsx|ndjson>".

X-Audit-Truncated
string
Allowed values: true false

true when the 50,000-row cap cut the export short, false otherwise.

X-Audit-Row-Count
integer

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.