> ## 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.

# 列出 Identity Configs

> 列出某个 Identity 下按 Template 维度保存的配置。

`GET /api/v1/forward/identities/{identity_id}/templates`

返回该 Identity 下 active 或 archived 的 Identity Config 记录。

## 请求头

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

## 路径参数

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

## 查询参数

| 参数           | 类型      | 是否必填 | 默认值    | 说明                          |
| ------------ | ------- | ---- | ------ | --------------------------- |
| template\_id | string  | 否    | -      | 按 Forward Template ID 过滤。   |
| status       | string  | 否    | active | 按 `active` 或 `archived` 过滤。 |
| limit        | integer | 否    | 20     | 分页大小，最大 100。                |
| after\_id    | string  | 否    | -      | 来自上一页响应 `last_id` 的向后游标。    |
| before\_id   | string  | 否    | -      | 来自上一页响应 `first_id` 的向前游标。   |

## 示例请求

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

## 示例响应

**HTTP 200 OK**

```json theme={null}
{
  "data": [
    {
      "type": "config",
      "id": "cfg_support",
      "identity_id": "idn_019eabc123",
      "template_id": "tmpl_support",
      "name": "CRM profile",
      "status": "active",
      "effective_hash": "sha256:...",
      "created_at": "2026-06-18T10:00:00Z",
      "updated_at": "2026-06-18T10:00:00Z"
    }
  ],
  "first_id": "cfg_support",
  "last_id": "cfg_support",
  "has_more": false
}
```

## 响应字段

| 字段        | 类型             | 说明                 |
| --------- | -------------- | ------------------ |
| data      | array          | 当前页的 Config 摘要。    |
| first\_id | string \| null | 当前页第一条 Config ID。  |
| last\_id  | string \| null | 当前页最后一条 Config ID。 |
| has\_more | boolean        | 是否还有更多记录。          |

## 错误

| HTTP | Type                    | Code                      | 触发条件                   |
| ---- | ----------------------- | ------------------------- | ---------------------- |
| 400  | `invalid_request_error` | -                         | 分页参数不合法。               |
| 404  | `not_found_error`       | -                         | Identity 不存在或当前调用方不可见。 |
| 401  | `authentication_error`  | `authentication_required` | PAT 无效或已过期。            |

## 注意事项

* 分页游标来自 Identity Config ID，不是 Template ID。
* 同一个 Identity + Template 下最多只有一条 active Config。

## 相关

<CardGroup cols={2}>
  <Card title="创建或更新 Identity Config" icon="gear" href="/cloud-agents/api/forward/identities/upsert-config" />

  <Card title="获取 Effective Config" icon="layer-group" href="/cloud-agents/api/forward/identities/effective" />
</CardGroup>
