52bf0279Scoped audit events#
| Property | Value |
|---|---|
| Service | crossfire |
| Operation | audit |
| Method | GET |
| Path | /api/audit-events |
| Authentication | human |
| Success status | 200 |
| Response data | Paginated collection |
| Request format | json |
| Maximum request body | 2097152 bytes (service default) |
| Permission codes | audit.read.owned, audit.read.any |
Listed permission codes are alternatives, not token scopes. The service also checks access to the requested records and rejects stale revisions or controller generations.
Path parameters#
empty object; unknown fields rejected
Validation#
check.emptyReferenced definitions:
Query parameters#
custom validation:
scoped
; see function below
Accepted query parameters: ownerId.
Query parameters are URL text. The validation function below specifies their format, defaults and combinations. Pagination applies only to operations that use it.
Additional checks#
The following checks apply in addition to the field limits.
Constraint on value:
export function scoped(input: unknown) {
const parsed = checked(input, ['ownerId']);
if (!parsed.ok)
return parsed;
const bounds = pagination(parsed.value);
if (!bounds.ok)
return bounds;
const ownerId = parsed.value.get('ownerId');
if (ownerId === null)
return success(bounds.value);
const valid = check.identifier(ownerId);
return valid.ok ? success({ ...bounds.value, ownerId }) : valid;
}Validation#
query.scopedReferenced definitions:
Request body#
empty object; unknown fields rejected
Validation#
check.emptyReferenced definitions:
Response data#
array; 0–100 entries; item: object; fields below; unknown fields rejected (
audit
)
| Field path | Representation and constraints |
|---|---|
[].auditId | lowercase opaque UUID |
[].requestId | string; 1–255 UTF-16 units; well-formed Unicode; no C0/DEL controls |
[].actorCredentialId | lowercase opaque UUID; JSON null permitted |
[].actorKind | human or agent or controller or system or anonymous |
[].actor | object; fields below; unknown fields rejected (
principal
); JSON null permitted |
[].actor.principalId | lowercase opaque UUID |
[].actor.matrixUserId | well-formed Matrix user ID; maximum 255 UTF-16 units |
[].actor.kind | human or agent |
[].actor.displayName | string; 1–255 UTF-16 units; well-formed Unicode; no C0/DEL controls |
[].actor.ownerId | lowercase opaque UUID |
[].actor.ownerMatrixId | well-formed Matrix user ID; maximum 255 UTF-16 units |
[].target | object; fields below; unknown fields rejected (
principal
); JSON null permitted |
[].target.principalId | lowercase opaque UUID |
[].target.matrixUserId | well-formed Matrix user ID; maximum 255 UTF-16 units |
[].target.kind | human or agent |
[].target.displayName | string; 1–255 UTF-16 units; well-formed Unicode; no C0/DEL controls |
[].target.ownerId | lowercase opaque UUID |
[].target.ownerMatrixId | well-formed Matrix user ID; maximum 255 UTF-16 units |
[].actorPrincipalId | lowercase opaque UUID; JSON null permitted |
[].ownerId | lowercase opaque UUID; JSON null permitted |
[].targetKind | string; 1–100 UTF-16 units; well-formed Unicode; no C0/DEL controls |
[].targetId | string; 1–255 UTF-16 units; well-formed Unicode; no C0/DEL controls |
[].roomId | immutable Matrix room ID; maximum 255 UTF-16 units; JSON null permitted |
[].membershipGeneration | lowercase opaque UUID; JSON null permitted |
[].authorizerId | lowercase opaque UUID; JSON null permitted |
[].addedById | lowercase opaque UUID; JSON null permitted |
[].permissionCode | string; 1–100 UTF-16 units; well-formed Unicode; no C0/DEL controls; JSON null permitted |
[].action | string; 1–100 UTF-16 units; well-formed Unicode; no C0/DEL controls |
[].outcome | string; 1–100 UTF-16 units; well-formed Unicode; no C0/DEL controls |
[].message | string; 0–4096 UTF-16 units; well-formed Unicode; no C0/DEL controls |
[].createdAt | exact JSON integer; 0…9007199254740991 |
Validation#
check.list(res.audit, 100)Referenced definitions:
Response envelope#
A successful JSON response contains data and meta. Replace the data placeholder below with the response fields described above. Errors contain error instead of data.
{
"data": "<value matching the response-data validator>",
"meta": {
"requestId": "00000000-0000-0000-0000-000000000001",
"page": 1,
"pageSize": 20,
"totalItems": 0,
"totalPages": 1
}
}