curl --request POST \
--url https://api.devin.ai/v3/enterprise/organizations/{org_id}/code-scans/ingestion \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"profile_id": "<string>",
"attachment_urls": [
"<string>"
],
"host": "<string>",
"platform": "<string>",
"repo_name": "<string>",
"repos": [
{
"repo_name": "<string>",
"host": "<string>"
}
]
}
'import requests
url = "https://api.devin.ai/v3/enterprise/organizations/{org_id}/code-scans/ingestion"
payload = {
"profile_id": "<string>",
"attachment_urls": ["<string>"],
"host": "<string>",
"platform": "<string>",
"repo_name": "<string>",
"repos": [
{
"repo_name": "<string>",
"host": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
profile_id: '<string>',
attachment_urls: ['<string>'],
host: '<string>',
platform: '<string>',
repo_name: '<string>',
repos: [{repo_name: '<string>', host: '<string>'}]
})
};
fetch('https://api.devin.ai/v3/enterprise/organizations/{org_id}/code-scans/ingestion', 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/organizations/{org_id}/code-scans/ingestion",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'profile_id' => '<string>',
'attachment_urls' => [
'<string>'
],
'host' => '<string>',
'platform' => '<string>',
'repo_name' => '<string>',
'repos' => [
[
'repo_name' => '<string>',
'host' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.devin.ai/v3/enterprise/organizations/{org_id}/code-scans/ingestion"
payload := strings.NewReader("{\n \"profile_id\": \"<string>\",\n \"attachment_urls\": [\n \"<string>\"\n ],\n \"host\": \"<string>\",\n \"platform\": \"<string>\",\n \"repo_name\": \"<string>\",\n \"repos\": [\n {\n \"repo_name\": \"<string>\",\n \"host\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.devin.ai/v3/enterprise/organizations/{org_id}/code-scans/ingestion")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"profile_id\": \"<string>\",\n \"attachment_urls\": [\n \"<string>\"\n ],\n \"host\": \"<string>\",\n \"platform\": \"<string>\",\n \"repo_name\": \"<string>\",\n \"repos\": [\n {\n \"repo_name\": \"<string>\",\n \"host\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/enterprise/organizations/{org_id}/code-scans/ingestion")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"profile_id\": \"<string>\",\n \"attachment_urls\": [\n \"<string>\"\n ],\n \"host\": \"<string>\",\n \"platform\": \"<string>\",\n \"repo_name\": \"<string>\",\n \"repos\": [\n {\n \"repo_name\": \"<string>\",\n \"host\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_at": 123,
"effort": "normal",
"host": "<string>",
"org_id": "<string>",
"profile": {
"name": "<string>",
"profile_id": "<string>"
},
"repo_name": "<string>",
"scan_id": "<string>",
"scan_type": "security",
"status": "waiting",
"url": "<string>",
"outpost_pool_id": "<string>",
"platform": "<string>",
"repo_full_name": "<string>"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}Ingestion-Scan starten (Devin API)
Starten Sie über die v3 Enterprise API einen Devin-Code-Scan im Ingestion-Modus, der Befunde eines externen Scanners mithilfe eines Ingestionsprofils bewertet und weiterleitet
curl --request POST \
--url https://api.devin.ai/v3/enterprise/organizations/{org_id}/code-scans/ingestion \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"profile_id": "<string>",
"attachment_urls": [
"<string>"
],
"host": "<string>",
"platform": "<string>",
"repo_name": "<string>",
"repos": [
{
"repo_name": "<string>",
"host": "<string>"
}
]
}
'import requests
url = "https://api.devin.ai/v3/enterprise/organizations/{org_id}/code-scans/ingestion"
payload = {
"profile_id": "<string>",
"attachment_urls": ["<string>"],
"host": "<string>",
"platform": "<string>",
"repo_name": "<string>",
"repos": [
{
"repo_name": "<string>",
"host": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
profile_id: '<string>',
attachment_urls: ['<string>'],
host: '<string>',
platform: '<string>',
repo_name: '<string>',
repos: [{repo_name: '<string>', host: '<string>'}]
})
};
fetch('https://api.devin.ai/v3/enterprise/organizations/{org_id}/code-scans/ingestion', 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/organizations/{org_id}/code-scans/ingestion",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'profile_id' => '<string>',
'attachment_urls' => [
'<string>'
],
'host' => '<string>',
'platform' => '<string>',
'repo_name' => '<string>',
'repos' => [
[
'repo_name' => '<string>',
'host' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.devin.ai/v3/enterprise/organizations/{org_id}/code-scans/ingestion"
payload := strings.NewReader("{\n \"profile_id\": \"<string>\",\n \"attachment_urls\": [\n \"<string>\"\n ],\n \"host\": \"<string>\",\n \"platform\": \"<string>\",\n \"repo_name\": \"<string>\",\n \"repos\": [\n {\n \"repo_name\": \"<string>\",\n \"host\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.devin.ai/v3/enterprise/organizations/{org_id}/code-scans/ingestion")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"profile_id\": \"<string>\",\n \"attachment_urls\": [\n \"<string>\"\n ],\n \"host\": \"<string>\",\n \"platform\": \"<string>\",\n \"repo_name\": \"<string>\",\n \"repos\": [\n {\n \"repo_name\": \"<string>\",\n \"host\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/enterprise/organizations/{org_id}/code-scans/ingestion")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"profile_id\": \"<string>\",\n \"attachment_urls\": [\n \"<string>\"\n ],\n \"host\": \"<string>\",\n \"platform\": \"<string>\",\n \"repo_name\": \"<string>\",\n \"repos\": [\n {\n \"repo_name\": \"<string>\",\n \"host\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_at": 123,
"effort": "normal",
"host": "<string>",
"org_id": "<string>",
"profile": {
"name": "<string>",
"profile_id": "<string>"
},
"repo_name": "<string>",
"scan_id": "<string>",
"scan_type": "security",
"status": "waiting",
"url": "<string>",
"outpost_pool_id": "<string>",
"platform": "<string>",
"repo_full_name": "<string>"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}Berechtigungen
Erfordert einen Service-Benutzer oder ein persönliches Zugriffstoken mit der BerechtigungUseAccountCodeScans auf Enterprise-Ebene.
Verhalten
Stellt einen Code-Scan im Ingestion-Modus in die Warteschlange. Statt Probleme von Grund auf zu erkennen, übernimmt ein Ingestion-Scan an anderer Stelle erzeugte Befunde (zum Beispiel aus einem SAST-Bericht) und lässt Devin diese im Repository prüfen und validieren. Der Scan wird vom Scan-Dispatcher asynchron gestartet und dem aufrufenden Principal zugeordnet.Anfragefelder
Geben Sie genau eines der Felderrepo_name oder repos an.
repo_name: vollständiger Name des Repositorys, z. B.owner/repo.repos: Repositorys, die von einem Multi-Repo-Scan abgedeckt werden, als Liste von Objekten mitrepo_nameund einem optionalenhost(bis zu 200). Der erste Eintrag ist das primäre Repository des Scans.profile_id(erforderlich): ein Scan-Profil im Modusingest. Ein Profil im Modusdiscoverwird mit400abgelehnt.host: Git-Host des Repositorys, falls er nicht abgeleitet werden kann.attachment_urls: Devin-Anhang-URLs (zum Beispiel ein exportierter Scannerbericht), die dem Scan zur Verfügung gestellt werden. Laden Sie Dateien zunächst über die Attachments API hoch.effort:normal(Standard) arbeitet mit geringerem Reasoning-Aufwand des Modells und größeren Triage- und Validierungs-Batches;deepdurchläuft die vollständige Pipeline.platform: wo die Sitzungen des Scans ausgeführt werden – entweder ein für die Organisation konfiguriertes Plattform-Label (zum Beispiellinux,windowsodermacos) oder der Name eines Outpost-Pools; Groß-/Kleinschreibung wird nicht beachtet. Trifft ein Name auf beides zu, haben Plattformen Vorrang. Ohne Angabe gilt der Standardwert der Organisation.
Fehler
400, wennprofile_idkein Profil im Ingestion-Modus ist oderplatformweder einem konfigurierten Plattform-Label noch einem Outpost-Pool entspricht (der Fehlertext listet die verfügbaren Werte auf).404, wenn die Organisation, das Repository oder das Profil für das Enterprise-Konto nicht sichtbar ist.409, wenn der Scan-Backlog der Organisation seine Kapazitätsgrenze erreicht hat. Versuchen Sie es später erneut.422, wenn entweder sowohlrepo_nameals auchreposoder keiner der beiden Parameter angegeben ist oder wennreposleer ist.
Autorisierungen
Servicebenutzer-Anmeldedaten (Präfix: cog_)
Pfadparameter
Organisations-ID (Präfix: org-)
"org-abc123def456"
Body
Anfragetext zum Starten eines Code-Scans im Ingestion-Modus.
Akzeptiert nur ein Scanprofil für die Ingestion (Ingest-Modus): Das Profil wird für das angegebene Repository (oder die angegebenen Repositorys) ausgeführt.
Auszuführendes Scanprofil im Ingestion-Modus. Muss ein Ingest-Profil sein; Nicht-Ingest-Profile werden mit 400 abgewiesen.
Devin-Anhang-URLs, die dem Scan bereitgestellt werden, z. B. über die Attachments-API hochgeladene Dateien. Die Anhänge müssen zu der gescannten Organisation gehören.
101 - 2083Scan-Aufwand: 'normal' (Standard) nutzt einen geringeren Reasoning-Aufwand des Modells und größere Batches für Triage und Validierung; 'deep' führt die vollständige Pipeline aus.
normal, deep Git-Host des Repositorys, falls bekannt.
Ausführungsort der Scan-Sitzungen: eine für die Organisation konfigurierte Plattformbezeichnung (z. B. 'linux', 'windows', 'macos') oder der Name eines Outpost-Pools (BYOB), wobei die Groß- und Kleinschreibung nicht berücksichtigt wird; wenn ein Name sowohl einer Plattform als auch einem Pool entspricht, hat die Plattform Vorrang. Ohne Angabe gilt der Standard der Organisation. Unbekannte Werte werden mit einem 400-Fehler abgewiesen, dessen Fehlerantwort die verfügbaren Plattformbezeichnungen und Outpost-Pool-Namen auflistet.
128Vollständiger Name des zu scannenden Repositorys. Geben Sie genau einen der beiden Parameter repo_name oder repos an.
Repositorys, die von einem Scan erfasst werden; der erste Eintrag ist das primäre Repository des Scans. Geben Sie genau einen der beiden Parameter repo_name oder repos an.
200Show child attributes
Show child attributes
Antwort
Erfolgreiche Antwort
Ein einzelner Code-Scan.
Zeitpunkt, zu dem der Scan erstellt wurde (Unix-Sekunden).
Scan-Aufwand: 'normal' nutzt einen geringeren Reasoning-Aufwand des Modells und größere Untersuchungspakete; 'deep' führt die vollständige Pipeline aus.
normal, deep Git-Host des Repositorys, falls bekannt.
Organisation, zu der der Scan gehört.
Profil, unter dem der Scan ausgeführt wurde, falls vorhanden.
Show child attributes
Show child attributes
Primäres Repository des Scans. Multi-Repo-Scans umfassen zusätzliche Repositorys, die hier nicht aufgeführt sind.
Eindeutige Kennung des Scans.
Typ des Scans, bei der Erstellung festgelegt.
security, performance, db-queries, test-coverage, dead-code, code-quality, cleanup, telemetry, accessibility, compliance, general, migration-docs Scan-Status: waiting, pending, running, awaiting_user_input, completed, failed oder cancelled.
waiting, pending, running, awaiting_user_input, completed, failed, cancelled URL der Scan-Seite in der Devin-Webapp.
Outpost-Pool, auf dem die Sitzungen des Scans ausgeführt werden, sofern festgelegt.
Bezeichnung der gehosteten Plattform, auf der die Sitzungen des Scans ausgeführt werden. Null, wenn der Scan auf einem Outpost-Pool oder mit der Standardeinstellung der Organisation ausgeführt wird.
Kennung des primären Repositorys einschließlich Host (z. B. github.com/org/repo). Null für Perforce-Depots, die keinen Git-Host haben.

