curl --request POST \
--url https://api.decimal.ai/api/v1/agents/{agent_name}/prompt/pin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version_mode": "<string>",
"version_number": 2
}
'import requests
url = "https://api.decimal.ai/api/v1/agents/{agent_name}/prompt/pin"
payload = {
"version_mode": "<string>",
"version_number": 2
}
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({version_mode: '<string>', version_number: 2})
};
fetch('https://api.decimal.ai/api/v1/agents/{agent_name}/prompt/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.decimal.ai/api/v1/agents/{agent_name}/prompt/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([
'version_mode' => '<string>',
'version_number' => 2
]),
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.decimal.ai/api/v1/agents/{agent_name}/prompt/pin"
payload := strings.NewReader("{\n \"version_mode\": \"<string>\",\n \"version_number\": 2\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.decimal.ai/api/v1/agents/{agent_name}/prompt/pin")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version_mode\": \"<string>\",\n \"version_number\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decimal.ai/api/v1/agents/{agent_name}/prompt/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 = "{\n \"version_mode\": \"<string>\",\n \"version_number\": 2\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Pin this agent's prompt to a version, or track latest
Set version_mode and the pin together, in one UPDATE.
Separate from PUT on purpose: folding them would let a content edit silently change resolution mode.
The target is a version_number resolved within THIS agent’s prompt, so a
number belonging to another agent 404s rather than pinning across a tenancy
boundary. version_mode and pinned_version_id are assigned together so
ck_agent_prompt_pin_consistent is never transiently violated — a CHECK
violation would be a 500, so this validates first and the CHECK is the
backstop.
curl --request POST \
--url https://api.decimal.ai/api/v1/agents/{agent_name}/prompt/pin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version_mode": "<string>",
"version_number": 2
}
'import requests
url = "https://api.decimal.ai/api/v1/agents/{agent_name}/prompt/pin"
payload = {
"version_mode": "<string>",
"version_number": 2
}
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({version_mode: '<string>', version_number: 2})
};
fetch('https://api.decimal.ai/api/v1/agents/{agent_name}/prompt/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.decimal.ai/api/v1/agents/{agent_name}/prompt/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([
'version_mode' => '<string>',
'version_number' => 2
]),
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.decimal.ai/api/v1/agents/{agent_name}/prompt/pin"
payload := strings.NewReader("{\n \"version_mode\": \"<string>\",\n \"version_number\": 2\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.decimal.ai/api/v1/agents/{agent_name}/prompt/pin")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version_mode\": \"<string>\",\n \"version_number\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decimal.ai/api/v1/agents/{agent_name}/prompt/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 = "{\n \"version_mode\": \"<string>\",\n \"version_number\": 2\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Enter your API key (e.g. dai_sk_test_key_001)
Path Parameters
Cookies
Body
Body of POST /api/v1/agents/{agent_name}/prompt/pin.
The pin target is a version_number resolved WITHIN this agent's prompt,
never a bare version_id from the body — an id supplied by the caller is
a tenancy leak dressed as a pin.
Response
Successful Response
The response is of type Response Pin Agent Prompt Api V1 Agents Agent Name Prompt Pin Post · object.