A2A API Overview
The API consists of three endpoints:
GET /orchestrator/a2a/v1/{workflowCode}/.well-known/agent.jsonPOST /orchestrator/a2a/v1/agents/searchPOST /orchestrator/a2a/v1/{workflowCode}
Together, these endpoints support the following actions:
- Agent specific discovery
- Registry-style agent search
- Streaming and nonstreaming invocation and task retrieval
| Endpoint | When to use | Request | Response and how to use it | Notes |
|---|---|---|---|---|
| Agent Card Discovery
|
Use this endpoint when the client already knows the target workflow code or when registry search has already returned a workflow-specific agent-card URL. |
The request is identified by:
No request body is required. |
The response is an agent card for the specified workflow-backed agent. Clients must expect the card to provide the following details:
How to use the response Clients must use the card to do these actions:
|
|
| Registry Search
|
Use this endpoint when the client needs discovery rather than direct lookup. Here are some typical scenarios:
|
The request body supports the following options:
|
The response is a registry-style result set containing these details:
Each resource points to an agent card. How to use the response Here's the recommended client flow:
|
|
| Nonstreaming Invocation
|
Use this endpoint when the client wants a standard request/response interaction rather than an SSE stream. This endpoint supports the following operations:
|
The request body supports the following request patterns:
Request patterns message/sendUse
Typical request content includes these details:
The response is returned as an SSE stream. tasks/sendUse
Typical request content includes these details:
tasks/getUse Typical request content includes these details:
|
The endpoint returns a JSON-RPC-style response whose result is task-oriented. Clients must expect task-like responses representing these states:
For message/stream, clients must expect these responses:
How to use the response Here is a common client pattern:
Use Prefer nonstreaming invocation plus
|
|
API Task Lifecycle
The API is asynchronous by design. The typical client lifecycle includes these steps:
- Identify the target agent through direct card lookup or registry search.
- Call API using
message/send,tasks/send, ormessage/stream. - Receive a task-oriented result.
- Continue through polling or streaming until the task completes.
- Read final output from the resulting task state and artifacts.
Here are the available task states:
submittedworkinginput-requiredcompletedfailed
Clients must be prepared for a task to enter the input-required
state before reaching completion.
Input and Output Expectations
Here are the input and output expectations for the API.
Inputs
The API is primarily text-oriented. Clients must assume the following inputs:
- Text is the primary supported input mode
- The most important request content is the message text
- Metadata might be included when additional execution context is needed
Outputs
The API returns task-oriented outputs. Clients must expect the following outputs:
- Task identifiers
- Task state
- Timestamps
- Output artifacts when work completes or pauses for input
- Optional history when requested
Usage Guidance
For most client integrations, here is the recommended usage pattern:
- Use registry search when discovery is needed.
- Fetch the agent card for the selected agent.
- Use
message/sendfor standard asynchronous invocation. - Use
message/streamwhen live progress updates are preferred. - Use
tasks/getfor polling-based status retrieval.
Error Handling and Client Expectations
Clients must handle the following classes of errors:
- Authentication failures
- Workflow-not-found cases
- Invalid method usage
- Task lookup failures
- Authorization failures during processing or status retrieval
Clients must also assume that invalid or incomplete requests might fail when validating the request. Task retrieval might fail if the task doesn't belong to the specified agent or accessible user context.
Scope and Constraints
The API is intentionally narrower than the broader A2A protocol. Here are some of the important constraints:
- The API is workflow-backed
- The primary response model is task-oriented
- Streaming is snapshot-based over SSE
- Discovery is implementation-specific
- Richer nontext and multipart input handling is limited
- The broader A2A feature set is only partially implemented