获取 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>"
]
}API 参考文档
获取 Devin CLI 团队权限规则
通过 API 读取您团队的账户级 Devin CLI 权限规则(允许、询问和拒绝)及当前 ETag。
GET
/
api
/
v2alpha
/
cli-permissions
获取 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>"
]
}概述
返回您的团队账户级的 Devin CLI 权限规则,即在团队设置中配置的终端权限。 响应仅包含为您的团队显式保存的规则,不包括组织、组或用户级别的覆盖设置。此端点目前处于 alpha 阶段 (
v2alpha) ,响应结构可能会发生变化。身份验证
在Authorization 标头中传入 Devin 服务用户 API 密钥 (cog_...) :
Authorization: Bearer <api-key>
account.windsurf.admin) 权限,内置的 Account Admin 角色已包含这两项权限。适用于团队套餐和企业套餐。使用个人令牌的请求将被拒绝,并返回 403。
请求
此端点无需任何参数或请求体。请求示例
curl -i https://server.codeium.com/api/v2alpha/cli-permissions \
-H "Authorization: Bearer $DEVIN_API_KEY"
响应
ETag 响应标头用于标识当前规则集。调用更新 CLI 权限时,请将其作为 If-Match 传入。
有关支持的规则格式,请参阅权限语法。
响应示例
{
"allow": ["Exec(git)", "Read(**)"],
"ask": ["Fetch(domain:*)"],
"deny": ["ExecExact(rm -rf /)"]
}
错误响应
错误以{"error": "<message>"} 的形式返回。
| 状态 | 原因 |
|---|---|
401 | 缺少 API 密钥或 API 密钥无效,或使用了旧版 Windsurf API 密钥 (仅接受 Devin cog_... 服务用户密钥) |
403 | 使用了个人令牌而非服务用户密钥;缺少 Devin Desktop 访问权限或 account.windsurf.admin 权限;或账户未订阅 团队 或 Enterprise 套餐 |
429 | 超出速率限制;请等待 Retry-After 标头指定的时间后重试 |

