更新计划
curl --request PATCH \
--url https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bypass_approval": true,
"enabled": true,
"frequency": "<string>",
"interval_count": 123,
"name": "<string>",
"platform": "<string>",
"playbook_id": "<string>",
"prompt": "<string>",
"run_as_user_id": "<string>",
"scheduled_at": "2023-11-07T05:31:56Z",
"slack_channel_id": "<string>",
"slack_team_id": "<string>",
"tags": [
"<string>"
],
"target_devin_id": "<string>"
}
'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}"
payload = {
"bypass_approval": True,
"enabled": True,
"frequency": "<string>",
"interval_count": 123,
"name": "<string>",
"platform": "<string>",
"playbook_id": "<string>",
"prompt": "<string>",
"run_as_user_id": "<string>",
"scheduled_at": "2023-11-07T05:31:56Z",
"slack_channel_id": "<string>",
"slack_team_id": "<string>",
"tags": ["<string>"],
"target_devin_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bypass_approval: true,
enabled: true,
frequency: '<string>',
interval_count: 123,
name: '<string>',
platform: '<string>',
playbook_id: '<string>',
prompt: '<string>',
run_as_user_id: '<string>',
scheduled_at: '2023-11-07T05:31:56Z',
slack_channel_id: '<string>',
slack_team_id: '<string>',
tags: ['<string>'],
target_devin_id: '<string>'
})
};
fetch('https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'bypass_approval' => true,
'enabled' => true,
'frequency' => '<string>',
'interval_count' => 123,
'name' => '<string>',
'platform' => '<string>',
'playbook_id' => '<string>',
'prompt' => '<string>',
'run_as_user_id' => '<string>',
'scheduled_at' => '2023-11-07T05:31:56Z',
'slack_channel_id' => '<string>',
'slack_team_id' => '<string>',
'tags' => [
'<string>'
],
'target_devin_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}"
payload := strings.NewReader("{\n \"bypass_approval\": true,\n \"enabled\": true,\n \"frequency\": \"<string>\",\n \"interval_count\": 123,\n \"name\": \"<string>\",\n \"platform\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"prompt\": \"<string>\",\n \"run_as_user_id\": \"<string>\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"slack_channel_id\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"target_devin_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bypass_approval\": true,\n \"enabled\": true,\n \"frequency\": \"<string>\",\n \"interval_count\": 123,\n \"name\": \"<string>\",\n \"platform\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"prompt\": \"<string>\",\n \"run_as_user_id\": \"<string>\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"slack_channel_id\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"target_devin_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bypass_approval\": true,\n \"enabled\": true,\n \"frequency\": \"<string>\",\n \"interval_count\": 123,\n \"name\": \"<string>\",\n \"platform\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"prompt\": \"<string>\",\n \"run_as_user_id\": \"<string>\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"slack_channel_id\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"target_devin_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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>",
"org_id": "<string>",
"playbook": {
"playbook_id": "<string>",
"title": "<string>"
},
"prompt": "<string>",
"scheduled_session_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"bypass_approval": false,
"interval_count": 1,
"last_edited_by": "<string>",
"platform": "<string>",
"schedule_type": "recurring",
"scheduled_at": "2023-11-07T05:31:56Z",
"slack_channel_id": "<string>",
"slack_team_id": "<string>",
"tags": [
"<string>"
],
"target_devin_id": "<string>"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}计划(组织)
更新计划
更新现有计划。
PATCH
/
v3
/
organizations
/
{org_id}
/
schedules
/
{schedule_id}
更新计划
curl --request PATCH \
--url https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bypass_approval": true,
"enabled": true,
"frequency": "<string>",
"interval_count": 123,
"name": "<string>",
"platform": "<string>",
"playbook_id": "<string>",
"prompt": "<string>",
"run_as_user_id": "<string>",
"scheduled_at": "2023-11-07T05:31:56Z",
"slack_channel_id": "<string>",
"slack_team_id": "<string>",
"tags": [
"<string>"
],
"target_devin_id": "<string>"
}
'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}"
payload = {
"bypass_approval": True,
"enabled": True,
"frequency": "<string>",
"interval_count": 123,
"name": "<string>",
"platform": "<string>",
"playbook_id": "<string>",
"prompt": "<string>",
"run_as_user_id": "<string>",
"scheduled_at": "2023-11-07T05:31:56Z",
"slack_channel_id": "<string>",
"slack_team_id": "<string>",
"tags": ["<string>"],
"target_devin_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bypass_approval: true,
enabled: true,
frequency: '<string>',
interval_count: 123,
name: '<string>',
platform: '<string>',
playbook_id: '<string>',
prompt: '<string>',
run_as_user_id: '<string>',
scheduled_at: '2023-11-07T05:31:56Z',
slack_channel_id: '<string>',
slack_team_id: '<string>',
tags: ['<string>'],
target_devin_id: '<string>'
})
};
fetch('https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'bypass_approval' => true,
'enabled' => true,
'frequency' => '<string>',
'interval_count' => 123,
'name' => '<string>',
'platform' => '<string>',
'playbook_id' => '<string>',
'prompt' => '<string>',
'run_as_user_id' => '<string>',
'scheduled_at' => '2023-11-07T05:31:56Z',
'slack_channel_id' => '<string>',
'slack_team_id' => '<string>',
'tags' => [
'<string>'
],
'target_devin_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}"
payload := strings.NewReader("{\n \"bypass_approval\": true,\n \"enabled\": true,\n \"frequency\": \"<string>\",\n \"interval_count\": 123,\n \"name\": \"<string>\",\n \"platform\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"prompt\": \"<string>\",\n \"run_as_user_id\": \"<string>\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"slack_channel_id\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"target_devin_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bypass_approval\": true,\n \"enabled\": true,\n \"frequency\": \"<string>\",\n \"interval_count\": 123,\n \"name\": \"<string>\",\n \"platform\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"prompt\": \"<string>\",\n \"run_as_user_id\": \"<string>\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"slack_channel_id\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"target_devin_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/schedules/{schedule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bypass_approval\": true,\n \"enabled\": true,\n \"frequency\": \"<string>\",\n \"interval_count\": 123,\n \"name\": \"<string>\",\n \"platform\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"prompt\": \"<string>\",\n \"run_as_user_id\": \"<string>\",\n \"scheduled_at\": \"2023-11-07T05:31:56Z\",\n \"slack_channel_id\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"target_devin_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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>",
"org_id": "<string>",
"playbook": {
"playbook_id": "<string>",
"title": "<string>"
},
"prompt": "<string>",
"scheduled_session_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"bypass_approval": false,
"interval_count": 1,
"last_edited_by": "<string>",
"platform": "<string>",
"schedule_type": "recurring",
"scheduled_at": "2023-11-07T05:31:56Z",
"slack_channel_id": "<string>",
"slack_team_id": "<string>",
"tags": [
"<string>"
],
"target_devin_id": "<string>"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}权限
ManageOrgSchedules 权限的服务账号。
注意事项
enabled 设置为 false。
将 playbook_id 设置为 null 会清除关联的 playbook。
你可以在 recurring 和 one_time 之间更改 schedule_type。当更改为 one_time 时,请提供 scheduled_at,其值必须是将来的 ISO 8601 日期时间。 当更改为 recurring 时,请提供 frequency,其值为有效的 cron 表达式。
执行身份
run_as_user_id 参数控制计划任务以哪个用户身份运行。计划任务被触发时,会在该用户下创建会话——该用户会收到通知,并且该会话会出现在其会话历史中。
- 设置用户:提供一个有效的用户 ID 来更改执行身份。需要满足:
- 服务用户必须具有
ImpersonateOrgSessions权限 - 目标用户必须是该组织的成员
- 目标用户必须具有
UseDevinSessions权限
- 服务用户必须具有
- 清除 (设置为
null) :将计划任务恢复为以默认 bot 用户身份运行 - 省略该字段:保持当前执行身份不变
授权
服务用户凭据(前缀:cog_)
路径参数
计划 ID(前缀:sched-)
示例:
"sched-abc123def456"
组织 ID(前缀:org-)
示例:
"org-abc123def456"
请求体
application/json
可用选项:
devin, data_analyst 可用选项:
always, failure, never 此计划创建的 session 所使用的 VM 平台(例如 'windows')。省略时,平台保持不变。该值必须与为组织配置的平台匹配(不区分大小写);未知值会被拒绝,并返回 400,同时列出可用的平台标签。
设置此计划将以哪个用户 ID 运行。需要 ImpersonateOrgSessions 权限。设为 null 会恢复为默认机器人用户。省略该字段则保持当前身份不变。
可用选项:
recurring, one_time 响应
成功响应
可用选项:
devin, data_analyst 可用选项:
always, failure, never Show child attributes
Show child attributes
可用选项:
recurring, one_time ⌘I

