根据 ID 获取 Forward Template。
GET /api/v1/forward/templates/{template_id}
返回完整 Template 对象,包括 Agent 配置和 Session 默认配置。
请求头
| Header | 是否必填 | 说明 |
|---|---|---|
| Authorization | 是 | Bearer <PAT 或 SAT> |
路径参数
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| template_id | string | 是 | Forward Template ID。 |
示例请求
示例响应
HTTP 200 OK
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
| type | string | 固定为 template。 |
| id | string | Template ID。 |
| name | string | Template 名称。 |
| status | string | Template 状态。 |
| model | string | object | 模型标识。可为模型 ID string,或包含 id 及可选调优字段的 Agent model object。 |
| vaults | object | 默认 Vault 配置,按 Vault ID 组织。 |
| github_repositories | object | 默认 GitHub 仓库配置;包含规范化后的 url 和最终 mount_path,不包含 authorization_token。 |
| metadata | object | 自定义元数据。 |
错误
| HTTP | Type | Code | 触发条件 |
|---|---|---|---|
| 404 | not_found_error | - | Template 不存在或当前调用方不可见。 |
| 401 | authentication_error | authentication_required | PAT 或 SAT 无效或已过期。 |
| 403 | permission_error | - | 当前调用方无权访问该资源。 |
备注
- 归档后的 Template 仍可通过详情接口查询。
- 响应不额外暴露运行时私有字段。
github_repositories.*.authorization_token是 write-only 字段,始终从响应中省略。