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

# 列出 Schedules

> 分页列出某个 Identity 下的 Forward Schedule。

`GET /api/v1/forward/schedules`

返回 Schedule 配置记录；归档 Schedule 默认不返回。

## 请求头

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

## 查询参数

| 参数                | 类型      | 是否必填 | 默认值   | 说明                               |
| ----------------- | ------- | ---- | ----- | -------------------------------- |
| identity\_id      | string  | 是    | -     | Schedule 所属 Forward Identity ID。 |
| template\_id      | string  | 否    | -     | 按 Forward Template ID 过滤。        |
| status            | string  | 否    | -     | 按 `active` 或 `paused` 过滤。        |
| include\_archived | boolean | 否    | false | 是否包含已归档 Schedule。                |
| limit             | integer | 否    | 20    | 分页大小，最大 100。                     |
| after\_id         | string  | 否    | -     | 向后翻页游标。                          |
| before\_id        | string  | 否    | -     | 向前翻页游标。                          |

## 示例请求

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

## 示例响应

**HTTP 200 OK**

```json theme={null}
{
  "data": [
    {
      "id": "sched_019f00112233445566778899aabbccdd",
      "identity_id": "idn_019eabc123",
      "template_id": "tmpl_support",
      "name": "Daily tech brief",
      "description": "Generate a daily technology news summary",
      "status": "active",
      "initial_events": [
        {
          "type": "user.message",
          "content": "Summarize current technology news in five bullet points."
        }
      ],
      "execution": {
        "session_mode": "new_session",
        "max_concurrent_runs": 1,
        "max_attempts": 1,
        "timeout_ms": 300000
      },
      "trigger_policy": {
        "type": "cron",
        "expression": "0 9 * * *",
        "timezone": "Asia/Shanghai",
        "upcoming_runs_at": [
          "2026-06-23T01:00:00Z"
        ]
      },
      "environment_id": "env_019e64e01a137caf953ac2ac7b42ec5c",
      "sinks": [],
      "metadata": {},
      "created_at": "2026-06-22T10:00:00Z",
      "updated_at": "2026-06-22T10:00:00Z"
    }
  ],
  "first_id": "sched_019f00112233445566778899aabbccdd",
  "last_id": "sched_019f00112233445566778899aabbccdd",
  "has_more": false
}
```

## 响应字段

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

## 错误

| HTTP | Type                    | Code                      | 触发条件                  |
| ---- | ----------------------- | ------------------------- | --------------------- |
| 400  | `invalid_request_error` | `invalid_identity`        | `identity_id` 缺失或不合法。 |
| 400  | `invalid_request_error` | `invalid_pagination`      | 分页参数不合法。              |
| 401  | `authentication_error`  | `authentication_required` | PAT 无效或已过期。           |

## 注意事项

* 结果按创建时间倒序返回。
* 归档记录仅在 `include_archived=true` 时返回。

## 相关

<CardGroup cols={2}>
  <Card title="创建 Schedule" icon="plus" href="/cloud-agents/api/forward/schedules/create" />

  <Card title="列出 Schedule Runs" icon="history" href="/cloud-agents/api/forward/schedule-runs/list" />
</CardGroup>
