PT EN

Eventos de auditoria

URL base: $BUSINESS_API

O objecto

idstring · opcional
tenant_idstring · opcional
actor_idstring · opcional
actor_typestring · opcional
actor_namestring · opcional

Display label of the actor; the person's name when known, Sistema for a system actor. Not part of the hash chain.

actionstring · opcional

Stable action code in English

resource_typestring · opcional
resource_idstring · opcional
ip_addressstring · opcional
user_agentstring · opcional
detailsobject · opcional
timestampstring (date-time) · opcional
prev_hashstring · opcional
hashstring · opcional
summarystring · opcional

Human-readable description in the reader's locale (pt-MZ by default), derived from the action and resource when read; the fallback for summary_code; not part of the hash chain

summary_codestring · opcional

Stable code clients translate as audit.<code>: the action when known, change.<resource_type>, or change

summary_paramsobject · opcional

Values for the translated summary, such as reference

O objecto
{
  "id": "aud_26gp5oQrtu49RIq9B685jyQRTCo",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "actor_id": "act_2HXCuXB4S938w5lomxpoS73e8fr",
  "actor_type": "actor type",
  "actor_name": "Ana Matsinhe",
  "action": "action",
  "resource_type": "resource type",
  "resource_id": "res_2iAXhMsJzmqPnY6X5cMTJ6OBTSG",
  "ip_address": "Av. Julius Nyerere 1420, Maputo",
  "user_agent": "user agent",
  "details": {},
  "timestamp": "2026-11-19T09:30:00Z",
  "prev_hash": "prev hash",
  "hash": "hash",
  "summary": "summary",
  "summary_code": "SUM-2026-000142",
  "summary_params": {
    "key": "value"
  }
}

Listar eventos de auditoria

Registos

GET /events

List append-only cryptographic audit events, optionally for one record

Returns the tenant's hash-chained audit events, each with a localized human-readable summary, a summary code and parameters. Filters combine (actor, exact action, resource type and ID, RFC 3339 from/to; unparseable dates are ignored) and results are cursor-paginated (default 20, maximum 100). Requires the audit:read permission.

Parâmetros

limitinteger · consulta · opcional

Maximum resources to return (default 20, maximum 100).

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

resource_typestring · consulta · opcional

Filter by resource type, e.g. customer, account, property, meter, connection, invoice, payment, ticket, work_order, incident, tariff, onboarding

resource_idstring · consulta · opcional

Filter by resource identifier, for a record page's history

actionstring · consulta · opcional

Filter by exact action code

actor_idstring · consulta · opcional

Filter by actor

fromstring · consulta · opcional

RFC3339 start

tostring · consulta · opcional

RFC3339 end

Devolve

200 Audit events, newest first

Mostrar atributos
dataarray of AuditEvent · opcional
Mostrar atributos filhos
idstring · opcional
tenant_idstring · opcional
actor_idstring · opcional
actor_typestring · opcional
actor_namestring · opcional

Display label of the actor; the person's name when known, Sistema for a system actor. Not part of the hash chain.

actionstring · opcional

Stable action code in English

resource_typestring · opcional
resource_idstring · opcional
ip_addressstring · opcional
user_agentstring · opcional
detailsobject · opcional
timestampstring (date-time) · opcional
prev_hashstring · opcional
hashstring · opcional
summarystring · opcional

Human-readable description in the reader's locale (pt-MZ by default), derived from the action and resource when read; the fallback for summary_code; not part of the hash chain

summary_codestring · opcional

Stable code clients translate as audit.<code>: the action when known, change.<resource_type>, or change

summary_paramsobject · opcional

Values for the translated summary, such as reference

has_moreboolean · opcional
next_cursorstring · opcional

Erros 403

Permissões audit:read · Funções: admin, analyst, owner

curl -X GET "$BUSINESS_API/events" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "id": "aud_26gp5oQrtu49RIq9B685jyQRTCo",
      "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
      "actor_id": "act_2HXCuXB4S938w5lomxpoS73e8fr",
      "actor_type": "actor type",
      "actor_name": "Ana Matsinhe",
      "action": "action",
      "resource_type": "resource type",
      "resource_id": "res_2iAXhMsJzmqPnY6X5cMTJ6OBTSG",
      "ip_address": "Av. Julius Nyerere 1420, Maputo",
      "user_agent": "user agent",
      "details": {},
      "timestamp": "2026-11-19T09:30:00Z",
      "prev_hash": "prev hash",
      "hash": "hash",
      "summary": "summary",
      "summary_code": "SUM-2026-000142",
      "summary_params": {
        "key": "value"
      }
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor"
}

Verificar a integridade da auditoria

Registos

GET /events/verify

Walks the tenant's entire audit chain in sequence order, checking each event's link to the previous hash and recomputing its payload hash. Always answers 200: verified is true with the event count and last hash when the chain is intact, or false with tampered_event_id and failure_reason (broken prev_hash linkage or payload hash mismatch) at the first bad event. An empty chain verifies with zero events. Requires the audit:verify permission.

Devolve

200 Ledger verification result

Erros 403

Permissões audit:verify · Funções: admin, owner

curl -X GET "$BUSINESS_API/events/verify" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200

Ledger verification result