跳转到主要内容
PATCH
/
v3beta1
/
organizations
/
{org_id}
/
schedules
/
{schedule_id}
更新计划
curl --request PATCH \
  --url https://api.devin.ai/v3beta1/organizations/{org_id}/schedules/{schedule_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent": "devin",
  "enabled": true,
  "frequency": "<string>",
  "name": "<string>",
  "notify_on": "always",
  "playbook_id": "<string>",
  "prompt": "<string>"
}
'
{
  "agent": "devin",
  "consecutive_failures": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "created_by": "<string>",
  "enabled": true,
  "frequency": "<string>",
  "last_error_at": "2023-11-07T05:31:56Z",
  "last_error_message": "<string>",
  "last_executed_at": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "notify_on": "always",
  "org_id": "<string>",
  "playbook": {
    "playbook_id": "<string>",
    "title": "<string>"
  },
  "prompt": "<string>",
  "scheduled_session_id": "<string>",
  "updated_at": "2023-11-07T05:31:56Z"
}

权限

需要在组织级别拥有 ManageOrgSchedules 权限的服务账号。

注意事项

所有字段均为可选。只有在请求体中提供的字段才会被更新。若要禁用某个计划任务,请将 enabled 设置为 false playbook_id 设置为 null 会清除其关联的 playbook。

授权

Authorization
string
header
必填

服务用户凭据(前缀:cog_)

路径参数

schedule_id
string
必填

请求体

application/json
agent
enum<string> | null
可用选项:
devin,
data_analyst,
advanced
enabled
boolean | null
frequency
string | null
name
string | null
notify_on
enum<string> | null
可用选项:
always,
failure,
never
playbook_id
string | null
prompt
string | null

响应

成功响应

agent
enum<string>
必填
可用选项:
devin,
data_analyst,
advanced
consecutive_failures
integer
必填
created_at
string<date-time>
必填
created_by
string | null
必填
enabled
boolean
必填
frequency
string
必填
last_error_at
string<date-time> | null
必填
last_error_message
string | null
必填
last_executed_at
string<date-time> | null
必填
name
string
必填
notify_on
enum<string>
必填
可用选项:
always,
failure,
never
org_id
string
必填
playbook
PlaybookInfo · object
必填
prompt
string
必填
scheduled_session_id
string
必填
updated_at
string<date-time>
必填