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"
}インジェストスキャンを開始(Devin API)
v3 Enterprise API を使用して、インジェストプロファイルで外部スキャナーの検出結果をトリアージするインジェストモードの Devin コードスキャンを開始します
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"
}権限
Enterprise レベルでUseAccountCodeScans 権限を持つ、サービスユーザーまたはパーソナルアクセストークンが必要です。
動作
インジェストモードのコードスキャンをキューに登録します。インジェストスキャンでは、問題を一から検出するのではなく、外部で生成された検出結果 (たとえば SAST レポート) を取り込み、Devin がリポジトリに照らしてトリアージと検証を行います。スキャンはスキャンディスパッチャーによって非同期で起動され、呼び出し元のプリンシパルに関連付けられます。リクエストフィールド
repo_name または repos のいずれか一方のみを指定してください。
repo_name:完全なリポジトリ名 (例:owner/repo) 。repos:1 回のマルチリポジトリスキャンで対象とするリポジトリ。repo_nameと任意のhostを持つオブジェクトのリストとして指定します (最大 200 件) 。最初の項目がスキャンのプライマリリポジトリになります。profile_id(必須) :ingestモードのスキャンプロファイル。discoverモードのプロファイルを指定すると、400が返されます。host:推測できない場合に指定するリポジトリの Git ホスト。attachment_urls:スキャンに与える Devin の添付ファイル URL (エクスポートしたスキャナーレポートなど) 。最初にattachments APIでファイルをアップロードしてください。effort:normal(デフォルト) は、モデルの推論レベルを抑え、トリアージと検証をより大きなバッチ単位で実行します。deepはパイプライン全体を実行します。platform:スキャンのセッションを実行する場所。組織に設定されたプラットフォームラベル (例:linux、windows、macos) または outpost プールの名前のいずれかを指定します (大文字と小文字は区別されません) 。名前が両方に一致する場合は、プラットフォームが優先されます。省略した場合は組織のデフォルトが使用されます。
エラー
400:profile_idがインジェストモードのプロファイルではない場合、またはplatformが設定済みのプラットフォームラベルや outpost プールのいずれとも一致しない場合 (エラー本文に利用可能な値の一覧が含まれます) 。404: 組織、リポジトリ、またはプロファイルがEnterpriseアカウントから参照できない場合。409: 組織のスキャンバックログが上限に達している場合。後で再試行してください。422:repo_nameとreposの両方が指定されている場合、もしくはどちらも指定されていない場合、またはreposが空の場合。
承認
サービスユーザーの認証情報(接頭辞: cog_)
パスパラメータ
組織 ID(プレフィックス: org-)
"org-abc123def456"
ボディ
取り込みモードのコードスキャンを開始するためのリクエストボディ。
取り込み(取り込みモード)スキャンプロファイルのみを受け付けます。プロファイルは 指定されたリポジトリ(単一または複数)に対して実行されます。
実行する取り込みモードのスキャンプロファイル。取り込みプロファイルである必要があります。取り込み以外のプロファイルは 400 で拒否されます。
スキャンに指定する Devin 添付ファイルの URL(例: attachments API を介してアップロードされたファイル)。添付ファイルは、スキャン対象の組織に属している必要があります。
101 - 2083スキャンの実行レベル:'normal'(デフォルト)では、モデルの推論レベルを低く設定し、トリアージと検証のバッチサイズを大きくします。'deep' ではパイプライン全体を実行します。
normal, deep 判明している場合は、リポジトリの Git ホスト。
スキャンのセッションを実行する場所:組織に設定されたプラットフォームラベル(例:'linux'、'windows'、'macos')、またはoutpost プール(BYOB)の名前を指定します。大文字と小文字は区別されません。名前が両方に一致する場合は、プラットフォームが優先されます。省略すると組織のデフォルトが適用されます。認識されない値を指定すると400エラーが返され、エラーボディには利用可能なプラットフォームラベルとoutpost プール名が列挙されます。
128スキャン対象のリポジトリの完全名。repo_nameまたはreposのいずれか一方だけに値を与えてください。
1回のスキャンで対象とするリポジトリ。最初の項目がスキャンのプライマリリポジトリになります。repo_nameまたはreposのいずれか一方だけに値を与えてください。
200Show child attributes
Show child attributes
レスポンス
成功レスポンス
1件のコードスキャン。
スキャンの作成日時(Unix秒)。
スキャンの実行レベル。'normal' はモデルの推論レベルを低くし、調査のバッチサイズを大きくします。'deep' はパイプライン全体を実行します。
normal, deep 既知の場合のリポジトリの Git ホスト。
スキャンが属する組織。
スキャンの実行時に使用されたプロファイル(ある場合)。
Show child attributes
Show child attributes
スキャンの主要なリポジトリ。マルチリポジトリスキャンには、ここに記載されていない追加のリポジトリも含まれます。
スキャンの一意の識別子。
作成時に記録されるスキャンのタイプ。
security, performance, db-queries, test-coverage, dead-code, code-quality, cleanup, telemetry, accessibility, compliance, general, migration-docs スキャンのステータス: waiting、pending、running、awaiting_user_input、completed、failed、または cancelled。
waiting, pending, running, awaiting_user_input, completed, failed, cancelled Devin webapp 内のスキャンページの URL。
スキャンのセッションを実行するアウトポストプール(設定されている場合)。
スキャンのセッションを実行するホスト型プラットフォームのラベル。スキャンがアウトポストプールまたは組織のデフォルトで実行される場合は Null。
ホスト名を含む主リポジトリの識別情報(例:github.com/org/repo)。git ホストを持たない Perforce デポの場合は Null。

