Query the list of agent task templates¶
Query the agent task templates in the workspace and filter by associated agent, status or name.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-task-templates
Before you call¶
Prepare a personal access token and 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: Target workspace ID, also asworkspace_idin the path.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-task-templates?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 |
The target workspace ID. |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
The associated agent ID. |
|
string |
No |
Template status. |
|
string |
No |
Filter by template name or description. |
|
integer |
No |
Return the quantity. |
|
integer |
No |
Return to the starting position. |
Successful response¶
Returns 200 and the template summary of the current page on success.
{
"code": 0,
"data": {
"items": [{"id": "template_01", "agent_id": "agent_01", "name": "摘要任务"}],
"total": 1,
"limit": 20,
"offset": 0
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
array |
The task template of the current page. |
|
string |
Template ID. |
|
string |
Associated agent ID. |
|
string |
Template name. |
|
integer |
The total number of matches. |
|
integer |
Current page size. |
|
integer |
Current page offset. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{"code": 2, "message": "invalid agent task template filter"}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid filter or paging parameters. |
Check query parameters. |
|
|
Lack of valid identity credentials. |
Check API Key. |
Follow-up operations¶
Record data.items[].id, and then Query the details of the agent task template.