Create a prompt version checkpoint
curl --request POST \
--url https://your-instance.example.com/api/prompts/{promptId}/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "Pre-launch checkpoint",
"displayVersion": "v1.4",
"title": "Pre-launch",
"description": "Snapshot before rolling out to production.",
"source": "manual_save"
}
'import requests
url = "https://your-instance.example.com/api/prompts/{promptId}/versions"
payload = {
"label": "Pre-launch checkpoint",
"displayVersion": "v1.4",
"title": "Pre-launch",
"description": "Snapshot before rolling out to production.",
"source": "manual_save"
}
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({
label: 'Pre-launch checkpoint',
displayVersion: 'v1.4',
title: 'Pre-launch',
description: 'Snapshot before rolling out to production.',
source: 'manual_save'
})
};
fetch('https://your-instance.example.com/api/prompts/{promptId}/versions', 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://your-instance.example.com/api/prompts/{promptId}/versions",
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([
'label' => 'Pre-launch checkpoint',
'displayVersion' => 'v1.4',
'title' => 'Pre-launch',
'description' => 'Snapshot before rolling out to production.',
'source' => 'manual_save'
]),
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://your-instance.example.com/api/prompts/{promptId}/versions"
payload := strings.NewReader("{\n \"label\": \"Pre-launch checkpoint\",\n \"displayVersion\": \"v1.4\",\n \"title\": \"Pre-launch\",\n \"description\": \"Snapshot before rolling out to production.\",\n \"source\": \"manual_save\"\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://your-instance.example.com/api/prompts/{promptId}/versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Pre-launch checkpoint\",\n \"displayVersion\": \"v1.4\",\n \"title\": \"Pre-launch\",\n \"description\": \"Snapshot before rolling out to production.\",\n \"source\": \"manual_save\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/prompts/{promptId}/versions")
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 \"label\": \"Pre-launch checkpoint\",\n \"displayVersion\": \"v1.4\",\n \"title\": \"Pre-launch\",\n \"description\": \"Snapshot before rolling out to production.\",\n \"source\": \"manual_save\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Version saved",
"skipped": false,
"version": 5,
"versionId": "65f9b1c2e8a1d4e001a0b1c4"
}{
"error": "Prompt not found",
"details": "No prompt with id 5f7b1c2e8a1d4e0012c3b4a5 belongs to this user."
}{
"error": "Prompt not found",
"details": "No prompt with id 5f7b1c2e8a1d4e0012c3b4a5 belongs to this user."
}{
"error": "Prompt not found",
"details": "No prompt with id 5f7b1c2e8a1d4e0012c3b4a5 belongs to this user."
}Prompts
Create a prompt version checkpoint
Snapshots the prompt text into a new immutable version. If prompt text is omitted, the current prompt body is used. Returns the new version document; if the text is unchanged from the latest version, the request is treated as a no-op and skipped is true.
POST
/
api
/
prompts
/
{promptId}
/
versions
Create a prompt version checkpoint
curl --request POST \
--url https://your-instance.example.com/api/prompts/{promptId}/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "Pre-launch checkpoint",
"displayVersion": "v1.4",
"title": "Pre-launch",
"description": "Snapshot before rolling out to production.",
"source": "manual_save"
}
'import requests
url = "https://your-instance.example.com/api/prompts/{promptId}/versions"
payload = {
"label": "Pre-launch checkpoint",
"displayVersion": "v1.4",
"title": "Pre-launch",
"description": "Snapshot before rolling out to production.",
"source": "manual_save"
}
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({
label: 'Pre-launch checkpoint',
displayVersion: 'v1.4',
title: 'Pre-launch',
description: 'Snapshot before rolling out to production.',
source: 'manual_save'
})
};
fetch('https://your-instance.example.com/api/prompts/{promptId}/versions', 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://your-instance.example.com/api/prompts/{promptId}/versions",
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([
'label' => 'Pre-launch checkpoint',
'displayVersion' => 'v1.4',
'title' => 'Pre-launch',
'description' => 'Snapshot before rolling out to production.',
'source' => 'manual_save'
]),
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://your-instance.example.com/api/prompts/{promptId}/versions"
payload := strings.NewReader("{\n \"label\": \"Pre-launch checkpoint\",\n \"displayVersion\": \"v1.4\",\n \"title\": \"Pre-launch\",\n \"description\": \"Snapshot before rolling out to production.\",\n \"source\": \"manual_save\"\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://your-instance.example.com/api/prompts/{promptId}/versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Pre-launch checkpoint\",\n \"displayVersion\": \"v1.4\",\n \"title\": \"Pre-launch\",\n \"description\": \"Snapshot before rolling out to production.\",\n \"source\": \"manual_save\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/prompts/{promptId}/versions")
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 \"label\": \"Pre-launch checkpoint\",\n \"displayVersion\": \"v1.4\",\n \"title\": \"Pre-launch\",\n \"description\": \"Snapshot before rolling out to production.\",\n \"source\": \"manual_save\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Version saved",
"skipped": false,
"version": 5,
"versionId": "65f9b1c2e8a1d4e001a0b1c4"
}{
"error": "Prompt not found",
"details": "No prompt with id 5f7b1c2e8a1d4e0012c3b4a5 belongs to this user."
}{
"error": "Prompt not found",
"details": "No prompt with id 5f7b1c2e8a1d4e0012c3b4a5 belongs to this user."
}{
"error": "Prompt not found",
"details": "No prompt with id 5f7b1c2e8a1d4e0012c3b4a5 belongs to this user."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Response
Version saved (or no-op when unchanged)
Show child attributes
Show child attributes
Example:
{
"_id": "65f9b1c2e8a1d4e001a0b1c3",
"version": 4,
"label": "Friendlier tone",
"displayVersion": "v1.3",
"title": "Tone update",
"description": "Softened the opening line.",
"source": "manual_save",
"createdAt": "2026-04-22T10:14:00.000Z",
"matchesCurrentPrompt": true,
"preview": "<prompt><role>Leasing assistant</role>..."
}
⌘I