Update a UI protocol session record

Update the current user’s session with a nonempty title or configuration text.

PUT https://api.moi.matrixorigin.cn/v5/sessions/{session_id}

Before you call this API

Set BASE_URL to the product API prefix https://api.moi.matrixorigin.cn/v5; use the corresponding product API URL for a dedicated deployment.

Configure identity, workspace, and numeric record IDs in the same environment. This entry point uses ordinary product authentication and rejects additional task-runtime authorization headers.

Request

curl --request PUT \
  "$BASE_URL/sessions/$SESSION_ID" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID" \
  --header "Content-Type: application/json" \
  --data-raw '{"title":"更新后的标题"}'

Parameter

Location

Type

Required

Description

X-Workspace-ID

Headers

string

Yes

Target workspace ID.

session_id

Path

integer

Yes

Positive integer ID of the current user’s record.

title

Body

string

No

Updates only for a nonempty string; an empty value retains the original title.

config

Body

string

No

Updates only for a nonempty string; an empty value retains the original configuration.

source

Body

string

No

Accepted during binding but not used for the update.

tags

Body

array (strings)

No

Accepted during binding but does not update tag relationships.

This UI entry point does not read expected_title or implement the workspace update entry point’s original-title condition. Omission, null, or an empty string does not clear title/config. Compare returned values and read details after changing them. These rules do not apply to the workspace entry point with expected_title.

Successful response

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": 41,
    "title": "更新后的标题",
    "source": "moi",
    "user_id": "user-example",
    "config": "{}",
    "tags": [],
    "created_at": 1794445200,
    "updated_at": 1794445200
  }
}

Field

Type

Description

code

string

OK on success; HTTP status 200.

msg

string

OK on success.

data

object

Session object.

Error responses

Error formats and result confirmation distinguishes session-detail not-found errors from generic service errors at other entry points.

Last updated on