UpdateCopilotSession

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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 :

    Archived.

  • active :

    Not archived.

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:

  • archived :

    Archived.

  • active :

    Not archived.

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.