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
| Nombre | En | Tipo | Requerido | Descripción |
|---|---|---|---|---|
actor_id | query | string | null | ||
action | query | string | null | ||
resource_type | query | string | null | ||
resource_id | query | string | null | ||
since | query | string (date-time) | null | ||
until | query | string (date-time) | null | ||
limit | query | integer | ||
cursor | query | string | null |
Respuestas
200Successful Response · AuditLogPageResponseNombre Tipo Requerido Descripció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í 401Missing, expired or invalid token. · ErrorResponse403The caller is below `admin`. · ErrorResponse422A filter, the cursor or the limit is invalid. · ErrorResponse503The audit log is not available. · ErrorResponsedefaultDefault 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
| Nombre | En | Tipo | Requerido | Descripción |
|---|---|---|---|---|
actor_id | query | string | null | ||
action | query | string | null | ||
resource_type | query | string | null | ||
resource_id | query | string | null | ||
since | query | string (date-time) | null | ||
until | query | string (date-time) | null |
Respuestas
200One audit entry per line, then the trailer line.401Missing, expired or invalid token. · ErrorResponse403The caller is below `admin`. · ErrorResponse422A filter, the cursor or the limit is invalid. · ErrorResponse429Too many exports; retry later. · ErrorResponse503The audit log or the rate-limit store is not available. · ErrorResponsedefaultDefault Response · ErrorResponse