跳转到主要内容
POST /v1/deployments/{id}/run 手动触发一次 Deployment 运行。Deployment 必须处于 active 状态(非暂停或已归档)。如果并发运行数已达上限,运行将以 skipped 状态记录。

路径参数

参数类型说明
idstringDeployment ID(dep_ 前缀)

请求头

头部必选说明
AuthorizationBearer <PAT>
Content-Typeapplication/json

请求体

无需请求体。可发送空 JSON {} 或省略。

示例请求

curl -X POST "https://api.qoder.com/api/v1/cloud/deployments/dep_019ec55a2b687b3f94eee77dd77e4b2a/run" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json"

示例响应

HTTP 200 OK 返回 Deployment Run 对象。
{
  "agent": {
    "id": "agent_019ebb21ef8e7df6a559052c94875160",
    "type": "agent",
    "version": 1
  },
  "cas_run_extras": {
    "attempt": 1,
    "started_at": "2026-06-14T08:58:17.165588936Z",
    "turn_id": "turn_019ec55a68b87a9dafad75c1554d1102"
  },
  "created_at": "2026-06-14T08:58:17.133340942Z",
  "deployment_id": "dep_019ec55a2b687b3f94eee77dd77e4b2a",
  "error": null,
  "id": "drun_019ec55a68af73028afa5b87931cb2f3",
  "session_id": "sess_019ec55a68b37e1e8d660691af161ab4",
  "status": "running",
  "trigger_context": {
    "type": "manual"
  },
  "triggered_at": "2026-06-14T08:58:17.133340942Z",
  "type": "deployment_run"
}

响应字段(Deployment Run)

字段类型说明
idstringRun 唯一标识(drun_ 前缀)
typestring固定值 "deployment_run"
deployment_idstring所属 Deployment ID
agentobjectAgent 引用:{id, type, version}
statusstring运行状态:pendingrunningcompletedfailedskipped
errorobject 或 null失败时的错误详情({message, type}),成功时为 null
trigger_contextobject触发来源:{"type": "manual"}{"type": "schedule"}{"type": "retry"}
session_idstring关联的 Session ID(session 创建后出现)
completed_atstring完成时间(ISO 8601,终态时出现)
duration_msinteger运行时长(毫秒,completed 时出现)
cas_run_extrasobjectCAS 特有元数据:attemptturn_idstarted_at
triggered_atstring触发时间(ISO 8601)
created_atstring记录创建时间(ISO 8601)

错误码

HTTPtype触发条件
401authentication_errorPAT 无效或过期
404not_found_errorDeployment 不存在
409conflict_errorDeployment 已归档或不在 active 状态
完整错误信封说明详见 错误参考

相关

获取 Deployment Run

查看单次运行的状态与 Session ID。

列出 Deployment Run

查看该 Deployment 的运行历史。

列出所有 Run

跨 Deployment 查询所有运行记录。

获取 Deployment

查看 Deployment 配置与下次调度时间。