LoadAgentSession - LoadAgentSession
Restores an existing agent session by streaming its message history as SSE events (Content-Type: text/event-stream). Returns a JSONRPCResponse.error with code 400 if the session does not exist.
Operation description
Request
-
Retrieves session details and streams the agent response over SSE.
-
Returns an error frame with code 400 if the session does not exist.
-
The response contains message chunks, thought processes, and tool call status updates.
-
The
stopReasonfield indicates why the agent ended the current turn, such as reaching the maximum turn limit or cancellation. -
The response conforms to the Agent Client Protocol (ACP): https://agentclientprotocol.com.
Try it now
Test
RAM authorization
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Jsonrpc |
string |
No |
The JSON-RPC version. Fixed value: 2.0. |
2.0 |
| Id |
string |
No |
The ID specified by the caller. The value is returned as-is. |
4as3dasf654a |
| Params |
object |
No |
The business parameters. |
|
| SessionId |
string |
No |
The session ID. Returns an SSE error frame if the session does not exist. |
sess_0f12abc34 |
| Meta |
object |
No |
The ACP extension parameters of DataWorks. |
|
| IsReload |
boolean |
No |
Whether to resume from a breakpoint. Set to true to re-fetch SSE data after a network interruption. |
true or false |
| BeginLogOffset |
integer |
No |
The offset from which to resume SSE output during breakpoint recovery. |
10000 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
0D41C608-0C60-5EB0-B986-1460909CF642 |
| Timestamp |
integer |
The timestamp. |
1769479322828 |
| Jsonrpc |
string |
The JSON-RPC version. Fixed value: 2.0. |
2.0 |
| Id |
string |
The ID specified by the caller. The value is returned as-is. |
676303114031776 |
| Result |
any |
The SSE frame result set. Conforms to the ACP: https://agentclientprotocol.com/protocol/prompt-turn. |
{"stopReason":"end_turn"} |
| Error |
any |
The SSE frame error details. Conforms to the ACP: https://agentclientprotocol.com/protocol/prompt-turn. |
{"code": 400, "errorCode": "0x50000000001", "message": "not exist session", "data": null} |
| Method |
string |
The SSE frame method. Conforms to the ACP: https://agentclientprotocol.com/protocol/prompt-turn. |
session/update |
| Params |
any |
The SSE frame parameters. Conforms to the ACP: https://agentclientprotocol.com/protocol/prompt-turn. |
{"sessionId":"af4f5ef8-e8f5-481c-ad1f-94886c6c0aed","update":{"sessionUpdate":"agent_message_chunk","content":{"type":"text","text":"hello world"}}} |
Examples
Success response
JSON format
{
"RequestId": "0D41C608-0C60-5EB0-B986-1460909CF642",
"Timestamp": 1769479322828,
"Jsonrpc": "2.0",
"Id": "676303114031776",
"Result": "{\"stopReason\":\"end_turn\"}",
"Error": "{\"code\": 400, \"errorCode\": \"0x50000000001\", \"message\": \"not exist session\", \"data\": null}",
"Method": "session/update",
"Params": "{\"sessionId\":\"af4f5ef8-e8f5-481c-ad1f-94886c6c0aed\",\"update\":{\"sessionUpdate\":\"agent_message_chunk\",\"content\":{\"type\":\"text\",\"text\":\"hello world\"}}}"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.