a2a
Calls the a2a operation to interact with OSS Agent through the A2A (Agent-to-Agent) protocol. This operation is based on JSON-RPC 2.0 and supports both streaming and non-streaming message sending modes.
Usage notes
This operation follows the A2A (Agent-to-Agent) protocol and is based on the JSON-RPC 2.0 specification.
Request syntax
POST /api/a2a HTTP/1.1Request parameters
Parameter | Type | Required | Description |
id | string | Yes | The message ID. Used to associate requests and responses. Example: |
jsonrpc | string | Yes | The JSON-RPC protocol version identifier. Fixed value: |
method | string | Yes | The request method. Valid values:
|
params | object | Yes | The A2A request parameters. Contains the message content to be sent to the Agent. |
params.message | object | Yes | The message object. Contains the role, content parts, and message type. |
params.message.role | string | Yes | The message role. Example: |
params.message.parts | array<object> | Yes | The list of message content parts. Each part contains the |
params.message.kind | string | Yes | The message type identifier. Fixed value: |
Response parameters
The response follows the JSON-RPC 2.0 specification and returns a Task object that contains the task status, context information, and conversation history.
Parameter | Type | Description |
jsonrpc | string | The JSON-RPC protocol version. Fixed value: |
id | string | The response identifier that corresponds to the id in the request. |
result | object | The Task object. Contains the task ID, context ID, status, artifacts, and conversation history. |
result.id | string | The unique task identifier. |
result.contextId | string | The context ID. Used to associate multiple interactions within the same session. |
result.status | object | The task status. Contains the |
result.history | array<object> | The conversation history message list. Each message contains the role, parts, messageId, contextId, taskId, and other fields. |
result.kind | string | The result object type. Fixed value: |
Examples
Sample request:
POST /api/a2a HTTP/1.1
Content-Type: application/json
{
"id": "791",
"jsonrpc": "2.0",
"method": "message/stream",
"params": {
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "Hello"
}
],
"kind": "message"
}
}
}Sample response:
{
"jsonrpc": "2.0",
"id": "791",
"result": {
"id": "UUID",
"contextId": "UUID",
"status": {
"state": "submitted",
"timestamp": "2026-08-20T00:00:00.000000000Z"
},
"artifacts": [],
"history": [
{
"role": "user",
"parts": [
{
"text": "Hello",
"kind": "text"
}
],
"messageId": "msg-1",
"contextId": "UUID",
"taskId": "UUID.task-1",
"metadata": {},
"kind": "message"
}
],
"kind": "task"
}
}