Devin-CLI-Berechtigungsregeln des Teams aktualisieren
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_bodyAPI-Referenz
Devin-CLI-Berechtigungsregeln des Teams aktualisieren
Ersetzen Sie die kontoweiten Devin-CLI-Berechtigungsregeln Ihres Teams (allow, ask und deny) über die API – mit ETag-basierter Parallelitätssteuerung.
PUT
/
api
/
v2alpha
/
cli-permissions
Devin-CLI-Berechtigungsregeln des Teams aktualisieren
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_bodyÜbersicht
Ersetzt die kontoweiten Berechtigungsregeln der Devin CLI für Ihr Team – also dieselben Terminal Permissions, die in den Teameinstellungen konfiguriert werden. Damit gleichzeitige Änderungen nicht überschrieben werden, übergeben Sie dasETag aus Get CLI Permissions im If-Match-Header. Wurden die Regeln zwischenzeitlich geändert, schlägt die Anfrage mit 412 fehl.
Dieser Endpunkt befindet sich in der Alpha-Phase (
v2alpha). Die Struktur von Anfrage und Antwort kann sich noch ändern.Authentifizierung
Übergeben Sie einen Devin-API-Schlüssel für Dienstbenutzer (cog_...) im Authorization-Header:
Authorization: Bearer <api-key>
403 abgelehnt.
Anfrage
Aktionen, die Devin CLI ohne Rückfrage automatisch genehmigt. Übergeben Sie
[] für eine leere Liste.Aktionen, bei denen der Nutzer immer zur Genehmigung aufgefordert wird. Übergeben Sie
[] für eine leere Liste.400. URL-Muster in Fetch(...) werden von diesem Endpunkt nicht validiert – die Devin CLI ignoriert Muster, die sie nicht kompilieren kann.
Beispielanfrage
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 /)"]}'
Antwort
Gibt wie bei Get CLI Permissions die aktualisierten Listenallow, ask und deny mit einem neuen ETag-Header zurück. Erfolgreiche Updates werden im Audit-Protokoll des Teams aufgezeichnet.
Fehlerantworten
Fehler werden als{"error": "<message>"} zurückgegeben.
| Status | Ursache |
|---|---|
400 | Ungültiges JSON, unbekannte Felder, fehlendes allow, ask oder deny oder eine nicht parsebare Berechtigungsregel |
401 | Fehlender oder ungültiger API-Schlüssel oder ein API-Schlüssel aus dem bisherigen Windsurf (akzeptiert werden nur Devin-Schlüssel für Dienstkonten im Format cog_...) |
403 | Persönliches Token statt eines Dienstbenutzerschlüssels verwendet, fehlender Zugriff auf Devin Desktop oder fehlende Berechtigung account.windsurf.admin oder das Konto hat keinen Teams- oder Enterprise-Tarif |
412 | If-Match stimmt nicht mit dem aktuellen ETag überein; Regeln erneut abrufen und Anfrage wiederholen |
428 | Fehlender If-Match-Header |
429 | Anfragelimit überschritten; nach der im Retry-After-Header angegebenen Zeit erneut versuchen |

