curl --request POST \
--url https://api.devin.ai/v3/organizations/{org_id}/automations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
{
"prompt": "<string>",
"session": {
"bypass_approval": false,
"notifications": {
"slack": {
"channel_id": "<string>"
}
},
"platform": "<string>",
"playbook_id": "<string>",
"repos": [],
"tags": []
},
"type": "start_session"
}
],
"name": "<string>",
"run_as": {
"type": "organization"
},
"triggers": [
{
"conditions": {
"any": [
{
"all": [
{
"field": "<string>",
"value": "<string>"
}
]
}
]
},
"replies": []
}
],
"concurrency": {
"max_concurrent_runs": 2,
"max_queue_depth": 1
},
"enabled": true,
"limits": {
"invocations": {
"max_per_window": 2,
"window_seconds": 61
},
"max_acu_limit": 500
},
"metadata": {},
"notifications": {
"email": {
"recipients": [
"<string>"
]
},
"slack": {
"channel_id": "<string>"
}
},
"security_profile": {
"profile_id": "<string>"
},
"session_settings": {
"net_policy": {
"allow": [
{
"hostname": "<string>"
}
]
}
},
"template_id": "<string>",
"tools": {
"linear_enabled": true,
"mcp_servers": [],
"slack_channels": []
}
}
'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/automations"
payload = {
"actions": [
{
"prompt": "<string>",
"session": {
"bypass_approval": False,
"notifications": { "slack": { "channel_id": "<string>" } },
"platform": "<string>",
"playbook_id": "<string>",
"repos": [],
"tags": []
},
"type": "start_session"
}
],
"name": "<string>",
"run_as": { "type": "organization" },
"triggers": [
{
"conditions": { "any": [{ "all": [
{
"field": "<string>",
"value": "<string>"
}
] }] },
"replies": []
}
],
"concurrency": {
"max_concurrent_runs": 2,
"max_queue_depth": 1
},
"enabled": True,
"limits": {
"invocations": {
"max_per_window": 2,
"window_seconds": 61
},
"max_acu_limit": 500
},
"metadata": {},
"notifications": {
"email": { "recipients": ["<string>"] },
"slack": { "channel_id": "<string>" }
},
"security_profile": { "profile_id": "<string>" },
"session_settings": { "net_policy": { "allow": [{ "hostname": "<string>" }] } },
"template_id": "<string>",
"tools": {
"linear_enabled": True,
"mcp_servers": [],
"slack_channels": []
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
actions: [
{
prompt: '<string>',
session: {
bypass_approval: false,
notifications: {slack: {channel_id: '<string>'}},
platform: '<string>',
playbook_id: '<string>',
repos: [],
tags: []
},
type: 'start_session'
}
],
name: '<string>',
run_as: {type: 'organization'},
triggers: [
{
conditions: {any: [{all: [{field: '<string>', value: '<string>'}]}]},
replies: []
}
],
concurrency: {max_concurrent_runs: 2, max_queue_depth: 1},
enabled: true,
limits: {invocations: {max_per_window: 2, window_seconds: 61}, max_acu_limit: 500},
metadata: {},
notifications: {email: {recipients: ['<string>']}, slack: {channel_id: '<string>'}},
security_profile: {profile_id: '<string>'},
session_settings: {net_policy: {allow: [{hostname: '<string>'}]}},
template_id: '<string>',
tools: {linear_enabled: true, mcp_servers: [], slack_channels: []}
})
};
fetch('https://api.devin.ai/v3/organizations/{org_id}/automations', 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}/automations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'actions' => [
[
'prompt' => '<string>',
'session' => [
'bypass_approval' => false,
'notifications' => [
'slack' => [
'channel_id' => '<string>'
]
],
'platform' => '<string>',
'playbook_id' => '<string>',
'repos' => [
],
'tags' => [
]
],
'type' => 'start_session'
]
],
'name' => '<string>',
'run_as' => [
'type' => 'organization'
],
'triggers' => [
[
'conditions' => [
'any' => [
[
'all' => [
[
'field' => '<string>',
'value' => '<string>'
]
]
]
]
],
'replies' => [
]
]
],
'concurrency' => [
'max_concurrent_runs' => 2,
'max_queue_depth' => 1
],
'enabled' => true,
'limits' => [
'invocations' => [
'max_per_window' => 2,
'window_seconds' => 61
],
'max_acu_limit' => 500
],
'metadata' => [
],
'notifications' => [
'email' => [
'recipients' => [
'<string>'
]
],
'slack' => [
'channel_id' => '<string>'
]
],
'security_profile' => [
'profile_id' => '<string>'
],
'session_settings' => [
'net_policy' => [
'allow' => [
[
'hostname' => '<string>'
]
]
]
],
'template_id' => '<string>',
'tools' => [
'linear_enabled' => true,
'mcp_servers' => [
],
'slack_channels' => [
]
]
]),
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}/automations"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"prompt\": \"<string>\",\n \"session\": {\n \"bypass_approval\": false,\n \"notifications\": {\n \"slack\": {\n \"channel_id\": \"<string>\"\n }\n },\n \"platform\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"repos\": [],\n \"tags\": []\n },\n \"type\": \"start_session\"\n }\n ],\n \"name\": \"<string>\",\n \"run_as\": {\n \"type\": \"organization\"\n },\n \"triggers\": [\n {\n \"conditions\": {\n \"any\": [\n {\n \"all\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n },\n \"replies\": []\n }\n ],\n \"concurrency\": {\n \"max_concurrent_runs\": 2,\n \"max_queue_depth\": 1\n },\n \"enabled\": true,\n \"limits\": {\n \"invocations\": {\n \"max_per_window\": 2,\n \"window_seconds\": 61\n },\n \"max_acu_limit\": 500\n },\n \"metadata\": {},\n \"notifications\": {\n \"email\": {\n \"recipients\": [\n \"<string>\"\n ]\n },\n \"slack\": {\n \"channel_id\": \"<string>\"\n }\n },\n \"security_profile\": {\n \"profile_id\": \"<string>\"\n },\n \"session_settings\": {\n \"net_policy\": {\n \"allow\": [\n {\n \"hostname\": \"<string>\"\n }\n ]\n }\n },\n \"template_id\": \"<string>\",\n \"tools\": {\n \"linear_enabled\": true,\n \"mcp_servers\": [],\n \"slack_channels\": []\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.devin.ai/v3/organizations/{org_id}/automations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n {\n \"prompt\": \"<string>\",\n \"session\": {\n \"bypass_approval\": false,\n \"notifications\": {\n \"slack\": {\n \"channel_id\": \"<string>\"\n }\n },\n \"platform\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"repos\": [],\n \"tags\": []\n },\n \"type\": \"start_session\"\n }\n ],\n \"name\": \"<string>\",\n \"run_as\": {\n \"type\": \"organization\"\n },\n \"triggers\": [\n {\n \"conditions\": {\n \"any\": [\n {\n \"all\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n },\n \"replies\": []\n }\n ],\n \"concurrency\": {\n \"max_concurrent_runs\": 2,\n \"max_queue_depth\": 1\n },\n \"enabled\": true,\n \"limits\": {\n \"invocations\": {\n \"max_per_window\": 2,\n \"window_seconds\": 61\n },\n \"max_acu_limit\": 500\n },\n \"metadata\": {},\n \"notifications\": {\n \"email\": {\n \"recipients\": [\n \"<string>\"\n ]\n },\n \"slack\": {\n \"channel_id\": \"<string>\"\n }\n },\n \"security_profile\": {\n \"profile_id\": \"<string>\"\n },\n \"session_settings\": {\n \"net_policy\": {\n \"allow\": [\n {\n \"hostname\": \"<string>\"\n }\n ]\n }\n },\n \"template_id\": \"<string>\",\n \"tools\": {\n \"linear_enabled\": true,\n \"mcp_servers\": [],\n \"slack_channels\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/automations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"actions\": [\n {\n \"prompt\": \"<string>\",\n \"session\": {\n \"bypass_approval\": false,\n \"notifications\": {\n \"slack\": {\n \"channel_id\": \"<string>\"\n }\n },\n \"platform\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"repos\": [],\n \"tags\": []\n },\n \"type\": \"start_session\"\n }\n ],\n \"name\": \"<string>\",\n \"run_as\": {\n \"type\": \"organization\"\n },\n \"triggers\": [\n {\n \"conditions\": {\n \"any\": [\n {\n \"all\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n },\n \"replies\": []\n }\n ],\n \"concurrency\": {\n \"max_concurrent_runs\": 2,\n \"max_queue_depth\": 1\n },\n \"enabled\": true,\n \"limits\": {\n \"invocations\": {\n \"max_per_window\": 2,\n \"window_seconds\": 61\n },\n \"max_acu_limit\": 500\n },\n \"metadata\": {},\n \"notifications\": {\n \"email\": {\n \"recipients\": [\n \"<string>\"\n ]\n },\n \"slack\": {\n \"channel_id\": \"<string>\"\n }\n },\n \"security_profile\": {\n \"profile_id\": \"<string>\"\n },\n \"session_settings\": {\n \"net_policy\": {\n \"allow\": [\n {\n \"hostname\": \"<string>\"\n }\n ]\n }\n },\n \"template_id\": \"<string>\",\n \"tools\": {\n \"linear_enabled\": true,\n \"mcp_servers\": [],\n \"slack_channels\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"actions": [
{
"prompt": "<string>",
"session": {
"bypass_approval": false,
"notifications": {
"slack": {
"channel_id": "<string>"
}
},
"platform": "<string>",
"playbook_id": "<string>",
"repos": [],
"tags": []
},
"type": "start_session"
}
],
"automation_id": "<string>",
"created_at": 123,
"created_by": {
"id": "<string>",
"name": "<string>"
},
"enabled": true,
"name": "<string>",
"triggers": [
{
"event_type": "<string>",
"trigger_id": "<string>",
"conditions": {
"any": [
{
"all": [
{
"field": "<string>",
"value": "<string>"
}
]
}
]
},
"replies": [],
"webhook": {
"url": "<string>",
"secret": "<string>"
}
}
],
"updated_at": 123,
"concurrency": {
"max_concurrent_runs": 2,
"max_queue_depth": 1
},
"last_edited_by": {
"id": "<string>",
"name": "<string>"
},
"last_invocation": {
"fired_at": 123,
"status": "<string>"
},
"limits": {
"invocations": {
"max_per_window": 2,
"window_seconds": 61
},
"max_acu_limit": 500
},
"metadata": {},
"notifications": {
"email": {
"recipients": [
"<string>"
]
},
"slack": {
"channel_id": "<string>"
}
},
"run_as": {
"type": "organization"
},
"security_profile": {
"profile_id": "<string>",
"warnings": []
},
"session_settings": {
"net_policy": {
"allow": [
{
"hostname": "<string>"
}
]
}
},
"template_id": "<string>",
"tools": {
"linear_enabled": true,
"mcp_servers": [],
"slack_channels": []
}
}{
"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"
}创建自动化
创建包含触发器和 action 的新自动化。
curl --request POST \
--url https://api.devin.ai/v3/organizations/{org_id}/automations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
{
"prompt": "<string>",
"session": {
"bypass_approval": false,
"notifications": {
"slack": {
"channel_id": "<string>"
}
},
"platform": "<string>",
"playbook_id": "<string>",
"repos": [],
"tags": []
},
"type": "start_session"
}
],
"name": "<string>",
"run_as": {
"type": "organization"
},
"triggers": [
{
"conditions": {
"any": [
{
"all": [
{
"field": "<string>",
"value": "<string>"
}
]
}
]
},
"replies": []
}
],
"concurrency": {
"max_concurrent_runs": 2,
"max_queue_depth": 1
},
"enabled": true,
"limits": {
"invocations": {
"max_per_window": 2,
"window_seconds": 61
},
"max_acu_limit": 500
},
"metadata": {},
"notifications": {
"email": {
"recipients": [
"<string>"
]
},
"slack": {
"channel_id": "<string>"
}
},
"security_profile": {
"profile_id": "<string>"
},
"session_settings": {
"net_policy": {
"allow": [
{
"hostname": "<string>"
}
]
}
},
"template_id": "<string>",
"tools": {
"linear_enabled": true,
"mcp_servers": [],
"slack_channels": []
}
}
'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/automations"
payload = {
"actions": [
{
"prompt": "<string>",
"session": {
"bypass_approval": False,
"notifications": { "slack": { "channel_id": "<string>" } },
"platform": "<string>",
"playbook_id": "<string>",
"repos": [],
"tags": []
},
"type": "start_session"
}
],
"name": "<string>",
"run_as": { "type": "organization" },
"triggers": [
{
"conditions": { "any": [{ "all": [
{
"field": "<string>",
"value": "<string>"
}
] }] },
"replies": []
}
],
"concurrency": {
"max_concurrent_runs": 2,
"max_queue_depth": 1
},
"enabled": True,
"limits": {
"invocations": {
"max_per_window": 2,
"window_seconds": 61
},
"max_acu_limit": 500
},
"metadata": {},
"notifications": {
"email": { "recipients": ["<string>"] },
"slack": { "channel_id": "<string>" }
},
"security_profile": { "profile_id": "<string>" },
"session_settings": { "net_policy": { "allow": [{ "hostname": "<string>" }] } },
"template_id": "<string>",
"tools": {
"linear_enabled": True,
"mcp_servers": [],
"slack_channels": []
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
actions: [
{
prompt: '<string>',
session: {
bypass_approval: false,
notifications: {slack: {channel_id: '<string>'}},
platform: '<string>',
playbook_id: '<string>',
repos: [],
tags: []
},
type: 'start_session'
}
],
name: '<string>',
run_as: {type: 'organization'},
triggers: [
{
conditions: {any: [{all: [{field: '<string>', value: '<string>'}]}]},
replies: []
}
],
concurrency: {max_concurrent_runs: 2, max_queue_depth: 1},
enabled: true,
limits: {invocations: {max_per_window: 2, window_seconds: 61}, max_acu_limit: 500},
metadata: {},
notifications: {email: {recipients: ['<string>']}, slack: {channel_id: '<string>'}},
security_profile: {profile_id: '<string>'},
session_settings: {net_policy: {allow: [{hostname: '<string>'}]}},
template_id: '<string>',
tools: {linear_enabled: true, mcp_servers: [], slack_channels: []}
})
};
fetch('https://api.devin.ai/v3/organizations/{org_id}/automations', 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}/automations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'actions' => [
[
'prompt' => '<string>',
'session' => [
'bypass_approval' => false,
'notifications' => [
'slack' => [
'channel_id' => '<string>'
]
],
'platform' => '<string>',
'playbook_id' => '<string>',
'repos' => [
],
'tags' => [
]
],
'type' => 'start_session'
]
],
'name' => '<string>',
'run_as' => [
'type' => 'organization'
],
'triggers' => [
[
'conditions' => [
'any' => [
[
'all' => [
[
'field' => '<string>',
'value' => '<string>'
]
]
]
]
],
'replies' => [
]
]
],
'concurrency' => [
'max_concurrent_runs' => 2,
'max_queue_depth' => 1
],
'enabled' => true,
'limits' => [
'invocations' => [
'max_per_window' => 2,
'window_seconds' => 61
],
'max_acu_limit' => 500
],
'metadata' => [
],
'notifications' => [
'email' => [
'recipients' => [
'<string>'
]
],
'slack' => [
'channel_id' => '<string>'
]
],
'security_profile' => [
'profile_id' => '<string>'
],
'session_settings' => [
'net_policy' => [
'allow' => [
[
'hostname' => '<string>'
]
]
]
],
'template_id' => '<string>',
'tools' => [
'linear_enabled' => true,
'mcp_servers' => [
],
'slack_channels' => [
]
]
]),
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}/automations"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"prompt\": \"<string>\",\n \"session\": {\n \"bypass_approval\": false,\n \"notifications\": {\n \"slack\": {\n \"channel_id\": \"<string>\"\n }\n },\n \"platform\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"repos\": [],\n \"tags\": []\n },\n \"type\": \"start_session\"\n }\n ],\n \"name\": \"<string>\",\n \"run_as\": {\n \"type\": \"organization\"\n },\n \"triggers\": [\n {\n \"conditions\": {\n \"any\": [\n {\n \"all\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n },\n \"replies\": []\n }\n ],\n \"concurrency\": {\n \"max_concurrent_runs\": 2,\n \"max_queue_depth\": 1\n },\n \"enabled\": true,\n \"limits\": {\n \"invocations\": {\n \"max_per_window\": 2,\n \"window_seconds\": 61\n },\n \"max_acu_limit\": 500\n },\n \"metadata\": {},\n \"notifications\": {\n \"email\": {\n \"recipients\": [\n \"<string>\"\n ]\n },\n \"slack\": {\n \"channel_id\": \"<string>\"\n }\n },\n \"security_profile\": {\n \"profile_id\": \"<string>\"\n },\n \"session_settings\": {\n \"net_policy\": {\n \"allow\": [\n {\n \"hostname\": \"<string>\"\n }\n ]\n }\n },\n \"template_id\": \"<string>\",\n \"tools\": {\n \"linear_enabled\": true,\n \"mcp_servers\": [],\n \"slack_channels\": []\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.devin.ai/v3/organizations/{org_id}/automations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n {\n \"prompt\": \"<string>\",\n \"session\": {\n \"bypass_approval\": false,\n \"notifications\": {\n \"slack\": {\n \"channel_id\": \"<string>\"\n }\n },\n \"platform\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"repos\": [],\n \"tags\": []\n },\n \"type\": \"start_session\"\n }\n ],\n \"name\": \"<string>\",\n \"run_as\": {\n \"type\": \"organization\"\n },\n \"triggers\": [\n {\n \"conditions\": {\n \"any\": [\n {\n \"all\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n },\n \"replies\": []\n }\n ],\n \"concurrency\": {\n \"max_concurrent_runs\": 2,\n \"max_queue_depth\": 1\n },\n \"enabled\": true,\n \"limits\": {\n \"invocations\": {\n \"max_per_window\": 2,\n \"window_seconds\": 61\n },\n \"max_acu_limit\": 500\n },\n \"metadata\": {},\n \"notifications\": {\n \"email\": {\n \"recipients\": [\n \"<string>\"\n ]\n },\n \"slack\": {\n \"channel_id\": \"<string>\"\n }\n },\n \"security_profile\": {\n \"profile_id\": \"<string>\"\n },\n \"session_settings\": {\n \"net_policy\": {\n \"allow\": [\n {\n \"hostname\": \"<string>\"\n }\n ]\n }\n },\n \"template_id\": \"<string>\",\n \"tools\": {\n \"linear_enabled\": true,\n \"mcp_servers\": [],\n \"slack_channels\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/automations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"actions\": [\n {\n \"prompt\": \"<string>\",\n \"session\": {\n \"bypass_approval\": false,\n \"notifications\": {\n \"slack\": {\n \"channel_id\": \"<string>\"\n }\n },\n \"platform\": \"<string>\",\n \"playbook_id\": \"<string>\",\n \"repos\": [],\n \"tags\": []\n },\n \"type\": \"start_session\"\n }\n ],\n \"name\": \"<string>\",\n \"run_as\": {\n \"type\": \"organization\"\n },\n \"triggers\": [\n {\n \"conditions\": {\n \"any\": [\n {\n \"all\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n },\n \"replies\": []\n }\n ],\n \"concurrency\": {\n \"max_concurrent_runs\": 2,\n \"max_queue_depth\": 1\n },\n \"enabled\": true,\n \"limits\": {\n \"invocations\": {\n \"max_per_window\": 2,\n \"window_seconds\": 61\n },\n \"max_acu_limit\": 500\n },\n \"metadata\": {},\n \"notifications\": {\n \"email\": {\n \"recipients\": [\n \"<string>\"\n ]\n },\n \"slack\": {\n \"channel_id\": \"<string>\"\n }\n },\n \"security_profile\": {\n \"profile_id\": \"<string>\"\n },\n \"session_settings\": {\n \"net_policy\": {\n \"allow\": [\n {\n \"hostname\": \"<string>\"\n }\n ]\n }\n },\n \"template_id\": \"<string>\",\n \"tools\": {\n \"linear_enabled\": true,\n \"mcp_servers\": [],\n \"slack_channels\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"actions": [
{
"prompt": "<string>",
"session": {
"bypass_approval": false,
"notifications": {
"slack": {
"channel_id": "<string>"
}
},
"platform": "<string>",
"playbook_id": "<string>",
"repos": [],
"tags": []
},
"type": "start_session"
}
],
"automation_id": "<string>",
"created_at": 123,
"created_by": {
"id": "<string>",
"name": "<string>"
},
"enabled": true,
"name": "<string>",
"triggers": [
{
"event_type": "<string>",
"trigger_id": "<string>",
"conditions": {
"any": [
{
"all": [
{
"field": "<string>",
"value": "<string>"
}
]
}
]
},
"replies": [],
"webhook": {
"url": "<string>",
"secret": "<string>"
}
}
],
"updated_at": 123,
"concurrency": {
"max_concurrent_runs": 2,
"max_queue_depth": 1
},
"last_edited_by": {
"id": "<string>",
"name": "<string>"
},
"last_invocation": {
"fired_at": 123,
"status": "<string>"
},
"limits": {
"invocations": {
"max_per_window": 2,
"window_seconds": 61
},
"max_acu_limit": 500
},
"metadata": {},
"notifications": {
"email": {
"recipients": [
"<string>"
]
},
"slack": {
"channel_id": "<string>"
}
},
"run_as": {
"type": "organization"
},
"security_profile": {
"profile_id": "<string>",
"warnings": []
},
"session_settings": {
"net_policy": {
"allow": [
{
"hostname": "<string>"
}
]
}
},
"template_id": "<string>",
"tools": {
"linear_enabled": true,
"mcp_servers": [],
"slack_channels": []
}
}{
"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"
}权限
ManageOrgAutomations 权限的服务用户。
运行身份
run_as 字段为必填项。由服务用户创建的自动化必须使用
organization;具有 UsePersonalAutomations
权限的人工 API 调用方可使用 creator,以创建者的权限运行会话。
触发器和操作
triggers 与某个事件匹配时,自动化便会触发并运行其 actions (例如,使用提示启动 Devin 会话) 。使用事件架构端点查看支持的触发事件类型、其条件字段和运算符,以及各事件类型支持的回复动词。
触发器 conditions 使用两层嵌套结构 — {"any": [{"all": [...]}]} — 来定义 {field, operator, value} 条件;null conditions 对象会匹配所有事件。
Webhook 触发器
webhook:incoming 触发器 (最多一个) 的自动化在创建时会获分配一个收件箱 URL 和密钥。更新时重新添加 webhook 触发器会重新生成并返回该密钥;此后无法再次获取,请在收到时妥善保存。外部系统会通过 X-Webhook-Secret 标头发送该密钥。授权
服务用户凭据(前缀:cog_)
路径参数
组织 ID(前缀:org-)
"org-abc123def456"
请求体
非空。限制:最多只能有一个 start_session;monitor_session 必须是唯一的 action。
- AutomationStartSessionAction
- AutomationMessageSessionAction
- AutomationMonitorSessionAction
Show child attributes
Show child attributes
1 - 500必填:明确选择启动的会话使用的身份(组织或创建者)。
- AutomationRunAsOrganization
- AutomationRunAsCreator
Show child attributes
Show child attributes
任一触发器匹配时触发,每个事件仅触发一次。最多只能有一个 webhook:incoming 触发器。
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
用于组织和过滤自动化的组织可见键值标签。最多 16 对;键最长 32 个字符;值最长 128 个字符。
Show child attributes
Show child attributes
Show child attributes
Show child attributes
自动化自身的安全 Profile 绑定;省略则从组织/企业继承。需要安全 Profile 管理权限。
Show child attributes
Show child attributes
应用于此自动化启动的会话。
Show child attributes
Show child attributes
仅在创建时使用的来源标记;通过 templates 端点解析 ID。设置后,如果省略 tools.mcp_servers,则应用模板的 required_mcps。
Show child attributes
Show child attributes
响应
成功响应
- AutomationStartSessionAction
- AutomationMessageSessionAction
- AutomationMonitorSessionAction
Show child attributes
Show child attributes
归因于某项操作或资源的用户或服务用户主体。
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
归因于某项操作或资源的用户或服务用户主体。
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
启动的会话使用的身份。organization:组织的自动化身份(应用中的系统用户)— 会话使用系统权限,因此无法选择通过个人(用户作用域)连接安装的 MCP 服务器;将自动化切换为 organization 会将这些服务器从可选项中移除。creator:个人自动化 — 使用创建者自身的权限运行,且仅创建者和组织管理员可见;由服务用户创建的自动化不允许使用此值。创建时必填;更新时设为 null 将重置为 organization。
- AutomationRunAsOrganization
- AutomationRunAsCreator
Show child attributes
Show child attributes
自动化的安全 Profile 绑定及解析后适用的 Profile。组织未启用安全 Profile 时为 null。
Show child attributes
Show child attributes
应用于此自动化生成的每个会话(包括监控 会话)。
Show child attributes
Show child attributes
Show child attributes
Show child attributes

