更新组织安全 Profile 设置
curl --request PATCH \
--url https://api.devin.ai/v3beta1/organizations/{org_id}/security-profile-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"automations_default": {
"profile_id": "<string>"
},
"default": {
"profile_id": "<string>"
}
}
'import requests
url = "https://api.devin.ai/v3beta1/organizations/{org_id}/security-profile-settings"
payload = {
"automations_default": { "profile_id": "<string>" },
"default": { "profile_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({
automations_default: {profile_id: '<string>'},
default: {profile_id: '<string>'}
})
};
fetch('https://api.devin.ai/v3beta1/organizations/{org_id}/security-profile-settings', 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/v3beta1/organizations/{org_id}/security-profile-settings",
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([
'automations_default' => [
'profile_id' => '<string>'
],
'default' => [
'profile_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/v3beta1/organizations/{org_id}/security-profile-settings"
payload := strings.NewReader("{\n \"automations_default\": {\n \"profile_id\": \"<string>\"\n },\n \"default\": {\n \"profile_id\": \"<string>\"\n }\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/v3beta1/organizations/{org_id}/security-profile-settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"automations_default\": {\n \"profile_id\": \"<string>\"\n },\n \"default\": {\n \"profile_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3beta1/organizations/{org_id}/security-profile-settings")
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 \"automations_default\": {\n \"profile_id\": \"<string>\"\n },\n \"default\": {\n \"profile_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"automations_default": {
"selection": "inherit",
"profile_id": "<string>",
"profile_scope": "org"
},
"default": {
"selection": "inherit",
"profile_id": "<string>",
"profile_scope": "org"
}
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}安全配置(组织)[测试版]
更新组织安全 Profile 设置
更新组织默认选择的安全 Profile。 省略的字段保持不变。锁定的 Profile 可以是 org-owned 的 Profile,也可以是 该组织所属企业的共享 Profile。
PATCH
/
v3beta1
/
organizations
/
{org_id}
/
security-profile-settings
更新组织安全 Profile 设置
curl --request PATCH \
--url https://api.devin.ai/v3beta1/organizations/{org_id}/security-profile-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"automations_default": {
"profile_id": "<string>"
},
"default": {
"profile_id": "<string>"
}
}
'import requests
url = "https://api.devin.ai/v3beta1/organizations/{org_id}/security-profile-settings"
payload = {
"automations_default": { "profile_id": "<string>" },
"default": { "profile_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({
automations_default: {profile_id: '<string>'},
default: {profile_id: '<string>'}
})
};
fetch('https://api.devin.ai/v3beta1/organizations/{org_id}/security-profile-settings', 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/v3beta1/organizations/{org_id}/security-profile-settings",
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([
'automations_default' => [
'profile_id' => '<string>'
],
'default' => [
'profile_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/v3beta1/organizations/{org_id}/security-profile-settings"
payload := strings.NewReader("{\n \"automations_default\": {\n \"profile_id\": \"<string>\"\n },\n \"default\": {\n \"profile_id\": \"<string>\"\n }\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/v3beta1/organizations/{org_id}/security-profile-settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"automations_default\": {\n \"profile_id\": \"<string>\"\n },\n \"default\": {\n \"profile_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3beta1/organizations/{org_id}/security-profile-settings")
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 \"automations_default\": {\n \"profile_id\": \"<string>\"\n },\n \"default\": {\n \"profile_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"automations_default": {
"selection": "inherit",
"profile_id": "<string>",
"profile_scope": "org"
},
"default": {
"selection": "inherit",
"profile_id": "<string>",
"profile_scope": "org"
}
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}更新组织默认选用的安全 Profile,并返回更新后的设置。
权限
需要使用在组织级别拥有ManageSecureModeProfiles 权限的服务用户或个人访问令牌。正在运行的 Devin 会话所使用的令牌会被拒绝,因此会话无法修改管控其自身的 Profile。
行为
- 省略的字段保持不变。
null会被拒绝;如需清除默认值,请将其设为inherit,例如{"default": {"selection": "inherit"}}或{"automations_default": {"selection": "inherit"}}。 - 当
selection为profile时,profile_id为必填项;否则必须省略该字段。锁定的 Profile 可以是 org-owned 的 Profile,也可以是企业共享的 Profile 之一。 - 正在运行的会话会在下次启动或唤醒时应用此更改。
请求体
application/json
PATCH 语义:省略的字段保持不变。

