Query session details¶
Read the display information of a visible session and associate it with the current task. Query parameters can be used to limit the range of agents read.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/conversations/{conversation_id}
Preparation before calling¶
First query the session list or create session] to obtain the session ID. Prepare the personal access token, target workspace ID, and session ID that have access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$CONVERSATION_ID: The session ID to query.$AGENT_ID: Optional agent filter ID.
Request example¶
curl --get "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/conversations/$CONVERSATION_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "agent_id=$AGENT_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID, must be consistent with |
|
string |
Yes |
The session ID to query. |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Only sessions belonging to this agent are returned. Does not filter by agent ID when not provided. |
|
string |
No |
ID of the workspace to which the agent belongs. When not provided, and |
Successful response¶
Returns 200 on success. data is the complete display information of the current session.
{
"code": 0,
"data": {
"id": "conv_01",
"workspace_id": "ws_01",
"agent_workspace_id": "ws_01",
"agent_id": "agent_01",
"agent_summary": {
"id": "agent_01",
"display_name": "销售分析助手",
"available": true
},
"title": "销售分析",
"status": "active",
"purpose": "chat",
"visibility": "visible",
"pinned": true,
"head_message_id": "msg_01",
"active_task_id": "task_01",
"last_message_at": "2026-01-02T15:04:05Z",
"created_at": "2026-01-02T15:04:05Z",
"updated_at": "2026-01-02T15:04:05Z"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Session ID. |
|
string |
ID of the workspace to which the session belongs. |
|
string |
ID of the workspace to which the agent belongs. |
|
string |
Agent ID. |
|
object |
Agent display summary; can contain |
|
string |
Session title; not returned if not set. |
|
string |
Session status. |
|
string |
Session use. |
|
string |
Session visibility. |
|
boolean |
Whether to pin it to the top. |
|
string |
Recent message ID; does not return if there is no message yet. |
|
string |
Current active task ID; does not return if there is no active task. |
|
string |
Last message time; does not return if there is no message yet. |
|
string |
Creation and last update times, in RFC 3339 format. |
|
string |
Creation and last update times, in RFC 3339 format. |
Error response¶
{
"code": 3,
"message": "会话不存在"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The path parameter or agent query parameter is empty, contains disallowed path separators, or the agent workspace is outside the allowed range. |
Check the session IDs, |
|
|
The session does not exist, is not visible, or does not belong to the specified agent scope. |
Confirm the session ID and filter conditions; remove the agent filter if necessary and try again. |
|
|
The server cannot read the session or generate agent display information. |
Record the request time and error message and try again. |
|
|
Session service is temporarily unavailable. |
Try again later. |
Follow-up operations¶
Use Query session messages to read the saved messages in the conversation, or use Update session to modify the title, status and pinned status.