Actualizar las reglas de permisos de Devin CLI del equipo
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_bodyReferencia de la API
Actualizar las reglas de permisos de Devin CLI del equipo
Reemplaza mediante la API las reglas de permisos de Devin CLI (allow, ask y deny) que se aplican en toda la cuenta de tu equipo, con control de concurrencia basado en ETag.
PUT
/
api
/
v2alpha
/
cli-permissions
Actualizar las reglas de permisos de Devin CLI del equipo
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_bodyDescripción general
Reemplaza las reglas de permisos de Devin CLI de tu equipo en toda la cuenta, es decir, los mismos Terminal Permissions configurados en la configuración del equipo. Para no sobrescribir cambios simultáneos, pasa elETag obtenido de Get CLI Permissions en el encabezado If-Match. Si las reglas han cambiado entretanto, la solicitud falla con 412.
Este endpoint está en fase alfa (
v2alpha). La estructura de la solicitud y de la respuesta puede cambiar.Autenticación
Envía una clave de API de usuario de servicio de Devin (cog_...) en el encabezado Authorization:
Authorization: Bearer <api-key>
403.
Solicitud
Acciones que Devin CLI aprueba automáticamente sin pedir confirmación. Pasa
[] para indicar una lista vacía.Acciones que siempre piden la aprobación del usuario. Pasa
[] para indicar una lista vacía.400. Este endpoint no valida los patrones de URL de Fetch(...): Devin CLI ignora los patrones que no puede compilar.
Ejemplo de solicitud
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 /)"]}'
Respuesta
Devuelve las listasallow, ask y deny actualizadas junto con un nuevo encabezado ETag, en el mismo formato que Get CLI Permissions. Las actualizaciones correctas quedan registradas en el registro de auditoría del equipo.
Respuestas de error
Los errores se devuelven con el formato{"error": "<message>"}.
| Estado | Causa |
|---|---|
400 | JSON no válido, campos desconocidos, falta allow, ask o deny, o una regla de permiso que no se puede analizar |
401 | Clave de API ausente o no válida, o una clave de API de Windsurf Anterior (solo se aceptan claves de usuario de servicio de Devin cog_...) |
403 | Se usó un token personal en lugar de una clave de usuario de servicio, falta el acceso a Devin Desktop o el permiso account.windsurf.admin, o la cuenta no tiene un plan Teams o Enterprise |
412 | If-Match no coincide con el ETag actual; vuelve a obtener las reglas e inténtalo de nuevo |
428 | Falta el encabezado If-Match |
429 | Se superó el límite de tasa; vuelve a intentarlo cuando haya transcurrido el tiempo indicado en el encabezado Retry-After |

