Skip to main content

暂停 Deployment

暂停指定 Deployment,停止定时触发。

前提

已完成 Endpoint 与鉴权配置,详见API 总览与认证。

接口

POST /deployments/{deployment_id}/pause

路径参数

deployment_id string (必选)Deployment ID

请求示例

curl -X POST "$AGENTSTUDIO_URL/deployments/depl_xxx/pause" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"

响应字段

id stringDeployment IDtype string固定为 deploymentname stringDeployment 名称description stringDeployment 用途说明agent object关联 Agent 在锁定版本的快照environment_id string关联 Environment IDschedule object定时触发配置。暂停后 next_run_at 为 nullinitial_events array<object>触发时发送给 Agent 的初始事件resources array<object>挂载的文件资源vault_ids array<string>关联 Vault ID 列表metadata object业务自定义键值对status string此操作后固定为 pausedpaused_reason object暂停原因archived_at string | null归档时间,未归档时为 nullcreated_at string创建时间,ISO 8601updated_at string最近更新时间,ISO 8601request_id string请求唯一标识

响应

{
  "id": "depl_xxx",
  "type": "deployment",
  "name": "每日订单汇总",
  "status": "paused",
  "agent": {
    "id": "agent_xxx",
    "version": 12
  },
  "environment_id": "env_xxx",
  "schedule": {
    "type": "cron",
    "expression": "0 9 * * 1-5",
    "timezone": "Asia/Shanghai",
    "last_run_at": null,
    "next_run_at": null
  },
  "initial_events": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "汇总昨日订单数据"
        }
      ]
    }
  ],
  "resources": [],
  "vault_ids": [],
  "metadata": {},
  "paused_reason": {
    "type": "manual"
  },
  "archived_at": null,
  "created_at": "2026-07-28T01:00:00Z",
  "updated_at": "2026-07-28T01:00:00Z",
  "request_id": "req_xxx"
}

错误码

状态码错误码说明
400InvalidParameterRequired parameter missing or invalid.
401InvalidApiKeyInvalid API-key provided.
409DEPLOYMENT_STATE_CONFLICTCannot pause an archived deployment.