Skip to main content
Schedules

获取 Schedule

根据 ID 获取 Forward Schedule。

GET /api/v1/forward/schedules/{schedule_id} 返回完整 Schedule 对象;归档 Schedule 仍可通过 ID 查询。

请求头

Header是否必填说明
Authorization是Bearer <PAT 或 SAT>

路径参数

参数类型是否必填说明
schedule_idstring是Forward Schedule ID。

示例请求

curl -s -X GET 'https://api.qoder.com/api/v1/forward/schedules/sched_019f00112233445566778899aabbccdd' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"

示例响应

HTTP 200 OK
{
  "id": "sched_019f00112233445566778899aabbccdd",
  "source": "api",
  "source_session_id": null,
  "identity_id": "idn_019eabc123",
  "template_id": "tmpl_support",
  "name": "Daily tech brief",
  "description": "Generate a daily technology news summary",
  "status": "active",
  "resources": [
    {
      "type": "file",
      "file_id": "file_news_sources",
      "mount_path": "/data/news-sources.csv"
    }
  ],
  "initial_events_version": 1,
  "initial_events": [
    {
      "type": "user.message",
      "content": "Read /data/news-sources.csv and summarize current technology news in five bullet points."
    }
  ],
  "execution": {
    "session_mode": "new_session",
    "max_concurrent_runs": 1,
    "max_attempts": 2,
    "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": [
    {
      "type": "im_channel",
      "channel_id": "channel_xxx",
      "target": {
        "type": "user",
        "external_id": "536769"
      }
    }
  ],
  "metadata": {},
  "created_at": "2026-06-22T10:00:00Z",
  "updated_at": "2026-06-22T10:00:00Z"
}

响应字段

返回完整 Schedule 对象。

错误

HTTPTypeCode触发条件
404not_found_errorschedule_not_foundSchedule 不存在或不属于当前 owner;同一 owner 内的 Identity-bound SAT 越权见 identity_mismatch。
401authentication_error-PAT 或 SAT 无效或已过期。
403permission_erroridentity_mismatchIdentity-bound SAT 请求或操作其绑定 Identity 之外的 Schedule。

备注

  • status 只表达 active 或 paused;归档状态通过 archived_at 表达。
  • Schedule 对象不暴露 Vault、Memory Store、原始环境变量等运行时私有字段。
  • resources 始终为数组,仅包含 Schedule 自身文件配置,按 file_id 排序;未配置时为 []。它不展开 Template / Identity Config 的继承文件,详见文件资源。

相关