Skip to main content
POST
创建计划

权限

需要在组织级别具备 ManageOrgSchedules 权限的服务用户。

计划类型

schedule_type 字段用于控制计划是周期性执行还是一次性执行:
  • recurring(默认)— 必须提供 frequency 字段,其值为 cron 表达式
  • one_time — 必须提供 scheduled_at 字段,其值为将来的 ISO 8601 日期时间

频率

对于重复执行的计划,frequency 字段采用标准的 cron 表达式(例如,0 9 * * 1-5 表示在每周一至周五的 UTC 时间上午 9 点运行)。

计划时间

对于一次性计划任务,scheduled_at 字段接受带有时区的 ISO 8601 格式日期时间(例如 2026-03-01T09:00:00Z)。该日期时间必须是将来的时间。执行完成后,该计划会自动被禁用。

Agent 类型

用户模拟

create_as_user_id 参数允许代表另一位用户创建日程。要使用该功能,需要满足以下条件:
  1. 服务账号必须具有 ImpersonateOrgSessions 权限
  2. 目标用户必须是该组织的成员
  3. 目标用户必须具有 UseDevinSessions 权限

授权

Authorization
string
header
必填

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

路径参数

org_id
string
必填

组织 ID(前缀:org-)

示例:

"org-abc123def456"

请求体

application/json
name
string
必填
prompt
string
必填
agent
enum<string>
默认值:devin
可用选项:
devin,
data_analyst
bypass_approval
boolean
默认值:false
create_as_user_id
string | null
frequency
string | null
interval_count
integer
默认值:1
notify_on
enum<string>
默认值:failure
可用选项:
always,
failure,
never
platform
string | null

此计划生成的会话所使用的 VM 平台(例如“windows”)。如果省略,会话会在触发时回退到组织的默认平台。该值必须与为组织配置的平台之一匹配(不区分大小写);如果值未知,则会返回 400,并列出可用的平台标签。

playbook_id
string | null
schedule_type
enum<string>
默认值:recurring
可用选项:
recurring,
one_time
scheduled_at
string<date-time> | null
slack_channel_id
string | null
slack_team_id
string | null
tags
string[] | null
target_devin_id
string | null

响应

成功响应

agent
enum<string>
必填
可用选项:
devin,
data_analyst
consecutive_failures
integer
必填
created_at
string<date-time>
必填
created_by
string | null
必填
enabled
boolean
必填
frequency
string | null
必填
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 | null
必填
prompt
string
必填
scheduled_session_id
string
必填
updated_at
string<date-time>
必填
bypass_approval
boolean
默认值:false
interval_count
integer
默认值:1
last_edited_by
string | null
platform
string | null
schedule_type
enum<string>
默认值:recurring
可用选项:
recurring,
one_time
scheduled_at
string<date-time> | null
slack_channel_id
string | null
slack_team_id
string | null
tags
string[] | null
target_devin_id
string | null