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"
}Créer une automatisation
Créer une automatisation avec des déclencheurs et des actions.
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"
}Autorisations
ManageOrgAutomations au niveau de l’organisation.
Identité d’exécution
run_as est obligatoire. Les automatisations créées par des utilisateurs de service doivent utiliser
organization ; les appelants humains de l’API disposant de l’autorisation UsePersonalAutomations
peuvent utiliser creator pour exécuter des sessions avec les autorisations du créateur.
Déclencheurs et actions
triggers correspond à un événement, puis exécute ses actions (par exemple, en lançant une session Devin avec un prompt). Utilisez l’endpoint des schémas d’événements pour connaître les types d’événements déclencheurs pris en charge, leurs champs de condition et opérateurs, ainsi que les verbes de réponse pris en charge par chaque type d’événement.
Les conditions d’un déclencheur utilisent une enveloppe à deux niveaux — {"any": [{"all": [...]}]} — composée de conditions {field, operator, value} ; un objet conditions défini sur null correspond à tous les événements.
Déclencheurs webhook
webhook:incoming (un seul au maximum) reçoit une URL de boîte de réception et un secret lors de sa création. Le secret est régénéré et renvoyé lorsqu’un déclencheur webhook est ajouté de nouveau lors d’une mise à jour ; il ne peut pas être récupéré ultérieurement. Veillez donc à l’enregistrer lorsque vous le recevez. Les systèmes externes l’envoient dans l’en-tête X-Webhook-Secret.Autorisations
Identifiant de compte de service (préfixe : cog_)
Paramètres de chemin
ID d’organisation (préfixe : org-)
"org-abc123def456"
Corps
Non vide. Limites : au plus un start_session ; monitor_session doit être la seule action.
- AutomationStartSessionAction
- AutomationMessageSessionAction
- AutomationMonitorSessionAction
Show child attributes
Show child attributes
1 - 500Obligatoire : choisissez explicitement l’identité sous laquelle s’exécutent les sessions générées (organisation ou créateur).
- AutomationRunAsOrganization
- AutomationRunAsCreator
Show child attributes
Show child attributes
Se déclenche lorsqu’un déclencheur correspond, une fois par événement. Au plus un déclencheur webhook:incoming.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Libellés clé/valeur visibles au niveau de l’organisation pour organiser et filtrer les automatisations. Au plus 16 paires ; clés de 32 caractères au maximum ; valeurs de 128 au maximum.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
La liaison au profil de sécurité propre à l’automatisation ; si omise, héritée de l’organisation/de l’entreprise. Nécessite l’autorisation de gestion des profils de sécurité.
Show child attributes
Show child attributes
Appliqué aux sessions générées par cette automatisation.
Show child attributes
Show child attributes
Marqueur de provenance utilisable uniquement à la création ; résolvez les ID via l’endpoint templates. Lorsqu’il est défini et que tools.mcp_servers est omis, les required_mcps du modèle s’appliquent.
Show child attributes
Show child attributes
Réponse
Réponse réussie
- AutomationStartSessionAction
- AutomationMessageSessionAction
- AutomationMonitorSessionAction
Show child attributes
Show child attributes
Un principal d’utilisateur ou d’utilisateur de service associé à une action ou une ressource.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Un principal d’utilisateur ou d’utilisateur de service associé à une action ou une ressource.
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
Identité sous laquelle s’exécutent les sessions générées. organization: l’identité d’automatisation de l’organisation (l’utilisateur système dans l’application) — les sessions utilisent les autorisations système ; les serveurs MCP installés avec une connexion personnelle (limitée à l’utilisateur) ne peuvent donc pas être sélectionnés, et le passage d’une automatisation à organization les retire de sa sélection. creator: automatisation personnelle — s’exécute avec les autorisations propres au créateur et n’est visible que par celui-ci et les administrateurs de l’organisation ; refusée pour les automatisations créées par un utilisateur de service. Obligatoire à la création ; null lors d’une mise à jour réinitialise la valeur sur organization.
- AutomationRunAsOrganization
- AutomationRunAsCreator
Show child attributes
Show child attributes
La liaison au profil de sécurité de l’automatisation et les profils directeurs résolus. null lorsque les profils de sécurité ne sont pas activés pour l’organisation.
Show child attributes
Show child attributes
Appliqué à chaque session créée par cette automatisation (y compris les sessions de surveillance).
Show child attributes
Show child attributes
Show child attributes
Show child attributes

