Sends an A2A streaming message.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
nis:SendNapalStreamMessage |
create |
*All Resource
|
None | None |
Request syntax
POST /open/a2a/message/stream HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Message |
object |
No |
The message body object that contains user input and conversation context information. |
|
| ContextId |
string |
No |
The conversation context ID. Do not specify this parameter for the first conversation. The server creates a new conversation. For multi-turn conversations, specify the contextId from the previous response to maintain context continuity. |
context-xxx |
| Extensions |
array |
No |
The list of extension information. |
|
|
string |
No |
The extension information. |
trace |
|
| MessageId |
string |
No |
The message ID. If not specified, the server automatically generates one. |
m_msijl2sv_pcfge8r7l |
| Metadata |
object |
No |
The extended metadata used to pass additional context information. |
{} |
| Parts |
array<object> |
No |
The list of message content parts. Multiple parts are supported. |
|
|
object |
No |
The message content part object. |
||
| Data |
any |
No |
The structured data used to pass JSON-formatted structured content. |
{"key":"value"} |
| Filename |
string |
No |
The file name. |
report.txt |
| MediaType |
string |
No |
The media type. |
application/json |
| Raw |
string |
No |
The raw content used to pass non-text data. |
cmVzZXJ2ZWQ= |
| Text |
string |
No |
The text content. The natural language instruction entered by the user, such as a diagnostic request or question consultation. |
Diagnose this instance ngw-xxx |
| Url |
string |
No |
The file URL used to pass file-type content. |
https://example.com/file.txt |
| ReferenceTaskIds |
array |
No |
The list of referenced historical task IDs used for context association. |
|
|
string |
No |
Reserved field. This parameter is not returned by the current operation. |
task-reserved |
|
| Role |
string |
No |
The message role. |
user |
| TaskId |
string |
No |
The task ID. Specify the ID of the previous task for follow-up conversations. |
task-xxx |
| Metadata |
object |
No |
The additional request information. |
|
|
string |
No |
The node metadata. |
{"tenantId":"t-10001"} |
|
| Configuration |
object |
No |
The request configuration object. |
|
| AcceptedOutputModes |
array |
No |
The accepted output modes. Default value: ["text/event-stream"], which indicates that SSE streaming responses are accepted. |
|
|
string |
No |
The output mode. |
text/event-stream |
|
| HistoryLength |
integer |
No |
The history message length. Controls the number of historical messages carried during multi-turn conversations. Default value: 20. |
20 |
| ReturnImmediately |
boolean |
No |
Specifies whether to return immediately. Valid values:
|
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Message |
object |
This field is mutually exclusive with Task, TaskStatusUpdate, and TaskArtifactUpdate. When this field is returned, no task is created, and the stream closes after sending one Message. This field is currently not returned by this operation and is reserved for protocol compatibility. |
|
| ContextId |
string |
The conversation context ID. |
context-07b0**bcc2 |
| Extensions |
array |
Reserved field. This parameter is not returned by the current operation. |
|
|
string |
Reserved field. This parameter is not returned by the current operation. |
reserved |
|
| MessageId |
string |
The message ID. |
message-fd6e**9949 |
| Metadata |
object |
Reserved field. This parameter is not returned by the current operation. |
{} |
| Parts |
array<object> |
The list of message content parts. |
|
|
object |
The message content part object. |
||
| Data |
any |
Reserved field. This parameter is not returned by the current operation. |
{} |
| Filename |
string |
Reserved field. This parameter is not returned by the current operation. |
reserved.bin |
| MediaType |
string |
Reserved field. This parameter is not returned by the current operation. |
application/octet-stream |
| Raw |
string |
Reserved field. This parameter is not returned by the current operation. |
cmVzZXJ2ZWQ= |
| Text |
string |
The text content. |
The current instance is running normally |
| Url |
string |
Reserved field. This parameter is not returned by the current operation. |
https://example.com/reserved.bin |
| ReferenceTaskIds |
array |
Reserved field. This parameter is not returned by the current operation. |
|
|
string |
Reserved field. This parameter is not returned by the current operation. |
task-reserved |
|
| Role |
string |
The message role. |
agent |
| TaskId |
string |
Reserved field. A directly returned Message does not create a task, so this field is empty. This operation currently does not return a top-level Message. |
task-reserved |
| RequestId |
string |
The request ID. |
A7F0D6EC-E19E-58AC-AC9F-08036763960F |
| Task |
object |
The task information. |
|
| Artifacts |
array<object> |
The list of task artifacts. |
|
|
array<object> |
The task artifact object. |
||
| ArtifactId |
string |
The unique identifier of the artifact. |
output |
| Description |
string |
The description of the artifact. |
Instance health inspection result |
| Extensions |
array |
Reserved field. This parameter is not returned by the current operation. |
|
|
string |
Reserved field. This parameter is not returned by the current operation. |
reserved |
|
| Metadata |
object |
Reserved field. This parameter is not returned by the current operation. |
{} |
| Name |
string |
The name of the artifact. |
Inspection report |
| Parts |
array<object> |
The list of content parts. |
|
|
object |
The content part object. |
||
| Data |
any |
Reserved field. This parameter is not returned by the current operation. |
{} |
| Filename |
string |
Reserved field. This parameter is not returned by the current operation. |
reserved.bin |
| MediaType |
string |
Reserved field. This parameter is not returned by the current operation. |
application/octet-stream |
| Raw |
string |
Reserved field. This parameter is not returned by the current operation. |
cmVzZXJ2ZWQ= |
| Text |
string |
The report text fragment. |
Diagnostic result |
| Url |
string |
Reserved field. This parameter is not returned by the current operation. |
https://example.com/reserved.bin |
| ContextId |
string |
The conversation context ID. This ID is used to maintain context continuity across multi-turn conversations. |
context-07b0**bcc2 |
| History |
array<object> |
The list of historical messages. |
|
|
array<object> |
The historical message. |
||
| ContextId |
string |
The conversation context ID. |
context-07b0**bcc2 |
| Extensions |
array |
Reserved field. This parameter is not returned by the current operation. |
|
|
string |
Reserved field. This parameter is not returned by the current operation. |
reserved |
|
| MessageId |
string |
The message ID. |
message-fd6e**9949 |
| Metadata |
object |
Reserved field. This parameter is not returned by the current operation. |
{} |
| Parts |
array<object> |
The list of message content parts. |
|
|
object |
The message content part object. |
||
| Data |
any |
Reserved field. This parameter is not returned by the current operation. |
{} |
| Filename |
string |
Reserved field. This parameter is not returned by the current operation. |
reserved.bin |
| MediaType |
string |
Reserved field. This parameter is not returned by the current operation. |
application/octet-stream |
| Raw |
string |
Reserved field. This parameter is not returned by the current operation. |
cmVzZXJ2ZWQ= |
| Text |
string |
The text content. |
Diagnose this instance ngw-xxx |
| Url |
string |
Reserved field. This parameter is not returned by the current operation. |
https://example.com/reserved.bin |
| ReferenceTaskIds |
array |
Reserved field. This parameter is not returned by the current operation. |
|
|
string |
Reserved field. This parameter is not returned by the current operation. |
task-reserved |
|
| Role |
string |
The message role. |
user |
| TaskId |
string |
The task ID. |
task-38cZ**MAVKu |
| Id |
string |
The task ID. |
task-38cZ**MAVKu |
| Metadata |
object |
The extended metadata used to pass additional context information. |
{"usage":"{totalTokens=327672}"} |
| Status |
object |
The task status object. |
|
| Message |
object |
The message object defined by the A2A protocol. It contains the sender role, one or more content parts, and optional session and task context. When returned as a top-level field, it indicates a direct reply from the agent and is mutually exclusive with Task, TaskStatusUpdate, and TaskArtifactUpdate. The stream closes immediately after this field is returned. When returned as Status.Message, it represents a descriptive message associated with the task status. This operation currently does not return a top-level Message. This field is reserved for protocol compatibility only. |
|
| MessageId |
string |
The message ID. |
message-fd6e**9949 |
| Parts |
array<object> |
The list of message content parts. |
|
|
object |
The message content part object. |
||
| Data |
any |
Reserved field. This parameter is not returned by the current operation. |
{} |
| Filename |
string |
Reserved field. This parameter is not returned by the current operation. |
reserved.bin |
| MediaType |
string |
Reserved field. This parameter is not returned by the current operation. |
application/octet-stream |
| Raw |
string |
Reserved field. This parameter is not returned by the current operation. |
cmVzZXJ2ZWQ= |
| Text |
string |
The text content. The natural language instruction entered by the user, such as a diagnostic request or question consultation. |
The current instance is running normally |
| Url |
string |
Reserved field. This parameter is not returned by the current operation. |
https://example.com/reserved.bin |
| Role |
string |
The message role. |
agent |
| State |
string |
The task status. Valid values:
|
TASK_STATE_SUBMITTED |
| Timestamp |
string |
The status timestamp in ISO 8601 format. |
2026-08-07T06:08:10Z |
| TaskArtifactUpdate |
object |
The task artifact update object. |
|
| Append |
boolean |
Specifies whether the content is appended. A value of |
true |
| Artifact |
object |
The artifact object. |
|
| ArtifactId |
string |
The unique identifier of the artifact. |
output |
| Description |
string |
The description of the artifact. |
Detailed inspection report |
| Extensions |
array |
Reserved field. This parameter is not returned by the current operation. |
|
|
string |
Reserved field. This parameter is not returned by the current operation. |
reserved |
|
| Metadata |
object |
Reserved field. This parameter is not returned by the current operation. |
{} |
| Name |
string |
The name of the artifact. |
Inspection report |
| Parts |
array<object> |
The list of content parts. |
|
|
array<object> |
The content part object. |
||
| Data |
any |
Reserved field. This parameter is not returned by the current operation. |
{} |
| Filename |
string |
Reserved field. This parameter is not returned by the current operation. |
reserved.bin |
| MediaType |
string |
Reserved field. This parameter is not returned by the current operation. |
application/octet-stream |
| Metadata |
object |
Metadata |
|
| Thought |
boolean |
Indicates whether the content is a thinking process. |
|
| Raw |
string |
Reserved field. This parameter is not returned by the current operation. |
cmVzZXJ2ZWQ= |
| Text |
string |
The report text fragment. |
Instance status is normal |
| Url |
string |
Reserved field. This parameter is not returned by the current operation. |
https://example.com/reserved.bin |
| ContextId |
string |
The conversation context ID. |
context-07b0**bcc2 |
| LastChunk |
boolean |
Indicates whether this is the last chunk. A value of |
false |
| TaskId |
string |
The task ID. |
task-38cZ**MAVKu |
| TaskStatusUpdate |
object |
The task status update object. |
|
| ContextId |
string |
The conversation context ID. |
context-07b0**bcc2 |
| Final |
boolean |
Indicates whether this is a desired state event. A value of true indicates that the task has ended (completed or failed) and no more events will be pushed. |
false |
| Metadata |
object |
The metadata object that contains step execution information. |
|
| Step |
object |
The step execution information. |
|
| CostTime |
integer |
The execution duration of the step. Unit: milliseconds (ms). |
203 |
| Id |
string |
The unique identifier of the step. |
30688 |
| IsError |
boolean |
Indicates whether the step encountered an error during execution. |
false |
| Name |
string |
The step name. |
load_skill |
| Params |
any |
The input parameters of the step. |
{"skill_id":"239"} |
| Result |
any |
The execution result of the step. |
success |
| RetryCount |
integer |
The number of retries. |
1 |
| UiContent |
string |
The frontend display content. |
load_skill |
| Status |
object |
The task status object. |
|
| Message |
object |
The message body object. |
|
| MessageId |
string |
The message ID. |
message-fd6e**9949 |
| Parts |
array<object> |
The list of message content parts. |
|
|
object |
The message content part object. |
||
| Data |
any |
Reserved field. This parameter is not returned by the current operation. |
{} |
| Filename |
string |
Reserved field. This parameter is not returned by the current operation. |
reserved.bin |
| MediaType |
string |
Reserved field. This parameter is not returned by the current operation. |
application/octet-stream |
| Raw |
string |
Reserved field. This parameter is not returned by the current operation. |
cmVzZXJ2ZWQ= |
| Text |
string |
The text content. |
Query traffic |
| Url |
string |
Reserved field. This parameter is not returned by the current operation. |
https://example.com/reserved.bin |
| Role |
string |
The message role. |
user |
| State |
string |
The task status. Valid values: TASK_STATE_WORKING (running), TASK_STATE_COMPLETED (completed), TASK_STATE_FAILED (failed), TASK_STATE_CANCELED (canceled). |
TASK_STATE_WORKING |
| Timestamp |
string |
The status timestamp in ISO 8601 format. |
2026-08-07T06:08:30Z |
| TaskId |
string |
The task ID. |
task-38cZ**MAVKu |
Examples
Success response
JSON format
{
"Message": {
"ContextId": "context-07b0**bcc2",
"Extensions": [
"reserved"
],
"MessageId": "message-fd6e**9949",
"Metadata": {},
"Parts": [
{
"Data": "{}",
"Filename": "reserved.bin",
"MediaType": "application/octet-stream",
"Raw": "cmVzZXJ2ZWQ=",
"Text": "The current instance is running normally",
"Url": "https://example.com/reserved.bin"
}
],
"ReferenceTaskIds": [
"task-reserved"
],
"Role": "agent",
"TaskId": "task-reserved"
},
"RequestId": "A7F0D6EC-E19E-58AC-AC9F-08036763960F",
"Task": {
"Artifacts": [
{
"ArtifactId": "output",
"Description": "Instance health inspection result",
"Extensions": [
"reserved"
],
"Metadata": {},
"Name": "Inspection report",
"Parts": [
{
"Data": "{}",
"Filename": "reserved.bin",
"MediaType": "application/octet-stream",
"Raw": "cmVzZXJ2ZWQ=",
"Text": "Diagnostic result",
"Url": "https://example.com/reserved.bin"
}
]
}
],
"ContextId": "context-07b0**bcc2",
"History": [
{
"ContextId": "context-07b0**bcc2",
"Extensions": [
"reserved"
],
"MessageId": "message-fd6e**9949",
"Metadata": {},
"Parts": [
{
"Data": "{}",
"Filename": "reserved.bin",
"MediaType": "application/octet-stream",
"Raw": "cmVzZXJ2ZWQ=",
"Text": "Diagnose this instance ngw-xxx",
"Url": "https://example.com/reserved.bin"
}
],
"ReferenceTaskIds": [
"task-reserved"
],
"Role": "user",
"TaskId": "task-38cZ**MAVKu"
}
],
"Id": "task-38cZ**MAVKu",
"Metadata": {
"usage": "{totalTokens=327672}"
},
"Status": {
"Message": {
"MessageId": "message-fd6e**9949",
"Parts": [
{
"Data": "{}",
"Filename": "reserved.bin",
"MediaType": "application/octet-stream",
"Raw": "cmVzZXJ2ZWQ=",
"Text": "The current instance is running normally",
"Url": "https://example.com/reserved.bin"
}
],
"Role": "agent"
},
"State": "TASK_STATE_SUBMITTED",
"Timestamp": "2026-08-07T06:08:10Z"
}
},
"TaskArtifactUpdate": {
"Append": true,
"Artifact": {
"ArtifactId": "output",
"Description": "Detailed inspection report",
"Extensions": [
"reserved"
],
"Metadata": {},
"Name": "Inspection report",
"Parts": [
{
"Data": "{}",
"Filename": "reserved.bin",
"MediaType": "application/octet-stream",
"Metadata": {
"Thought": false
},
"Raw": "cmVzZXJ2ZWQ=",
"Text": "Instance status is normal",
"Url": "https://example.com/reserved.bin"
}
]
},
"ContextId": "context-07b0**bcc2",
"LastChunk": false,
"TaskId": "task-38cZ**MAVKu"
},
"TaskStatusUpdate": {
"ContextId": "context-07b0**bcc2",
"Final": true,
"Metadata": {
"Step": {
"CostTime": 203,
"Id": "30688",
"IsError": false,
"Name": "load_skill",
"Params": "{\"skill_id\":\"239\"}",
"Result": "success",
"RetryCount": 1,
"UiContent": "load_skill"
}
},
"Status": {
"Message": {
"MessageId": "message-fd6e**9949",
"Parts": [
{
"Data": "{}",
"Filename": "reserved.bin",
"MediaType": "application/octet-stream",
"Raw": "cmVzZXJ2ZWQ=",
"Text": "Query traffic",
"Url": "https://example.com/reserved.bin"
}
],
"Role": "user"
},
"State": "TASK_STATE_WORKING",
"Timestamp": "2026-08-07T06:08:30Z"
},
"TaskId": "task-38cZ**MAVKu"
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IllegalParam.IllegalParameter | The parameter is illegal. | |
| 400 | Forbidden.NoPermission | The authentication result is successful but the verification fails. | The authentication result is successful but the verification fails. |
| 402 | IllegalParam.CreditInsufficient | Credit has been exhausted in the current cycle. | Credit has been exhausted in the current cycle. |
| 403 | OperationDenied.AliUid | The specified AliUid is not authorized to operate this resource. | The specified AliUid is not authorized to operate this resource. |
| 403 | Forbidden.ServiceNotActivated | The NAPal service has not been activated for this account (%s). | The NAPal service has not been activated for this account (%s). |
| 403 | Forbidden.GenerateAccessToken | The user does not have permission to access the (GenerateAccessToken) service. | The user does not have permission to access the (GenerateAccessToken) service. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.