Rollback a Prompt
curl --request POST \
--url http://localhost:3000/v1/prompts/{id}/rollback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_version": 123,
"rollback_reason": "<string>"
}
'import requests
url = "http://localhost:3000/v1/prompts/{id}/rollback"
payload = {
"target_version": 123,
"rollback_reason": "<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({target_version: 123, rollback_reason: '<string>'})
};
fetch('http://localhost:3000/v1/prompts/{id}/rollback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v1/prompts/{id}/rollback",
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([
'target_version' => 123,
'rollback_reason' => '<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 := "http://localhost:3000/v1/prompts/{id}/rollback"
payload := strings.NewReader("{\n \"target_version\": 123,\n \"rollback_reason\": \"<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("http://localhost:3000/v1/prompts/{id}/rollback")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_version\": 123,\n \"rollback_reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v1/prompts/{id}/rollback")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_version\": 123,\n \"rollback_reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"version": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prompt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"template": "Hello {{.name}}!",
"model": "anthropic/claude-opus-4-6",
"model_params": {
"temperature": 0.7,
"max_tokens": 1024,
"thinking": {
"type": "enabled",
"budget_tokens": 512
}
},
"created_at": "2023-11-07T05:31:56Z",
"published_at": "2023-11-07T05:31:56Z",
"tags": [
"<string>"
]
}
}{
"error": "invalid credentials"
}{
"error": "invalid credentials"
}{
"error": "invalid credentials"
}{
"error": "invalid credentials"
}Prompts
Rollback a Prompt
Instantly demotes the active live version and promotes a target historical version in a single atomic transaction.
POST
/
v1
/
prompts
/
{id}
/
rollback
Rollback a Prompt
curl --request POST \
--url http://localhost:3000/v1/prompts/{id}/rollback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_version": 123,
"rollback_reason": "<string>"
}
'import requests
url = "http://localhost:3000/v1/prompts/{id}/rollback"
payload = {
"target_version": 123,
"rollback_reason": "<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({target_version: 123, rollback_reason: '<string>'})
};
fetch('http://localhost:3000/v1/prompts/{id}/rollback', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v1/prompts/{id}/rollback",
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([
'target_version' => 123,
'rollback_reason' => '<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 := "http://localhost:3000/v1/prompts/{id}/rollback"
payload := strings.NewReader("{\n \"target_version\": 123,\n \"rollback_reason\": \"<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("http://localhost:3000/v1/prompts/{id}/rollback")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_version\": 123,\n \"rollback_reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v1/prompts/{id}/rollback")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_version\": 123,\n \"rollback_reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"version": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prompt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"template": "Hello {{.name}}!",
"model": "anthropic/claude-opus-4-6",
"model_params": {
"temperature": 0.7,
"max_tokens": 1024,
"thinking": {
"type": "enabled",
"budget_tokens": 512
}
},
"created_at": "2023-11-07T05:31:56Z",
"published_at": "2023-11-07T05:31:56Z",
"tags": [
"<string>"
]
}
}{
"error": "invalid credentials"
}{
"error": "invalid credentials"
}{
"error": "invalid credentials"
}{
"error": "invalid credentials"
}Authorizations
Use an access token retrieved from login (Bearer sess_...) or a programmatic API key (Bearer ak_...).
Path Parameters
Body
application/json
Response
Prompt successfully rolled back
Show child attributes
Show child attributes
⌘I

