查询智能体任务模板列表

查询工作区中的智能体任务模板,可按关联智能体、状态或名称筛选。

GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-task-templates

调用前准备

准备有目标工作区访问权限的个人访问令牌和工作区 ID。

请求参数

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"

路径参数

参数

类型

是否必填

说明

workspace_id

string

目标工作区 ID。

查询参数

参数

类型

是否必填

说明

agent_id

string

关联智能体 ID。

status

string

模板状态。

query

string

按模板名称或说明筛选。

limit

integer

返回数量。

offset

integer

返回起始位置。

成功响应

{
  "code": 0,
  "data": {
    "items": [{"id": "template_01", "agent_id": "agent_01", "name": "摘要任务"}],
    "total": 1,
    "limit": 20,
    "offset": 0
  }
}

成功时返回 200 和当前页的模板摘要。

响应字段如下。

本文中,字段路径中的 [] 表示数组中的每一项。例如,items[].name 表示 items 数组中每一项的 name 字段。

字段

类型

说明

code

integer

成功时为 0

字段

类型

说明

items

array

当前页的任务模板。

total

integer

匹配总数。

limit

integer

当前页大小。

offset

integer

当前页偏移量。

下面表格展开响应示例中的 items 数据;每一行是该对象或数组项的一个字段。

字段

类型

说明

id

string

模板 ID。

agent_id

string

关联智能体 ID。

name

string

模板名称。

错误响应

{"code": 2, "message": "invalid agent task template filter"}

常见 HTTP 错误

字段

类型

说明

400

2

**常见原因:**筛选或分页参数无效。**建议操作:**检查查询参数。

401

6

**常见原因:**缺少有效身份凭据。**建议操作:**检查 API Key。

后续操作

记录 data.items[].id,再查询智能体任务模板详情

最后更新于