Query session list¶
Query the visible sessions in the workspace. It can be filtered by agent, status, purpose or top status, and can be read in sections through paging parameters.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/conversations
Preparation before calling¶
Prepare a personal access token and target workspace ID that has access to the target workspace. If you need to filter by agent, first obtain the agent ID.
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.$AGENT_ID: Optional agent filter ID.
Request example¶
curl --get "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/conversations" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "agent_id=$AGENT_ID" \
--data-urlencode "status=active" \
--data-urlencode "limit=20" \
--data-urlencode "offset=0"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID, must be consistent with |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Only return sessions for the specified agent. |
|
string |
No |
ID of the workspace to which the agent belongs. When |
|
string |
No |
Filter by session status. |
|
string |
No |
Filter by session purpose, can be |
|
boolean |
No |
If it is |
|
string |
No |
Accepts only |
|
string |
No |
Filter by parent session ID. |
|
integer |
No |
Single return quantity. |
|
integer |
No |
Returns the offset. |
Successful response¶
Returns 200 on success. data.items is the session of this page, data.total is the total number of filter results, data.limit and data.offset are the paging values actually used this time.
{
"code": 0,
"data": {
"items": [
{
"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": false,
"created_at": "2026-01-02T15:04:05Z",
"updated_at": "2026-01-02T15:04:05Z"
}
],
"total": 1,
"limit": 20,
"offset": 0
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
object[] |
Session list on this page. |
|
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 |
Summary of agent display. |
|
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. |
|
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. |
|
string |
Creation and last update times, in RFC 3339 format. |
|
string |
Creation and last update times, in RFC 3339 format. |
|
integer |
The total number of sessions that meet the filter criteria. |
|
integer |
The upper limit of the actual return quantity used this time. |
|
integer |
The offset actually used this time. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 2,
"message": "请求参数无效",
"details": {
"cause": "invalid runtime conversation"
}
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid agent ID, workspace ID, purpose, visibility, or paging parameters. |
Check query parameters; |
|
|
The server cannot query the session or generate session display information. |
Record the request time and error message and try again. |
|
|
Session service is temporarily unavailable. |
Try again later. |
Follow-up operations¶
Use the returned data.items[].id to call Query session details or Query session messages.