Skip to main content

io.enterpriseai.resources.A2aClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/A2aClient.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 A2aClient​

Agent to agent messaging.

Constructor A2aClient​

A2aClient(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.

A2aClient.inbox​

Page<JsonNode> inbox(String recipient)

Read an A2A inbox. Returns the A2A messages addressed to recipient, oldest first, each with verified (the HMAC-SHA256 signature of the envelope matches the tenant key). Reading marks the returned messages as read. One page only (next_cursor is always null).

Route: /v1/a2a/inbox (GET).

NameTypeDefaultRequiredDescription
recipientStringyesParty whose inbox is read: agent:<name> or run:<id> (at least 3 characters).

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

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

A2aClient.inbox​

Page<JsonNode> inbox(String recipient, Map<String, ?> query)

Read an A2A inbox. Returns the A2A messages addressed to recipient, oldest first, each with verified (the HMAC-SHA256 signature of the envelope matches the tenant key). Reading marks the returned messages as read. One page only (next_cursor is always null).

Route: /v1/a2a/inbox (GET).

NameTypeDefaultRequiredDescription
recipientStringyesParty whose inbox is read: agent:<name> or run:<id> (at least 3 characters).
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).

A2aClient.send​

JsonNode send(Object body)

Send an A2A message. Sends a signed agent to agent message (envelope a2a.v1, HMAC-SHA256 signature per tenant). Needs tenant_admin, developer or agent. Steps: 1. to and from are resolved: agent:<name> or run:<id> (400 invalid_request otherwise). Without from, the sender is the calling principal. 2. A run: sender must be a run created by the caller (or the caller is tenant_admin, else 403 forbidden) and not finished (409 run_finished). 3. The policy agent.a2a.send is evaluated and the payload is screened as untrusted content; a prompt injection is refused with prompt_injection_blocked after the security event is recorded. 4. The envelope is stored in the recipient inbox and audited as a2a.send.

Route: /v1/a2a/messages (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesRecipient, message type, payload and optional conversation threading.

Returns: JsonNode. Decoded JSON answer of the operation "Send an A2A message".

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

A2aClient.send​

JsonNode send(Object body, RequestOptions options)

Send an A2A message. Sends a signed agent to agent message (envelope a2a.v1, HMAC-SHA256 signature per tenant). Needs tenant_admin, developer or agent. Steps: 1. to and from are resolved: agent:<name> or run:<id> (400 invalid_request otherwise). Without from, the sender is the calling principal. 2. A run: sender must be a run created by the caller (or the caller is tenant_admin, else 403 forbidden) and not finished (409 run_finished). 3. The policy agent.a2a.send is evaluated and the payload is screened as untrusted content; a prompt injection is refused with prompt_injection_blocked after the security event is recorded. 4. The envelope is stored in the recipient inbox and audited as a2a.send.

Route: /v1/a2a/messages (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesRecipient, message type, payload and optional conversation threading.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Send an A2A message".

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