DeleteAgentSession
Deletes a specified agent session. This API operation is available only when the canary release feature is enabled. Before calling this operation, ensure that the canary release feature is enabled for the current account and the target region.
Operation description
This API operation is available only when the canary release feature is enabled. Before calling this operation, ensure that the canary release feature is enabled for the current account and the target region.
Verify the target session first. A deleted session cannot be recovered by unarchiving it through ArchiveAgentSession. To temporarily hide a session, use ArchiveAgentSession. To stop the current execution, use CancelAgentSession.
The caller must have access permissions for the current session and the corresponding OpenAPI action permissions. An HTTP 200 status code does not indicate a successful business operation. You must check JsonRpcResponse.Error for errors. The successful result is located in JsonRpcResponse.Result.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:DeleteAgentSession |
delete |
*All Resource
|
None | None |
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Jsonrpc |
string |
No |
The JSON-RPC protocol version. Set this parameter to 2.0 when you call the operation. |
2.0 |
| Id |
string |
No |
The correlation identifier for the current JSON-RPC request generated by the caller. The identifier is returned as-is in the response. This field is not an idempotency token. |
delete-rpc-001 |
| Params |
object |
Yes |
The session operation parameters. Serialize the parameters as a JSON object and submit them as a form field. The SessionId parameter must be included. |
|
| SessionId |
string |
Yes |
The ID of the target session. Use the SessionId returned by CreateAgentSession or obtained from ListAgentSessions. |
session_example |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The session operation response, which includes the OpenAPI request ID and the JSON-RPC business result. |
||
| JsonRpcResponse |
object |
The JSON-RPC response. Result is returned on success, and Error is returned on protocol errors. |
|
| Error |
object |
The JSON-RPC fault message. This field is not returned on success. |
|
| Code |
integer |
The JSON-RPC error code. |
500 |
| Data |
any |
The optional additional error information. The content depends on the error type. |
{} |
| ErrorCode |
string |
The business error code. |
0x4883300000000019 |
| Message |
string |
The error message. |
The session does not exist or the current account does not have access permissions. Return to the session list and select another session |
| Id |
string |
The JSON-RPC correlation identifier for the current request. It is passed by the caller and returned as-is. |
delete-rpc-001 |
| Jsonrpc |
string |
The JSON-RPC protocol version. |
2.0 |
| Result |
any |
An empty object is returned on successful deletion. If the deletion fails, check the sibling Error field. |
{} |
| Timestamp |
integer |
The response time. It is a UNIX timestamp in milliseconds. |
1789549200000 |
| RequestId |
string |
The OpenAPI request ID, which can be used to troubleshoot call failures. |
01A0B6E0-E005-1465-B5DE-5CD17677426F |
Examples
Success response
JSON format
{
"JsonRpcResponse": {
"Error": {
"Code": 500,
"Data": "{}",
"ErrorCode": "0x4883300000000019",
"Message": "The session does not exist or the current account does not have access permissions. Return to the session list and select another session"
},
"Id": "delete-rpc-001",
"Jsonrpc": "2.0",
"Result": "{}",
"Timestamp": 1789549200000
},
"RequestId": "01A0B6E0-E005-1465-B5DE-5CD17677426F"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.