curl --request POST \
--url https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": "<string>",
"repo_name": "<string>"
}
'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints"
payload = {
"contents": "<string>",
"repo_name": "<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({contents: '<string>', repo_name: '<string>'})
};
fetch('https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints', 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",
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([
'contents' => '<string>',
'repo_name' => '<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/organizations/{org_id}/snapshot-setup/blueprints"
payload := strings.NewReader("{\n \"contents\": \"<string>\",\n \"repo_name\": \"<string>\"\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/organizations/{org_id}/snapshot-setup/blueprints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contents\": \"<string>\",\n \"repo_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints")
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 \"contents\": \"<string>\",\n \"repo_name\": \"<string>\"\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"
}Crea un modello a livello org o repo
Crea un modello. type viene dedotto da repo_name.
source ha come valore predefinito database. Con source='git' il contenuto YAML
(e gli eventuali includes) viene letto da .devin/blueprint.yaml sul
branch predefinito del repo — 404 se il file è assente, 422 se non è
valido, 502 se il Provider Git non è raggiungibile.
Come previsto dalla specifica, questa operazione non avvia mai automaticamente una build — i chiamanti devono
eseguire esplicitamente POST /builds.
curl --request POST \
--url https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": "<string>",
"repo_name": "<string>"
}
'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints"
payload = {
"contents": "<string>",
"repo_name": "<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({contents: '<string>', repo_name: '<string>'})
};
fetch('https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints', 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",
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([
'contents' => '<string>',
'repo_name' => '<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/organizations/{org_id}/snapshot-setup/blueprints"
payload := strings.NewReader("{\n \"contents\": \"<string>\",\n \"repo_name\": \"<string>\"\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/organizations/{org_id}/snapshot-setup/blueprints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contents\": \"<string>\",\n \"repo_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/snapshot-setup/blueprints")
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 \"contents\": \"<string>\",\n \"repo_name\": \"<string>\"\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"
}Autorizzazioni
Richiede un utente di servizio o un token di accesso personale con l’autorizzazioneManageRepoBlueprints a livello dell’organizzazione. La creazione di blueprint a livello org richiede l’autorizzazione ManageOrgSnapshots.
Comportamento
Crea un blueprint di livello org o repo. Un blueprint definisce la configurazione dichiarativa dell’ambiente per le sessioni di Devin. La modifica di un blueprint non attiva automaticamente una build: devi chiamare esplicitamente l’endpoint builds.repo_name aggiunge anche quel repository all’ambiente: non esiste un endpoint separato per registrare prima il repo. Il repository viene clonato nell’ambiente alla build successiva e ne viene avviata l’indicizzazione.Vale anche il contrario: rimuovere un repository dall’ambiente (l’interruttore Includi nell’ambiente nell’UI) elimina tutti i blueprint per quel repo, inclusi tutti i relativi ambiti del workspace.owner/repo); un repo sconosciuto o inaccessibile restituisce 404 e non viene creato alcun blueprint. Se esiste già un blueprint attivo per quel repo e ambito, la richiesta restituisce 409: utilizza invece l’endpoint di aggiornamento.Autorizzazioni
Credenziale dell'utente del servizio (prefisso: cog_)
Parametri del percorso
ID dell'organizzazione (prefisso: org-)
"org-abc123def456"
Corpo
Corpo YAML iniziale facoltativo per il blueprint. Non consentito con source='git' (i contenuti provengono dal repo).
Se impostato, crea un blueprint di livello repo per quel repository. Se omesso, crea un blueprint org-wide (a livello org).
Solo a livello di repo. 'git' legge .devin/blueprint.yaml (e i file inclusi) dal branch predefinito del repo e mantiene la blueprint sincronizzata con il file; 'database' memorizza lo YAML in Devin. Se omesso, il valore predefinito è 'database'.
git, database Risposta
Risposta riuscita
Forma pubblica della risorsa Blueprint.
Note: l'enum type potrebbe estendersi in futuro; i client DEVONO gestire correttamente
i valori sconosciuti. Il contenuto YAML viene recuperato separatamente tramite
GET /blueprints/{id}/contents.
enterprise, org, repo Indica se ogni push al branch predefinito del repo avvia la build dell'ambiente. null se non si tratta del modello radice di un repo.
Indica se ogni build di un commit viene riportata sul commit come run di un controllo GitHub. null se non si tratta del modello radice di un repo.
Dove viene creato il file YAML: 'git' (sincronizzato da .devin/blueprint.yaml nel repository) o 'database' (modificato tramite API/interfaccia utente). Sempre null per i blueprint a livello enterprise e org.
git, database 
