Referencia de la API

Auditoría

Quién cambió qué y cuándo.

GET /v1/audit-log

Who changed what in my organization

Solo para usuarios con sesión iniciada (sin API key) · Rol: admin o superior

Append-only record of changes, newest first: the actor (a web `user` or an `api_key`), the action (`<resource>.<verb>`, for example `invitation.create`), the resource, and the snapshots `before` and `after` (null when there was none). Values of secret fields are replaced by `[redacted]` before they are stored. An `admin` or `owner` reads the log of the organization in their access token; there is no way to name another one. Filters are exact matches; `since` is inclusive and `until` exclusive, both with a time zone. Pass `next_cursor` as `cursor` to read the next page. 401 when the token is missing, expired or invalid; 403 when the caller is below `admin`; 422 for an invalid filter, cursor or limit; 503 when the log is not available.

Parámetros

NombreEnTipoRequeridoDescripción
actor_idquerystring | null
actionquerystring | null
resource_typequerystring | null
resource_idquerystring | null
sincequerystring (date-time) | null
untilquerystring (date-time) | null
limitqueryinteger
cursorquerystring | null

Respuestas

  • 200 Successful Response · AuditLogPageResponse
    NombreTipoRequeridoDescripción
    itemsAuditEntryResponse[]sí
    items[].actionstringsí
    items[].actorAuditActorResponsesí
    items[].actor.idstringsí
    items[].actor.kindstringsí`user`, `api_key`, `platform_admin` (a platform admin acting on this organization), `optimizer` or `service` (an internal service such as the orchestrator; the id is the service name). The set may grow: handle unknown values.
    items[].afterobject | nullsí
    items[].beforeobject | nullsí
    items[].idstring (uuid)sí
    items[].occurred_atstring (date-time)sí
    items[].resource_idstringsí
    items[].resource_typestringsí
    next_cursorstring | nullsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 The caller is below `admin`. · ErrorResponse
  • 422 A filter, the cursor or the limit is invalid. · ErrorResponse
  • 503 The audit log is not available. · ErrorResponse
  • default Default Response · ErrorResponse

GET /v1/audit-log/export

Export the audit log

Solo para usuarios con sesión iniciada (sin API key) · Rol: admin o superior

Every entry of the organization that matches the filters, newest first, as NDJSON: one JSON object per line, each shaped like an item of `listAuditLog`, read page by page so a large log does not sit in memory. The response is a download (`Content-Disposition`). Same access and filters as `listAuditLog`, without `limit` and `cursor`. The last line is always the trailer `{"complete": true, "count": N}`, where N is the number of entries before it. A file without the trailer, or with a different count, is cut (the status is sent before the first line, so a broken connection cannot change it): read it again. An organization may start a limited number of exports per minute. 401, 403, 422 and 503 as in `listAuditLog`; 429 when the organization exports too often (see `Retry-After`); 503 also when the rate-limit store cannot be reached.

Parámetros

NombreEnTipoRequeridoDescripción
actor_idquerystring | null
actionquerystring | null
resource_typequerystring | null
resource_idquerystring | null
sincequerystring (date-time) | null
untilquerystring (date-time) | null

Respuestas

  • 200 One audit entry per line, then the trailer line.
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 The caller is below `admin`. · ErrorResponse
  • 422 A filter, the cursor or the limit is invalid. · ErrorResponse
  • 429 Too many exports; retry later. · ErrorResponse
  • 503 The audit log or the rate-limit store is not available. · ErrorResponse
  • default Default Response · ErrorResponse