audit

List

The audit trail, newest first, filter-scoped by role: a platform admin sees their own tenant by default (tenant_id for another tenant, all_tenants=true for every tenant, including tenant-less platform events), tenant_admin sees only their own tenant, everyone else sees nothing (not even their own actions — use GET /me/audit-events instead). from/to accept RFC3339 or YYYY-MM-DD; a malformed bound is a 400, not a silently ignored filter. session_id matches EITHER the enforcer refresh-token family (session_id) or the upstream provider's session (external_session_id, e.g. a Privy sid), so one query finds every audit event from one login regardless of which id space logged it.

get/audit-events

Request

  • Base URL: https://api.instruxi.dev/api/v1/enforcer
  • URL: https://api.instruxi.dev/api/v1/enforcer/audit-events
  • Auth: one of:
    • API key in header Authorization
    • API key in header X-API-Key

Query parameters

actor_account_idstring

filter by actor account id

group_idstring uuid

only events whose ACTOR is a member of this group (system events, which have no actor, never match); 404 group_not_found if the group is not visible to you

exclude_group_idstring uuid

drop events whose actor is a member of this group (system events are kept); 404 group_not_found if not visible

actionstring

filter by action (e.g. person.updated)

resource_typestring

filter by resource type (e.g. person)

resource_idstring

filter by resource id

fromstring

created_at >= (RFC3339 or YYYY-MM-DD); malformed = 400

tostring

created_at <= (RFC3339 or YYYY-MM-DD); malformed = 400

sort'recent' | 'oldest'

sort order

limitinteger

page size

offsetinteger

page offset

session_idstring

one login's events — matches session_id (enforcer refresh-token family) OR external_session_id (the provider's, e.g. a Privy sid)

tenant_idstring uuid

list this tenant instead of your own (default: the caller's own tenant, platform admins included). Another tenant requires the cross_tenant grant — 403 otherwise

all_tenantsboolean

list EVERY tenant (platform-wide admin view). Requires the cross_tenant grant — 403 otherwise. Mutually exclusive with tenant_id (400 conflicting_tenant_scope)

Response

OK

limitinteger
offsetinteger
successboolean
totalinteger

Example response

{
  "success": true
}

Changes

No recorded changes to this operation across all 1 revision of this API.