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

# 列出 Schedule Runs

> 分页列出 Schedule Run 执行记录。

`GET /api/v1/forward/schedule_runs`

查询某个 Identity 下的 Schedule Run；传入 `schedule_id` 可收敛到单个 Schedule。

## 请求头

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

## 查询参数

| 参数            | 类型      | 是否必填 | 默认值 | 说明                                                         |
| ------------- | ------- | ---- | --- | ---------------------------------------------------------- |
| identity\_id  | string  | 是    | -   | Run 所属 Forward Identity ID。                                |
| schedule\_id  | string  | 否    | -   | 按 Schedule ID 过滤。                                          |
| status        | string  | 否    | -   | 按 `pending`、`running`、`completed`、`failed` 或 `skipped` 过滤。 |
| trigger\_type | string  | 否    | -   | 按 `schedule` 或 `manual` 过滤。                                |
| has\_error    | boolean | 否    | -   | 是否只返回有错误或无错误的 Run。                                         |
| limit         | integer | 否    | 20  | 分页大小，最大 100。                                               |
| after\_id     | string  | 否    | -   | 向后翻页游标。                                                    |
| before\_id    | string  | 否    | -   | 向前翻页游标。                                                    |

## 示例请求

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

## 示例响应

**HTTP 200 OK**

```json theme={null}
{
  "data": [
    {
      "id": "srun_019f00112233445566778899aabbccdd",
      "schedule_id": "sched_019f00112233445566778899aabbccdd",
      "identity_id": "idn_019eabc123",
      "template_id": "tmpl_support",
      "session_id": "sess_019ec55a68b37e1e8d660691af161ab4",
      "status": "completed",
      "trigger_context": {
        "type": "schedule",
        "scheduled_at": "2026-06-22T01:00:00Z"
      },
      "result_payload": "Today's technology highlights: ...",
      "push_sink": "im_channel",
      "push_status": "succeeded",
      "push_finished_at": "2026-06-22T01:00:21Z",
      "attempt": 1,
      "triggered_at": "2026-06-22T01:00:00Z",
      "started_at": "2026-06-22T01:00:03Z",
      "completed_at": "2026-06-22T01:00:20Z",
      "duration_ms": 17000,
      "created_at": "2026-06-22T01:00:00Z"
    }
  ],
  "first_id": "srun_019f00112233445566778899aabbccdd",
  "last_id": "srun_019f00112233445566778899aabbccdd",
  "has_more": false
}
```

## 响应字段

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

`data[]` 中每一项都是 Schedule Run 对象，字段与 Get Schedule Run 一致，包括 `trigger_context`、`error`、`push_sink`、`push_status` 和执行时间字段。

## 错误

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

## 注意事项

* Schedule Run 是独立资源。
* `completed`、`failed` 和 `skipped` 是终态。
* `push_status` 表达 IM 流式投递状态，和主流程 `status` 相互独立。

## 相关

<CardGroup cols={2}>
  <Card title="运行 Schedule" icon="play" href="/cloud-agents/api/forward/schedules/run" />

  <Card title="获取 Schedule Run" icon="file-lines" href="/cloud-agents/api/forward/schedule-runs/get" />
</CardGroup>
