curl --request PATCH \
--url https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"build_on_default_branch_commit": true,
"contents": "<string>",
"position": 123,
"report_check_runs": true
}
'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}"
payload = {
"build_on_default_branch_commit": True,
"contents": "<string>",
"position": 123,
"report_check_runs": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
build_on_default_branch_commit: true,
contents: '<string>',
position: 123,
report_check_runs: true
})
};
fetch('https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}', 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/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'build_on_default_branch_commit' => true,
'contents' => '<string>',
'position' => 123,
'report_check_runs' => true
]),
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/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}"
payload := strings.NewReader("{\n \"build_on_default_branch_commit\": true,\n \"contents\": \"<string>\",\n \"position\": 123,\n \"report_check_runs\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"build_on_default_branch_commit\": true,\n \"contents\": \"<string>\",\n \"position\": 123,\n \"report_check_runs\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"build_on_default_branch_commit\": true,\n \"contents\": \"<string>\",\n \"position\": 123,\n \"report_check_runs\": true\n}"
response = http.request(request)
puts response.read_body{
"blueprint_id": "<string>",
"created_at": 123,
"repo_name": "<string>",
"type": "enterprise",
"updated_at": 123,
"build_on_default_branch_commit": true,
"report_check_runs": true,
"source": "git"
}{
"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"
}ブループリントの内容、位置、ソース、コミット-build 設定のいずれか、または複数を更新する
単一のブループリントを部分更新します。build は自動的にトリガーされません。
適用されるフィールド:
contents— ブループリントの新しい YAML バージョンを書き込みます。position— リポジトリレベルのブループリントの実行順序を設定します。 組織レベルのブループリントには実行順序がないため、400を返します。source— リポジトリのモードをgitとdatabaseの間で切り替えます。 repo ティアのルートブループリントのみが対象です。{"source": "database", "contents": ...}を指定すると Git との連携を解除し、contentsを新しい唯一のバージョンにします。build_on_default_branch_commit/report_check_runs— リポジトリごとの コミット時の build と、それに対応する GitHub チェックの実行を設定します。 github.com リポジトリのルートブループリントのみが対象です。
リクエストボディが空の場合は 400 を返します。
curl --request PATCH \
--url https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"build_on_default_branch_commit": true,
"contents": "<string>",
"position": 123,
"report_check_runs": true
}
'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}"
payload = {
"build_on_default_branch_commit": True,
"contents": "<string>",
"position": 123,
"report_check_runs": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
build_on_default_branch_commit: true,
contents: '<string>',
position: 123,
report_check_runs: true
})
};
fetch('https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}', 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/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'build_on_default_branch_commit' => true,
'contents' => '<string>',
'position' => 123,
'report_check_runs' => true
]),
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/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}"
payload := strings.NewReader("{\n \"build_on_default_branch_commit\": true,\n \"contents\": \"<string>\",\n \"position\": 123,\n \"report_check_runs\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"build_on_default_branch_commit\": true,\n \"contents\": \"<string>\",\n \"position\": 123,\n \"report_check_runs\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"build_on_default_branch_commit\": true,\n \"contents\": \"<string>\",\n \"position\": 123,\n \"report_check_runs\": true\n}"
response = http.request(request)
puts response.read_body{
"blueprint_id": "<string>",
"created_at": 123,
"repo_name": "<string>",
"type": "enterprise",
"updated_at": 123,
"build_on_default_branch_commit": true,
"report_check_runs": true,
"source": "git"
}{
"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"
}権限
組織レベルでManageRepoBlueprints 権限を持つサービスユーザーまたはパーソナルアクセストークンが必要です。組織ティアのブループリントを作成または更新するには、ManageOrgSnapshots 権限が必要です。
動作
ブループリントの内容や位置を更新します。ビルドは自動ではトリガーされません。承認
サービスユーザーの認証情報(接頭辞: cog_)
ボディ
org ティアまたはリポジトリレベルのブループリントの部分更新。
フィールドは任意の一部を指定できます。指定されていないフィールドはそのまま保持されます。
org ティアのブループリントで position、source またはコミット-build 設定を
指定すると 400 を返します。これらを持てるのはリポジトリレベルのブループリントのみです。
build はトリガーされません。
設定すると、デフォルトブランチへのプッシュごとに環境を build するかどうかを切り替えます。github.com リポジトリのルートブループリントでのみ指定できます。該当するプッシュのたびに build がキューに追加されます。
設定されている場合、ブループリントの YAML 本文を新しいバージョンに置き換えます。
設定されている場合、この repo ティアのブループリントの実行順を更新します。位置は一意である必要はありません。実行順に並べ替える際、同順位のものは server が任意に決定します。
設定すると、各コミットの build を GitHub チェック run として報告するかどうかを切り替えます。有効にするには 'build_on_default_branch_commit' がオンになっている必要があります。
指定すると、リポジトリのブループリントのソースを切り替えます。リポジトリのルートブループリントでのみ指定できます(スコープ付きブループリントはこの設定を継承します)。'git' はデフォルトブランチから .devin/blueprint.yaml を取得し(存在しない場合は 404)、'contents' とは併用できません。'database' は現在の YAML('contents' が指定されている場合はその内容)を保持し、リポジトリからの同期を停止します。ブループリントがすでにそのモードの場合は no-op です。
git, database レスポンス
成功レスポンス
公開 Blueprint リソースの形式。
注: type 列挙型には今後値が追加される可能性があります。クライアントは未知の値を必ず適切に処理する必要があります。YAML内容は GET /blueprints/{id}/contents で別途取得します。
enterprise, org, repo リポジトリのデフォルトブランチにプッシュされるたびに環境を build するかどうか。リポジトリのルートブループリントでない場合は Null。
各コミットの build を、そのコミットの GitHub チェック run として報告するかどうか。リポジトリのルートブループリントでない場合は Null。
YAML の作成場所: 'git'(リポジトリ内の .devin/blueprint.yaml から同期)または 'database'(API/UI で編集)。Enterprise レベルおよび組織レベルのブループリントでは常に null です。
git, database 
