Update session¶
Update the title, status, or pinned status of a visible conversation. When archiving a session, if the session is still associated with unfinished tasks, the server will reject the request.
PATCH $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/conversations/{conversation_id}
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the agent session list or create agent session to obtain the session ID. Prepare the personal access token, target workspace ID, and session ID that can access the target workspace.
Request body¶
curl -X PATCH "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/conversations/$CONVERSATION_ID?agent_id=$AGENT_ID" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"title": "华东销售分析",
"pinned": true
}'
Path parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID must be consistent with X-Workspace-ID. |
|
string |
Yes |
The session ID to update. |
Query parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Limit sessions to the specified agent. If not provided, filtering by agent ID is not performed. |
|
string |
No |
The workspace ID to which the agent belongs. If this parameter is not provided when agent_id is specified, the current workspace will be used. Only the current workspace or system workspace can be specified. |
Request body
Archiving also removes the session’s association with the file and decrements the file reference count. When the transaction fails, the modification will be undone.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
New session title, length cannot exceed 256. |
|
string |
No |
The new session state, which can be active or archived. |
|
boolean |
No |
Whether to pin it to the top. |
Successful response¶
{
"code": 0,
"data": {
"id": "conv_01",
"workspace_id": "ws_01",
"agent_workspace_id": "ws_01",
"agent_id": "agent_01",
"title": "华东销售分析",
"status": "active",
"purpose": "chat",
"visibility": "visible",
"pinned": true,
"created_at": "2026-01-02T15:04:05Z",
"updated_at": "2026-01-02T15:04:05Z",
"agent_summary": {
"id": "resource_01",
"display_name": "示例节点",
"available": false
},
"title_user_edited": false
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
success code. |
|
object |
The data returned by this operation. |
|
string |
Session ID. |
|
string |
The workspace ID to which the session belongs. |
|
string |
The workspace ID to which the agent belongs. |
|
string |
agent ID. |
|
object |
agent displays summary. Returned when display information is available. |
|
string |
ID of the current object. |
|
string |
The workspace ID to which it belongs. |
|
string |
Display name. |
|
string |
Avatar Quotes. |
|
string |
status. |
|
boolean |
is available. |
|
string |
Reason for unavailability. |
|
string |
Updated title text. |
|
boolean |
Whether the title is editable by the user. |
|
string |
Updated session state. The values are |
|
string |
Conversational purposes. The values are |
|
string |
Session visibility. The values are |
|
string |
Association ID. |
|
boolean |
Updated pin status. |
|
string |
Recent message ID. Do not return if there is no message yet. |
|
string |
The currently active task ID. Does not return when there are no active tasks. |
|
string |
Recent task ID. |
|
string |
Most recent task status: |
|
string |
Most recent message time in RFC 3339 format. Omitted when there are no messages. |
|
string |
Creation and last update times, in RFC 3339 format. |
|
string |
Creation and last update times, in RFC 3339 format. |
Error response¶
If querying the session summary fails after saving, the endpoint still returns an error even though the session may have been saved. Query existing sessions before retrying creation or archiving. Supplying your own session ID does not guarantee a repeated submission will succeed.
{
"code": 2,
"message": "请求参数无效",
"details": {
"cause": "conversation with an active task cannot be archived"
}
}
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |