将组织固定到某个特定的成功构建
curl --request POST \
--url https://api.devin.ai/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.devin.ai/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin"
payload = {}
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({})
};
fetch('https://api.devin.ai/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin', 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/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin",
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([
]),
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/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin"
payload := strings.NewReader("{}")
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/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin")
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 = "{}"
response = http.request(request)
puts response.read_body{
"build_id": "<string>",
"completed_at": 123,
"created_at": 123,
"pinned": true,
"started_at": 123,
"triggered_by_user_id": "<string>",
"updated_at": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}快照设置(组织)
将组织固定到某个特定的成功构建
固定一个成功的构建(创建于 7 天内)。
将 SDK 的 400 错误转换为 409(根据规范:“如果构建未成功,或已超过 7 天,则返回 409”)。
POST
/
v3beta1
/
organizations
/
{org_id}
/
snapshot-setup
/
builds
/
{build_id}
/
pin
将组织固定到某个特定的成功构建
curl --request POST \
--url https://api.devin.ai/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.devin.ai/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin"
payload = {}
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({})
};
fetch('https://api.devin.ai/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin', 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/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin",
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([
]),
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/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin"
payload := strings.NewReader("{}")
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/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3beta1/organizations/{org_id}/snapshot-setup/builds/{build_id}/pin")
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 = "{}"
response = http.request(request)
puts response.read_body{
"build_id": "<string>",
"completed_at": 123,
"created_at": 123,
"pinned": true,
"started_at": 123,
"triggered_by_user_id": "<string>",
"updated_at": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}权限
ManageOrgSnapshots 权限的服务用户。
行为
授权
服务用户凭据(前缀:cog_)
请求体
application/json
POST /builds/{id}/pin 的请求体。根据规范为空。
响应
成功响应
公开的 Build 资源结构——一种仅用于判断“是否已成功”的不透明视图。
根据规范,不提供平台/快照/各个 job 的内部信息。未来新增字段
(triggered_by_repo、构建元数据等)均为叠加式扩展。
⌘I

