> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取 Template 详情

> 根据 ID 获取 Forward Template。

`GET /api/v1/forward/templates/{template_id}`

返回完整 Template 对象，包括 Agent 配置和 Session 默认配置。

## 请求头

| Header        | 是否必填 | 说明             |
| ------------- | ---- | -------------- |
| Authorization | 是    | `Bearer <PAT>` |

## 路径参数

| 参数           | 类型     | 是否必填 | 说明                   |
| ------------ | ------ | ---- | -------------------- |
| template\_id | string | 是    | Forward Template ID。 |

## 示例请求

```bash theme={null}
curl -s -X GET 'https://api.qoder.com/api/v1/forward/templates/tmpl_support' \
  -H "Authorization: Bearer $QODER_PAT"
```

## 示例响应

**HTTP 200 OK**

```json theme={null}
{
  "type": "template",
  "id": "tmpl_support",
  "name": "Support assistant",
  "description": "Handles customer support requests",
  "status": "active",
  "model": "ultimate",
  "system": "You are a helpful support assistant.",
  "tools": [],
  "mcp_servers": [],
  "skills": [],
  "environment_id": "env_support",
  "vault_ids": [
    "vault_crm"
  ],
  "files": {},
  "environment_variables": {
    "BASE_MODE": "support"
  },
  "metadata": {},
  "created_at": "2026-06-18T10:00:00Z",
  "updated_at": "2026-06-18T10:00:00Z"
}
```

## 响应字段

| 字段       | 类型     | 说明              |
| -------- | ------ | --------------- |
| type     | string | 固定为 `template`。 |
| id       | string | Template ID。    |
| name     | string | Template 名称。    |
| status   | string | Template 状态。    |
| model    | string | 模型标识。           |
| metadata | object | 自定义元数据。         |

## 错误

| HTTP | Type                   | Code                      | 触发条件                   |
| ---- | ---------------------- | ------------------------- | ---------------------- |
| 404  | `not_found_error`      | -                         | Template 不存在或当前调用方不可见。 |
| 401  | `authentication_error` | `authentication_required` | PAT 无效或已过期。            |
| 403  | `permission_error`     | -                         | 当前调用方无权访问该资源。          |

## 注意事项

* 归档后的 Template 仍可通过详情接口查询。
* 响应不额外暴露运行时私有字段。

## 相关

<CardGroup cols={2}>
  <Card title="更新 Template" icon="pencil" href="/cloud-agents/api/forward/templates/update" />

  <Card title="归档 Template" icon="archive" href="/cloud-agents/api/forward/templates/archive" />
</CardGroup>
