Update an LLM session record¶
Update a session title or configuration text with an optional original-title condition.
PUT https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/llm/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 workspace identity and variables in the same environment. Read details first and save the current title and configuration to retain.
Request¶
curl --request PUT \
"$BASE_URL/workspaces/$WORKSPACE_ID/llm/sessions/$SESSION_ID" \
--header "X-API-Key: $MOI_KEY" \
--header "X-Workspace-ID: $WORKSPACE_ID" \
--header "Content-Type: application/json" \
--data-raw '{"title":"更新后的标题","expected_title":"临时会话"}'
Parameter |
Location |
Type |
Required |
Description |
|---|---|---|---|---|
|
Path |
string |
Yes |
Target workspace, matching X-Workspace-ID. |
|
Path |
integer |
Yes |
Positive integer ID returned by this service. |
|
Body |
string |
No |
New title; updates only for a nonempty string. |
|
Body |
string |
No |
New configuration text; updates only for a nonempty string. |
|
Body |
string or null |
No |
A non-null string is the original-title condition. An empty string is also a valid condition. |
Omission, null, or an empty string for title/config retains the original value. Omitted or null expected_title skips the original-title check. A mismatch leaves data unchanged but still returns HTTP 200 and the current session. Compare the returned title or configuration to confirm an update. Success does not imply the condition matched, and there is no 409 conflict to wait for. Request source is unused in this update.
Successful response¶
{
"code": 0,
"data": {
"id": 41,
"title": "更新后的标题",
"source": "moi",
"user_id": "user-example",
"config": "{}",
"created_at": 1794445200,
"updated_at": 1794445200
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
0 on success; HTTP status 200. |
|
object |
Error responses¶
Error formats and read scope describes distinct identity, parameter, resource-read, and storage failure outcomes.