List workspaces¶
List the workspaces that the current identity can access. Results can be filtered by name.
GET https://moi.matrixorigin.cn/newmoi/workspaces
Before you call this API¶
Prepare a personal access token.
The following example uses:
$AI_STUDIO_API_KEY: Your personal access token, passed in theX-API-Keyheader.$WORKSPACE_NAME: An optional workspace-name filter, passed through thenamequery parameter.
Request example¶
curl --get "https://moi.matrixorigin.cn/newmoi/workspaces" \
--data-urlencode "name=$WORKSPACE_NAME" \
-H "X-API-Key: $AI_STUDIO_API_KEY"
Query parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Filters results by workspace name. |
Successful response¶
On success, the API returns 200. data.workspaces contains the workspaces that the current identity can access. If no workspace matches, it is an empty array.
{
"code": "OK",
"msg": "OK",
"data": {
"workspaces": [
{
"id": "ws_01",
"name": "Analytics workspace",
"status": "active",
"owner_id": "user_01",
"created_at": "2026-08-01T09:00:00Z",
"access_status": "active",
"invitation_id": ""
}
],
"total": 1
}
}
Response fields:
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
array |
Workspace list. It is an empty array when there are no matches. |
|
string |
Workspace ID. |
|
string |
Workspace name. |
|
string |
Current workspace status. |
|
string |
User ID of the workspace owner. |
|
string |
Time when the workspace was created. |
|
string |
The current identity’s access status for the workspace. |
|
string |
Invitation ID for the current identity; an empty string if there is no invitation. |
|
integer |
Number of returned workspaces. |
In field paths, [] denotes each item in an array. For example, data.workspaces[].id is the id field of each item in the data.workspaces array.
Error response¶
{
"code": "ErrWorkspaceListFailed",
"msg": "Failed to list workspaces",
"data": null
}
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
|
|
Credentials are missing or invalid. |
Check the personal access token. |
|
|
The current identity has not been synchronized or cannot access workspaces. |
Complete account synchronization, or ask an administrator for access before retrying. |
|
|
The query parameter is invalid. |
Check the |
|
|
A dependent service is temporarily unavailable. |
Retry later. |
|
|
The service could not list workspaces. |
Record the request time and error message, then retry. |