列出代码扫描
curl --request GET \
--url https://api.devin.ai/v3/enterprise/code-scans/scans \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devin.ai/v3/enterprise/code-scans/scans"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.devin.ai/v3/enterprise/code-scans/scans', 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://api.devin.ai/v3/enterprise/code-scans/scans",
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://api.devin.ai/v3/enterprise/code-scans/scans"
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://api.devin.ai/v3/enterprise/code-scans/scans")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/enterprise/code-scans/scans")
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{
"items": [
{
"created_at": 123,
"host": "<string>",
"org_id": "<string>",
"profile": {
"name": "<string>",
"profile_id": "<string>"
},
"repo_name": "<string>",
"scan_id": "<string>",
"scan_type": "security",
"status": "waiting"
}
],
"end_cursor": "<string>",
"has_next_page": false,
"total": 123
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}代码扫描(企业)
列出代码扫描(Devin API)
通过 v3 API 列出企业中的 Devin 代码扫描并轮询扫描状态,支持按时间、代码仓库和组织过滤
GET
/
v3
/
enterprise
/
code-scans
/
scans
列出代码扫描
curl --request GET \
--url https://api.devin.ai/v3/enterprise/code-scans/scans \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devin.ai/v3/enterprise/code-scans/scans"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.devin.ai/v3/enterprise/code-scans/scans', 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://api.devin.ai/v3/enterprise/code-scans/scans",
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://api.devin.ai/v3/enterprise/code-scans/scans"
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://api.devin.ai/v3/enterprise/code-scans/scans")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/enterprise/code-scans/scans")
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{
"items": [
{
"created_at": 123,
"host": "<string>",
"org_id": "<string>",
"profile": {
"name": "<string>",
"profile_id": "<string>"
},
"repo_name": "<string>",
"scan_id": "<string>",
"scan_type": "security",
"status": "waiting"
}
],
"end_cursor": "<string>",
"has_next_page": false,
"total": 123
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}权限
ViewAccountCodeScans 权限。
行为
status:waiting → pending → running → completed (或 failed / cancelled) 。awaiting_user_input 仅适用于从 Web 应用发起的交互式扫描;通过 API 发起的扫描不会进入此状态。
过滤器
time_after/time_before:以秒为单位的 Unix 时间戳 (UTC) ,用于限定扫描的创建时间。repo_name:仅返回扫描过此代码仓库的扫描记录,包括包含该代码仓库的多代码仓库扫描。org_ids:仅返回这些组织中的扫描记录。
after / first) 进行分页。若仅查询单个组织,请使用列出代码扫描 (组织) 。授权
服务用户凭据(前缀:cog_)
查询参数
必填范围:
1 <= x <= 200筛选扫描过此代码仓库的扫描任务。即使该代码仓库不是扫描的主代码仓库,也会匹配多代码仓库扫描,因此返回项中的 repo_name 可能不同。
筛选这些组织中的扫描任务。
⌘I

