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

# 列出 Resources

> 按类型列出已注册的 Forward Resource。

`GET /api/v1/forward/resources`

返回当前调用方拥有的资源。可见资源会附带实时 `resource_spec`。

## 请求头

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

## 查询参数

| 参数         | 类型      | 是否必填 | 默认值 | 说明                                           |
| ---------- | ------- | ---- | --- | -------------------------------------------- |
| type       | string  | 是    | -   | 资源类型：`skill`、`file`、`vault` 或 `environment`。 |
| limit      | integer | 否    | 20  | 分页大小，最大 100。                                 |
| after\_id  | string  | 否    | -   | 资源 ID 游标，返回其后的记录，不能与 `before_id` 同用。         |
| before\_id | string  | 否    | -   | 资源 ID 游标，返回其前的记录，不能与 `after_id` 同用。          |

## 示例请求

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

## 示例响应

**HTTP 200 OK**

```json theme={null}
{
  "data": [
    {
      "id": "skill_xxx",
      "type": "skill",
      "owner_type": "user",
      "owner_id": "usr_xxx",
      "resource_spec": {
        "name": "customer-reply-skill",
        "description": "Customer reply policy skill",
        "type": "skill",
        "status": "active",
        "skill_type": "custom",
        "created_at": "2026-06-24T07:51:38.276624Z",
        "updated_at": "2026-06-24T07:51:38.276624Z",
        "metadata": {}
      }
    }
  ],
  "first_id": "skill_xxx",
  "last_id": "skill_xxx",
  "has_more": false
}
```

## 响应字段

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

## Resource 对象字段

| 字段             | 类型     | 说明                                           |
| -------------- | ------ | -------------------------------------------- |
| id             | string | Resource ID，直接对齐资源 ID。                       |
| type           | string | 资源类型：`skill`、`file`、`vault` 或 `environment`。 |
| owner\_type    | string | 归属类型；本接口按 `owner_type=user` 过滤。              |
| owner\_id      | string | 当前调用方的资源拥有者 ID。                              |
| resource\_spec | object | 资源的扁平实时对象，字段集随 `type` 变化。                    |

## 错误

| HTTP | Type                    | Code                      | 触发条件                                       |
| ---- | ----------------------- | ------------------------- | ------------------------------------------ |
| 400  | `invalid_request_error` | -                         | 缺少资源 `type`。                               |
| 400  | `invalid_request_error` | -                         | 资源 `type` 不支持。                             |
| 400  | `invalid_request_error` | -                         | `limit` 越界，或同时提供 `after_id` 和 `before_id`。 |
| 401  | `authentication_error`  | `authentication_required` | PAT 无效或已过期。                                |

## 注意事项

* 已失效或不可见的资源会被跳过，因此 `data` 可能少于本地注册记录数。

## 相关

<CardGroup cols={2}>
  <Card title="注册 Resource" icon="plus" href="/cloud-agents/api/forward/resources/register" />

  <Card title="创建 Template" icon="file-plus" href="/cloud-agents/api/forward/templates/create" />
</CardGroup>
