Query the automation task list¶
Query the automated tasks that can be read in the current workspace. The results support filtering by agent, status, triggering method and keywords.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-automation-tasks
Preparation before calling¶
Prepare a personal access token and target workspace ID that has 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: The workspace ID to be queried, passed through theX-Workspace-IDHeader, and asworkspace_idin the path.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-automation-tasks?status=active&limit=20&offset=0" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Workspace ID. |
Query parameters¶
When limit or offset is not provided, the service returns 50 records by default and starts from record 0; the maximum value for limit is 200.
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Filter by one or more agent IDs. |
|
string |
No |
The workspace to which the agent belongs. |
|
string |
No |
Filter by task status. |
|
string |
No |
Filter by trigger, such as |
|
string |
No |
Search by task information. |
|
integer |
No |
Return the quantity. |
|
integer |
No |
Returns the starting position of the list. |
Successful response¶
Returns 200 on success. data.items is the task list, data.total is the total number of matches; when the agent associated with the task is still readable, agent_summary is also returned.
{
"code": 0,
"data": {
"items": [
{
"id": "task_01",
"workspace_id": "ws_01",
"name": "每日摘要",
"agent_id": "agent_01",
"trigger": {
"mode": "cron"
},
"status": "active",
"version": 1,
"agent_summary": {
"id": "agent_01",
"workspace_id": "ws_01",
"name": "摘要助手",
"status": "active"
}
}
],
"total": 1,
"limit": 50,
"offset": 0
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
array |
Readable automation tasks. |
|
string |
Task, workspace, and target agent identifiers. |
|
string |
Task, workspace, and target agent identifiers. |
|
string |
Task, workspace, and target agent identifiers. |
|
string |
Task name, trigger configuration, status and version. |
|
object |
Task name, trigger configuration, status and version. |
|
string |
Task name, trigger configuration, status and version. |
|
integer |
Task name, trigger configuration, status and version. |
|
object |
Summary of the target agent returned when it can be read. |
|
integer |
Total number of matches, current page size, and offset. |
|
integer |
Total number of matches, current page size, and offset. |
|
integer |
Total number of matches, current page size, and offset. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Check query parameters. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to read the associated agent. |
Check workspace and agent authorizations. |
|
|
Automation task service, permission filtering or agent summary projection dependencies are not available. |
Try again later. |
Follow-up operations¶
Save the id of the target task, and then Query automation task details.