Recuperare le regole di autorizzazione del team per Devin CLI
curl --request GET \
--url https://server.codeium.com/api/v2alpha/cli-permissions \
--header 'Authorization: Bearer <token>'import requests
url = "https://server.codeium.com/api/v2alpha/cli-permissions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://server.codeium.com/api/v2alpha/cli-permissions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://server.codeium.com/api/v2alpha/cli-permissions")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"allow": [
"<string>"
],
"ask": [
"<string>"
],
"deny": [
"<string>"
]
}Riferimento API
Recuperare le regole di autorizzazione del team per Devin CLI
Leggi tramite l’API le regole di autorizzazione di Devin CLI (allow, ask e deny) definite a livello di account per il tuo team e l’ETag attuale.
GET
/
api
/
v2alpha
/
cli-permissions
Recuperare le regole di autorizzazione del team per Devin CLI
curl --request GET \
--url https://server.codeium.com/api/v2alpha/cli-permissions \
--header 'Authorization: Bearer <token>'import requests
url = "https://server.codeium.com/api/v2alpha/cli-permissions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://server.codeium.com/api/v2alpha/cli-permissions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://server.codeium.com/api/v2alpha/cli-permissions")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"allow": [
"<string>"
],
"ask": [
"<string>"
],
"deny": [
"<string>"
]
}Panoramica
Restituisce le regole di autorizzazione della Devin CLI valide a livello di account per il tuo team, ovvero le stesse Terminal Permissions configurate nelle impostazioni del team. La risposta contiene solo le regole salvate esplicitamente per il tuo team. Non include le eccezioni definite a livello di organizzazione, gruppo o utente.Questo endpoint è in fase alpha (
v2alpha). La struttura della risposta potrebbe cambiare.Autenticazione
Passa una API key dell’utente di servizio di Devin (cog_...) nell’intestazione Authorization:
Authorization: Bearer <api-key>
account.windsurf.admin), incluse nel ruolo integrato Account Admin. Disponibile con i piani Team ed Enterprise. I token personali vengono rifiutati con errore 403.
Richiesta
Questo endpoint non accetta parametri né corpo della richiesta.Esempio di richiesta
curl -i https://server.codeium.com/api/v2alpha/cli-permissions \
-H "Authorization: Bearer $DEVIN_API_KEY"
Risposta
L’intestazione di rispostaETag identifica il set di regole attuale. Passala come If-Match quando chiami Aggiorna autorizzazioni CLI.
Consulta Sintassi delle autorizzazioni per i formati delle regole supportati.
Esempio di Risposta
{
"allow": ["Exec(git)", "Read(**)"],
"ask": ["Fetch(domain:*)"],
"deny": ["ExecExact(rm -rf /)"]
}
Risposte di errore
Gli errori vengono restituiti nel formato{"error": "<message>"}.
| Stato | Causa |
|---|---|
401 | Chiave API mancante o non valida, oppure chiave API di Windsurf precedente (sono accettate solo le chiavi degli utenti di servizio Devin cog_...) |
403 | È stato usato un token personale anziché una chiave dell’utente di servizio, manca l’accesso a Devin Desktop o l’autorizzazione account.windsurf.admin, oppure l’account non ha un piano Team o Enterprise |
429 | Limite di richieste superato; riprova dopo il tempo indicato nell’intestazione Retry-After |

