查询智能体任务模板列表¶
查询工作区中的智能体任务模板,可按关联智能体、状态或名称筛选。
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agent-task-templates
调用前准备¶
准备可访问目标工作区的个人访问令牌和工作区 ID。
请求参数¶
curl "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/agent-task-templates?limit=20&offset=0" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
路径参数
参数 |
类型 |
是否必填 |
说明 |
|---|---|---|---|
|
string |
是 |
目标工作区 ID。 |
查询参数
参数 |
类型 |
是否必填 |
说明 |
|---|---|---|---|
|
string |
否 |
关联智能体 ID。 |
|
string |
否 |
模板状态。 |
|
string |
否 |
按模板名称或说明筛选。 |
|
integer |
否 |
返回数量。 |
|
integer |
否 |
返回起始位置。 |
成功响应¶
{
"code": 0,
"data": {
"items": [
{
"id": "template_01",
"workspace_id": "workspace_example",
"agent_id": "agent_01",
"name": "摘要任务",
"message_template": {
"role": "user",
"template": "请总结输入内容"
},
"idempotency_policy": {
"mode": "workflow_case"
},
"status": "draft",
"version": 1,
"created_at": "2026-10-14T00:00:00Z",
"updated_at": "2026-10-14T00:00:00Z"
}
],
"total": 1,
"limit": 20,
"offset": 0
}
}
字段 |
类型 |
说明 |
|---|---|---|
|
integer |
请求处理成功时为 |
|
object |
响应数据。 |
|
object(对象数组) |
本次返回的记录。 |
|
string |
对象 ID。 |
|
string |
所属工作区 ID。 |
|
string |
关联的智能体 ID。 |
|
string |
名称。 |
|
string |
说明。未设置时可省略。 |
|
object |
消息模板。 |
|
object |
输入参数的 JSON Schema。未设置时可省略。 |
|
object(对象数组) |
默认上下文资源引用。未设置时可省略。 |
|
string |
对象 ID。 |
|
string |
运行策略引用。未设置时可省略。 |
|
object |
幂等策略。 |
|
string |
策略或范围模式。取值: |
|
string |
自定义幂等键模板。未设置时可省略。 |
|
integer |
幂等窗口,单位为秒。未设置时可省略。 |
|
object |
输出约定。未设置时可省略。 |
|
string |
当前状态。取值: |
|
integer |
当前版本号。 |
|
object |
标签键值对。未设置时可省略。 |
|
object |
扩展注解。未设置时可省略。 |
|
string |
创建者标识。未设置时可省略。 |
|
string |
最近更新者标识。未设置时可省略。 |
|
string |
创建时间,采用 RFC 3339 格式。 |
|
string |
最近更新时间,采用 RFC 3339 格式。 |
|
integer |
符合条件的总记录数。 |
|
integer |
本次查询使用的记录数上限。 |
|
integer |
本次查询使用的偏移量。 |
|
string |
消息角色。 |
|
string |
消息模板文本。使用 parts 时可省略。 |
|
array 或 null |
结构化消息组成项,内容由模板保留。 |
|
object 或 null |
模板变量。 |
|
string |
上下文资源类型。 |
|
string |
资源地址。使用 id 时可省略。 |
|
string |
资源版本。未设置时省略。 |
|
object 或 null |
资源配置。未设置时省略。 |
错误响应¶
{
"code": 2,
"message": "invalid agent task template filter"
}
常见 HTTP 错误
HTTP 状态码 |
错误代码 |
说明 |
|---|---|---|
|
|
**常见原因:**筛选或分页参数无效。**建议操作:**检查查询参数。 |
|
|
**常见原因:**缺少有效身份凭据。**建议操作:**检查 API Key。 |