会话

更新会话属性

put/sessions/{id}

Request

  • Base URL
    /api/v1 (relative, and the document was published on a file host, not at the API’s origin)
  • URL
    /api/v1/sessions/{id}
  • Auth
    • API key in header Authorization
    • or API key in header X-API-Key

Path parameters

idstring required

会话ID

Request body

created_atstring
descriptionstring

Description

forked_from_message_idstring

ForkedFromMessageID is the user or assistant message, IN THE PARENT SESSION, that the fork branched at. For a user point, messages strictly before it were copied here. For an assistant point, that answer is included so the branch continues after it.

host_workspace_dirstring

HostWorkspaceDir is the user-selected project directory this session operates in, for the WeKnora Lite host sandbox only. Empty means the session gets an auto-allocated workspace instead.

Written once at creation and never updated: re-pointing a live session at a different directory would leave its transcript describing files that are no longer there. Standard edition never writes it.

idstring

ID

im_platformstring

IMPlatform is the originating IM platform (e.g. "feishu", "wecom") when this session is bound to an IM channel. It is not stored on the sessions table (it lives in im_channel_sessions) and is populated on read so the Web console can classify a session's origin folder without a list query.

is_pinnedboolean

IsPinned indicates whether the session is pinned in the list.

kindstring

Kind is empty for ordinary chats and SessionKindAssistant for assistant conversations; it is set at creation and never updated.

owner_auth_sourcestring

OwnerAuthSource records, server-side, how UserID was authenticated when the session was created or its owner first bound (AuthSource*). Per-user sandbox allocation reads it; client input never sets it (CreateSession overwrites). Empty on rows created before the column existed, which means "unknown".

parent_session_idstring

ParentSessionID names the session this one was forked from. Empty for ordinary sessions. Deliberately not a foreign key: the parent may be deleted while the branch lives on, and a branch must not cascade away with it. A dangling value simply renders as an ordinary session.

pinned_atstring

PinnedAt records when the session was pinned; nil when not pinned.

sandbox_config_idstring

SandboxConfigID pins which sandbox config this session's CURRENT live sandbox was created on. Empty means no live sandbox; SandboxConfigIDGlobalDefault means the deployment-wide default config.

This is an ephemeral pin that dies with the sandbox, not a permanent owner: sessions outlive sandboxes by months, so treating it as permanent would make "no session references this config" never true.

tenant_idinteger

Workspace ID

titlestring

Title

updated_atstring
user_idstring

UserID is the owner scope for this session. WeKnora user UUIDs, API external-user principals, and embed visitor principals all use this column.

Response

更新后的会话

object required

Changes