Atualizar as regras de permissão da equipe no Devin CLI
curl --request PUT \
--url https://server.codeium.com/api/v2alpha/cli-permissions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'If-Match: <if-match>' \
--data '
{
"allow": [
"<string>"
],
"ask": [
"<string>"
],
"deny": [
"<string>"
]
}
'import requests
url = "https://server.codeium.com/api/v2alpha/cli-permissions"
payload = {
"allow": ["<string>"],
"ask": ["<string>"],
"deny": ["<string>"]
}
headers = {
"If-Match": "<if-match>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'If-Match': '<if-match>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({allow: ['<string>'], ask: ['<string>'], deny: ['<string>']})
};
fetch('https://server.codeium.com/api/v2alpha/cli-permissions', 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://server.codeium.com/api/v2alpha/cli-permissions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allow' => [
'<string>'
],
'ask' => [
'<string>'
],
'deny' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"If-Match: <if-match>"
],
]);
$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://server.codeium.com/api/v2alpha/cli-permissions"
payload := strings.NewReader("{\n \"allow\": [\n \"<string>\"\n ],\n \"ask\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("If-Match", "<if-match>")
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.put("https://server.codeium.com/api/v2alpha/cli-permissions")
.header("If-Match", "<if-match>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allow\": [\n \"<string>\"\n ],\n \"ask\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.codeium.com/api/v2alpha/cli-permissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["If-Match"] = '<if-match>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allow\": [\n \"<string>\"\n ],\n \"ask\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyReferência da API
Atualizar as regras de permissão da equipe no Devin CLI
Substitua as regras de permissão do Devin CLI no nível da conta da sua equipe (allow, ask e deny) pela API, com controle de concorrência via ETag.
PUT
/
api
/
v2alpha
/
cli-permissions
Atualizar as regras de permissão da equipe no Devin CLI
curl --request PUT \
--url https://server.codeium.com/api/v2alpha/cli-permissions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'If-Match: <if-match>' \
--data '
{
"allow": [
"<string>"
],
"ask": [
"<string>"
],
"deny": [
"<string>"
]
}
'import requests
url = "https://server.codeium.com/api/v2alpha/cli-permissions"
payload = {
"allow": ["<string>"],
"ask": ["<string>"],
"deny": ["<string>"]
}
headers = {
"If-Match": "<if-match>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'If-Match': '<if-match>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({allow: ['<string>'], ask: ['<string>'], deny: ['<string>']})
};
fetch('https://server.codeium.com/api/v2alpha/cli-permissions', 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://server.codeium.com/api/v2alpha/cli-permissions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allow' => [
'<string>'
],
'ask' => [
'<string>'
],
'deny' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"If-Match: <if-match>"
],
]);
$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://server.codeium.com/api/v2alpha/cli-permissions"
payload := strings.NewReader("{\n \"allow\": [\n \"<string>\"\n ],\n \"ask\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("If-Match", "<if-match>")
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.put("https://server.codeium.com/api/v2alpha/cli-permissions")
.header("If-Match", "<if-match>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allow\": [\n \"<string>\"\n ],\n \"ask\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.codeium.com/api/v2alpha/cli-permissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["If-Match"] = '<if-match>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allow\": [\n \"<string>\"\n ],\n \"ask\": [\n \"<string>\"\n ],\n \"deny\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyVisão geral
Substitui as regras de permissão do Devin CLI no nível da conta da sua equipe — as mesmas Terminal Permissions configuradas nas configurações da equipe. Para não sobrescrever alterações simultâneas, envie no cabeçalhoIf-Match o ETag retornado por Get CLI Permissions. Se as regras tiverem sido alteradas nesse meio-tempo, a requisição falhará com 412.
Este endpoint está em fase alfa (
v2alpha). O formato da requisição e da resposta pode mudar.Autenticação
Envie uma chave de API de usuário de serviço do Devin (cog_...) no cabeçalho Authorization:
Authorization: Bearer <api-key>
403.
Requisição
Ações que o Devin CLI aprova automaticamente, sem pedir confirmação. Envie
[] para uma lista vazia.400. Este endpoint não valida os padrões de URL de Fetch(...) — o Devin CLI ignora os padrões que não consegue compilar.
Exemplo de requisição
ETAG=$(curl -s -D - -o /dev/null https://server.codeium.com/api/v2alpha/cli-permissions \
-H "Authorization: Bearer $DEVIN_API_KEY" | awk 'tolower($1)=="etag:" {print $2}' | tr -d '\r')
curl -X PUT https://server.codeium.com/api/v2alpha/cli-permissions \
-H "Authorization: Bearer $DEVIN_API_KEY" \
-H "If-Match: $ETAG" \
-H "Content-Type: application/json" \
-d '{"allow": ["Exec(git)", "Read(**)"], "ask": ["Fetch(domain:*)"], "deny": ["ExecExact(rm -rf /)"]}'
Resposta
Retorna as listasallow, ask e deny atualizadas com um novo cabeçalho ETag, no mesmo formato de Get CLI Permissions. As atualizações bem-sucedidas são incluídas no registro de auditoria da equipe.
Respostas de erro
Os erros são retornados no formato{"error": "<message>"}.
| Status | Causa |
|---|---|
400 | JSON inválido, campos desconhecidos, ausência de allow, ask ou deny, ou uma regra de permissão que não pode ser interpretada |
401 | Chave de API ausente ou inválida, ou uma chave de API do Windsurf Legado (somente chaves de usuário de serviço cog_... do Devin são aceitas) |
403 | Token Personal usado no lugar de uma chave de usuário de serviço, ausência de acesso ao Devin Desktop ou da permissão account.windsurf.admin, ou a conta não está em um plano Teams ou Enterprise |
412 | If-Match não corresponde ao ETag atual; busque as regras novamente e repita a requisição |
428 | Cabeçalho If-Match ausente |
429 | Limite de requisições excedido; tente novamente após o tempo indicado no cabeçalho Retry-After |

