Skip to main content

io.enterpriseai.resources.AuditClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/AuditClient.java. Back to the Java SDK reference index.

note

This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.

Class AuditClient​

Hash chained audit trail, verification, export and correlations.

Constructor AuditClient​

AuditClient(Transport transport)

Creates the client on the shared transport; EnterpriseAIClient builds it and exposes it through the accessor of the same name.

NameTypeDefaultRequiredDescription
transportTransportyesTransport shared by the sub-clients of one client.

AuditClient.correlations​

JsonNode correlations()

Correlate events by trace, run or session. With trace_id, run_id or session_id (the first given wins), returns everything that shares that key: audit_events, LLM usage_events, runs, telemetry spans, multimodal_jobs (up to 1000 of each, 200 for runs and jobs), the trace_ids met and counts.

Route: /v1/audit/correlations (GET).

This element takes no parameter.

Returns: JsonNode. Decoded JSON answer of the operation "Correlate events by trace, run or session".

Raises: the typed errors of the transport (Errors).

AuditClient.correlations​

JsonNode correlations(Map<String, ?> query)

Correlate events by trace, run or session. With trace_id, run_id or session_id (the first given wins), returns everything that shares that key: audit_events, LLM usage_events, runs, telemetry spans, multimodal_jobs (up to 1000 of each, 200 for runs and jobs), the trace_ids met and counts.

Route: /v1/audit/correlations (GET).

NameTypeDefaultRequiredDescription
queryMap<String, ?>yesQuery string parameters of the route.

Returns: JsonNode. Decoded JSON answer of the operation "Correlate events by trace, run or session".

Raises: the typed errors of the transport (Errors).

AuditClient.event​

JsonNode event(String id)

Get an audit event. Returns one audit event with its sequence, hashes, actor, resource, decision and evidence. Needs auditor, security_officer or tenant_admin. The read is recorded in the evidence access log. Answers 404 not_found.

Route: /v1/audit/events/{event_id} (GET).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the audit event.

Returns: JsonNode. Decoded JSON answer of the operation "Get an audit event".

Raises: the typed errors of the transport (Errors).

AuditClient.events​

Page<JsonNode> events()

Search the audit events. Searches the audit events of the tenant, newest first (highest sequence first), paginated. All filters combine. Needs auditor, security_officer or tenant_admin. The search itself is recorded in the evidence access log (who, which query, how many results).

Route: /v1/audit/events (GET).

This element takes no parameter.

Returns: Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).

Raises: the typed errors of the transport (Errors).

AuditClient.events​

Page<JsonNode> events(Map<String, ?> query)

Search the audit events. Searches the audit events of the tenant, newest first (highest sequence first), paginated. All filters combine. Needs auditor, security_officer or tenant_admin. The search itself is recorded in the evidence access log (who, which query, how many results).

Route: /v1/audit/events (GET).

NameTypeDefaultRequiredDescription
queryMap<String, ?>yesQuery string parameters of the route.

Returns: Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).

Raises: the typed errors of the transport (Errors).

AuditClient.export​

JsonNode export(Object body)

Export the audit trail. Writes the events of the period (bounds included) to write once storage, as NDJSON or CSV, with a manifest. Needs auditor, security_officer or tenant_admin.

Route: /v1/audit/export (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesPeriod, retention and format of the export. An empty body exports everything as NDJSON kept 365 days.

Returns: JsonNode. Decoded JSON answer of the operation "Export the audit trail".

Raises: the typed errors of the transport (Errors).

AuditClient.export​

JsonNode export(Object body, RequestOptions options)

Export the audit trail. Writes the events of the period (bounds included) to write once storage, as NDJSON or CSV, with a manifest. Needs auditor, security_officer or tenant_admin.

Route: /v1/audit/export (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesPeriod, retention and format of the export. An empty body exports everything as NDJSON kept 365 days.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Export the audit trail".

Raises: the typed errors of the transport (Errors).

AuditClient.record​

JsonNode record(Object body)

Record an application audit event. Appends an application event to the tenant hash chain. The actor comes from the authentication; the sequence, the hashes and occurred_at from the server; the client details are kept under evidence.details.attributes, next to stream: sdk. The event is sealed and exported to the outbox and the SIEM like the platform events.

Route: /v1/audit/events (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesThe application event. Fields other than those of the schema are refused.

Returns: JsonNode. Decoded JSON answer of the operation "Record an application audit event".

Raises: the typed errors of the transport (Errors).

AuditClient.record​

JsonNode record(Object body, RequestOptions options)

Record an application audit event. Appends an application event to the tenant hash chain. The actor comes from the authentication; the sequence, the hashes and occurred_at from the server; the client details are kept under evidence.details.attributes, next to stream: sdk. The event is sealed and exported to the outbox and the SIEM like the platform events.

Route: /v1/audit/events (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesThe application event. Fields other than those of the schema are refused.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Record an application audit event".

Raises: the typed errors of the transport (Errors).

AuditClient.verify​

JsonNode verify()

Verify the audit chain. Recomputes the hash chain of the tenant from the first event and returns tenant_id, valid, count, last_hash, broken_at, reason and verified_at. When the chain is broken, broken_at is the sequence of the first faulty event and reason says why: sequence gap, prev_hash mismatch or hash mismatch. Needs auditor, security_officer or tenant_admin. The verification is recorded in the evidence access log.

Route: /v1/audit/verify (GET).

This element takes no parameter.

Returns: JsonNode. Decoded JSON answer of the operation "Verify the audit chain".

Raises: the typed errors of the transport (Errors).