UpdateCopilotSession
Updates the title or archive status of a specified session.
Operation description
Only sessions of the current user can be modified.
You must provide a non-null value for at least one of the name and status parameters. Unprovided fields remain unchanged.
You can modify the title when an active execution is in progress, but you cannot modify the session status.
Archiving retains the history. After a session is restored, you can continue to send messages.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sysom:UpdateCopilotSession |
update |
*All Resource
|
None | None |
Request syntax
PATCH /api/v1/copilot/sessions/{sessionId} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| sessionId |
string |
Yes |
The session ID. |
s001 |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| name |
string |
No |
The session title. The length is 1 to 255 characters. |
CPU load analysis record |
| status |
string |
No |
The session status. Valid values:
|
archived |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| requestId |
string |
The request ID. It can be used for end-to-end diagnostics. |
5BC79EF5-798B-5499-9683-4E14EBBBF712 |
| code |
string |
The returned status code. Success indicates that the request is successful. Other values indicate that the request failed. |
Success |
| message |
string |
The error message. If the code is Success, this field is empty. Otherwise, this field contains the request error message. |
Service temporarily unavailable |
| data |
object |
The returned data. |
|
| sessionId |
string |
The session ID. |
s001 |
| name |
string |
The session title. |
Troubleshoot CPU load |
| status |
string |
The session status. Valid values: active (not archived) and archived (archived). This field does not indicate whether the execution has ended. Valid values:
|
active |
| activeTurn |
object |
The summary of the execution that currently occupies the session. This field is empty when no active execution is in progress. An execution with an unknown outcome may still occupy the session. |
|
| turnId |
string |
The ID of the current execution turn. It is used to submit user input, reconnect, or stop the execution. |
t001 |
| status |
string |
The execution status. Valid values: running (in progress), waiting_input (waiting for user input), cancelling (cancelling), completed (completed), failed (failed), cancelled (cancelled), and outcome_unknown (outcome unknown, may still occupy the session, and should not be automatically rerun). |
running |
| pendingInputId |
string |
The ID of the form that is currently waiting for user input. It is used when submitting user input. This field is empty when no form is pending. |
iso-boot-validation |
| inputTokens |
integer |
The cumulative number of input tokens for the current turn. This is not the incremental usage for the current event. |
1200 |
| outputTokens |
integer |
The cumulative number of output tokens for the current turn. |
80 |
| createdAt |
string |
The creation time of the current execution turn. The time is in the ISO 8601 format. |
2026-09-09T09:00:00+08:00 |
| updatedAt |
string |
The last update time of the current execution turn. The time is in the ISO 8601 format. |
2026-09-09T09:02:00+08:00 |
| finishedAt |
string |
The end time of the execution. The time is in the ISO 8601 format. This field is empty if the execution has not ended. |
2026-09-09T09:03:00+08:00 |
| cursor |
string |
The latest persisted event cursor for the current session, returned as a decimal string. The value is 0 when no events exist. This value does not represent the position consumed by the client. |
12 |
| createdAt |
string |
The creation time of the session. The time is in the ISO 8601 format. |
2026-09-09T09:00:00+08:00 |
| updatedAt |
string |
The last update time of the session. The time is in the ISO 8601 format. |
2026-09-09T09:02:00+08:00 |
| lastTurn |
object |
The summary of the most recent execution. This field is empty if no execution has ever occurred. If the most recent execution has not ended, this field may point to the same execution as activeTurn. |
|
| turnId |
string |
The ID of the current execution turn. It is used to submit user input, reconnect, or stop the execution. |
t001 |
| status |
string |
The execution status. Valid values: running (in progress), waiting_input (waiting for user input), cancelling (cancelling), completed (completed), failed (failed), cancelled (cancelled), and outcome_unknown (outcome unknown, may still occupy the session, and should not be automatically rerun). |
running |
| pendingInputId |
string |
The ID of the form that is currently waiting for user input. It is used when submitting user input. This field is empty when no form is pending. |
iso-boot-validation |
| createdAt |
string |
The creation time of the current execution turn. The time is in the ISO 8601 format. |
2026-09-09T09:00:00+08:00 |
| updatedAt |
string |
The last update time of the current execution turn. The time is in the ISO 8601 format. |
2026-09-09T09:02:00+08:00 |
| finishedAt |
string |
The end time of the execution. The time is in the ISO 8601 format. This field is empty if the execution has not ended. |
2026-09-09T09:03:00+08:00 |
| inputTokens |
integer |
The cumulative number of input tokens for the current turn. This is not the incremental usage for the current event. |
1200 |
| outputTokens |
integer |
The cumulative number of output tokens for the current turn. |
80 |
| sessionType |
string |
The source of the session creation. Valid values: openapi (proactive call), cron (scheduled task), im_dingtalk (DingTalk), im_feishu (Lark), and alert (alert). This is determined by the server, and subsequent follow-up questions do not change the source. |
openapi |
| scheduledTask |
object |
The snapshot information when the scheduled task is triggered. This is returned only for scheduled task sessions and is empty for sessions from other sources. Subsequent renaming or deletion of the task does not change the historical snapshot. |
|
| taskId |
integer |
The ID of the associated scheduled task. |
42 |
| taskName |
string |
The name of the scheduled task at the time of this trigger. |
Daily inspection |
| runId |
string |
The ID of this scheduled execution. Multiple triggers of the same scheduled task use different runIds. |
run-example-001 |
| scheduledAt |
string |
The scheduled trigger time. The time is in the ISO 8601 format with a time zone. This field is empty when no record exists. |
2026-09-09T01:00:00+00:00 |
| startedAt |
string |
The time when Copilot starts processing this schedule. The time is in the ISO 8601 format with a time zone. This is not the time when the model outputs the first token. |
2026-09-09T01:00:03+00:00 |
| timezone |
string |
The scheduling time zone of the scheduled task, such as Asia/Shanghai. |
Asia/Shanghai |
Examples
Success response
JSON format
{
"requestId": "5BC79EF5-798B-5499-9683-4E14EBBBF712",
"code": "Success",
"message": "Service temporarily unavailable",
"data": {
"sessionId": "s001",
"name": "Troubleshoot CPU load",
"status": "active",
"activeTurn": {
"turnId": "t001",
"status": "running",
"pendingInputId": "iso-boot-validation",
"inputTokens": 1200,
"outputTokens": 80,
"createdAt": "2026-09-09T09:00:00+08:00",
"updatedAt": "2026-09-09T09:02:00+08:00",
"finishedAt": "2026-09-09T09:03:00+08:00"
},
"cursor": "12",
"createdAt": "2026-09-09T09:00:00+08:00",
"updatedAt": "2026-09-09T09:02:00+08:00",
"lastTurn": {
"turnId": "t001",
"status": "running",
"pendingInputId": "iso-boot-validation",
"createdAt": "2026-09-09T09:00:00+08:00",
"updatedAt": "2026-09-09T09:02:00+08:00",
"finishedAt": "2026-09-09T09:03:00+08:00",
"inputTokens": 1200,
"outputTokens": 80
},
"sessionType": "openapi",
"scheduledTask": {
"taskId": 42,
"taskName": "Daily inspection",
"runId": "run-example-001",
"scheduledAt": "2026-09-09T01:00:00+00:00",
"startedAt": "2026-09-09T01:00:03+00:00",
"timezone": "Asia/Shanghai"
}
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.