Skip to content

List audit trail entries (paginated, filterable)

GET
/v1/audit
curl --request GET \
--url 'https://api.emite.cr/v1/audit?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>'

Newest-first. Filter by category, exact action, actor, resource (id and/or kind), environment, free-text (actor / resource label, action, metadata) and a created-at range. All filters are optional and bookmarkable. Each entry carries changedFields — the dot-paths that differ between before and after — so a client can render a diff without reimplementing one. total is counted up to a ceiling; check totalIsExact.

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.

Media typeapplication/json
object
items
required

The entries of this page, newest first.

Array<object>
object
id
required

Id of the audit entry (uuid).

string
category
required

The group the action belongs to (each action has exactly one):

  • rbac — members, invitations, custom roles, ownership transfer.
  • api_keys — the API key lifecycle.
  • credentials — changes to the Hacienda .p12 and ATV credentials (never the secret itself).
  • settings — company settings and PDF branding.
  • billing — subscription, prepaid purchases, plan and add-on changes.
  • invoices — the invoice lifecycle, from creation to Hacienda's verdict.
  • proformas — non-fiscal quotes.
  • documents — XML imports and received documents.
  • parties — the customers and suppliers catalog.
  • items — the items catalog.
  • tenant — the company profile, sandbox reset, deletion, legal acceptance, and the EmiteCR team's access to the company's data.
  • reports — report and audit exports.
  • partner — actions of a Futura Byte product that operates the company.
  • auth — account security: sign-in, password and two-factor events of the company's members.
  • platform — the platform's own operation; never part of a company's trail.
string
Allowed values: rbac api_keys credentials settings billing invoices proformas documents parties items tenant reports partner auth platform
action
required

What happened, as resource.verb (invoice.created, member.invited…). Stable values, usable in the action filter.

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
actorUserId
required

Actor user id (null for API-key/system events).

string
nullable
actorApiKeyId
required

Actor API key id (null for JWT/system events).

string
nullable
actorPartnerAppId
required

Actor partner-app id (null for JWT/API-key/system events).

string
nullable
actorRole
required

The role the actor held AT THE TIME of the action (owner, admin, a custom role slug…). Denormalized at write time: a member's role changes, and an audit row must keep saying what permissions the action was taken under.

string
nullable
actorLabel
required

Display label for the actor (user email, key:<prefix>, or EmiteCR · <name> when the EmiteCR team acted from its backoffice). Null for system events.

string
nullable
resourceType
required

Resource kind (invoice, member, …).

string
nullable
resourceId
required

Id (uuid) of the record the action was about; pass it with resourceType to get that record's whole history. Null when the action is not about one record.

string
nullable
resourceLabel
required

Human label for the resource.

string
nullable
before
required

State before the change (secret-free). Null for create events.

object
key
additional properties
any
after
required

State after the change (secret-free). Null for delete events.

object
key
additional properties
any
metadata
required

Event details plus request context (ip, userAgent, requestId). Two different natures share this object; clients should render them as separate sections.

object
key
additional properties
any
changedFields
required

Dot-paths that differ between before and after, computed at read time. null when a comparison is not meaningful (creation or deletion — only one snapshot exists); an EMPTY array means both snapshots exist and nothing changed.

Array<string>
nullable
environment
required

The environment a transactional event happened in (an invoice, an import…). Null for configuration events, which apply to both environments.

string
nullable
Allowed values: sandbox production
createdAt
required

ISO timestamp the event occurred.

string
total
required

Matching rows ignoring pagination. Counting is bounded (see totalIsExact) — an unbounded count(*) over a five-year trail runs on every page turn and is the first thing to degrade at volume.

number
totalIsExact
required

false when the count hit its ceiling: total is then the ceiling, not the truth, and the client should render it as "N+".

boolean
page
required

The page returned, 1-based.

number
pageSize
required

Rows per page applied: the requested pageSize, capped at 200.

number
Example
{
"items": [
{
"category": "rbac",
"action": "member.invited",
"changedFields": [
"enabledCurrencies",
"pdfBranding.accentColor"
],
"environment": "sandbox"
}
]
}

Missing or invalid credentials.

Plan does not include the audit module (FEATURE_NOT_IN_PLAN).

Caller lacks the audit:read scope.