Preview version restore
curl --request POST \
--url https://api.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"restore_historical_name": false
}
'import requests
url = "https://api.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview"
payload = { "restore_historical_name": False }
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({restore_historical_name: false})
};
fetch('https://api.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview', 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.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview",
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([
'restore_historical_name' => false
]),
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.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview"
payload := strings.NewReader("{\n \"restore_historical_name\": false\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.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"restore_historical_name\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview")
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 \"restore_historical_name\": false\n}"
response = http.request(request)
puts response.read_body{
"state": "ready",
"restore_kind": "exact",
"target_version": 123,
"target_version_id": "550e8400-e29b-41d4-a716-446655440000",
"current_version": 123,
"current_version_id": "550e8400-e29b-41d4-a716-446655440000",
"current_config_hash": "<string>",
"target_config_hash": "<string>",
"candidate_config_hash": "<string>",
"acceptance_hash": "<string>",
"changed_fields": [
"<string>"
],
"issues": [
{
"path": "<string>",
"code": "<string>",
"resource_type": "<string>",
"message": "<string>",
"resource_id": "<string>",
"remediation": "<string>"
}
],
"preparation": {
"state": "ready",
"candidate_hash": "<string>",
"resource_hash": "<string>",
"config": {},
"dependency_hash": "<string>",
"preparation_operation_id": "<string>",
"retry_after_seconds": 30
},
"candidate": {}
}{
"state": "ready",
"restore_kind": "exact",
"target_version": 123,
"target_version_id": "550e8400-e29b-41d4-a716-446655440000",
"current_version": 123,
"current_version_id": "550e8400-e29b-41d4-a716-446655440000",
"current_config_hash": "<string>",
"target_config_hash": "<string>",
"candidate_config_hash": "<string>",
"acceptance_hash": "<string>",
"changed_fields": [
"<string>"
],
"issues": [
{
"path": "<string>",
"code": "<string>",
"resource_type": "<string>",
"message": "<string>",
"resource_id": "<string>",
"remediation": "<string>"
}
],
"preparation": {
"state": "ready",
"candidate_hash": "<string>",
"resource_hash": "<string>",
"config": {},
"dependency_hash": "<string>",
"preparation_operation_id": "<string>",
"retry_after_seconds": 30
},
"candidate": {}
}{
"detail": "Authentication is required for this endpoint."
}{
"detail": "You do not have access to this resource."
}{
"detail": "The requested resource was not found."
}{
"detail": "The historical AgentConfig cannot be activated safely."
}{
"detail": [
{
"loc": [
"body",
"language"
],
"msg": "Input should be a valid string",
"type": "string_type"
}
]
}{
"detail": "An unexpected internal error occurred."
}Versions
Preview version restore
Compute what restoring this version would change, without applying anything.
The preview returns the changed fields, any configuration issues, and the
hashes needed to accept the restore: copy acceptance_hash from the preview
and candidate_hash, resource_hash, and dependency_hash from its
preparation object into the accept request. The request body is optional;
when restore_historical_name is set here it must be sent with the same value
on accept.
POST
/
v1
/
agents
/
{agent_id}
/
versions
/
{version_number}
/
restore
/
preview
Preview version restore
curl --request POST \
--url https://api.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"restore_historical_name": false
}
'import requests
url = "https://api.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview"
payload = { "restore_historical_name": False }
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({restore_historical_name: false})
};
fetch('https://api.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview', 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.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview",
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([
'restore_historical_name' => false
]),
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.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview"
payload := strings.NewReader("{\n \"restore_historical_name\": false\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.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"restore_historical_name\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agents.slng.ai/v1/agents/{agent_id}/versions/{version_number}/restore/preview")
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 \"restore_historical_name\": false\n}"
response = http.request(request)
puts response.read_body{
"state": "ready",
"restore_kind": "exact",
"target_version": 123,
"target_version_id": "550e8400-e29b-41d4-a716-446655440000",
"current_version": 123,
"current_version_id": "550e8400-e29b-41d4-a716-446655440000",
"current_config_hash": "<string>",
"target_config_hash": "<string>",
"candidate_config_hash": "<string>",
"acceptance_hash": "<string>",
"changed_fields": [
"<string>"
],
"issues": [
{
"path": "<string>",
"code": "<string>",
"resource_type": "<string>",
"message": "<string>",
"resource_id": "<string>",
"remediation": "<string>"
}
],
"preparation": {
"state": "ready",
"candidate_hash": "<string>",
"resource_hash": "<string>",
"config": {},
"dependency_hash": "<string>",
"preparation_operation_id": "<string>",
"retry_after_seconds": 30
},
"candidate": {}
}{
"state": "ready",
"restore_kind": "exact",
"target_version": 123,
"target_version_id": "550e8400-e29b-41d4-a716-446655440000",
"current_version": 123,
"current_version_id": "550e8400-e29b-41d4-a716-446655440000",
"current_config_hash": "<string>",
"target_config_hash": "<string>",
"candidate_config_hash": "<string>",
"acceptance_hash": "<string>",
"changed_fields": [
"<string>"
],
"issues": [
{
"path": "<string>",
"code": "<string>",
"resource_type": "<string>",
"message": "<string>",
"resource_id": "<string>",
"remediation": "<string>"
}
],
"preparation": {
"state": "ready",
"candidate_hash": "<string>",
"resource_hash": "<string>",
"config": {},
"dependency_hash": "<string>",
"preparation_operation_id": "<string>",
"retry_after_seconds": 30
},
"candidate": {}
}{
"detail": "Authentication is required for this endpoint."
}{
"detail": "You do not have access to this resource."
}{
"detail": "The requested resource was not found."
}{
"detail": "The historical AgentConfig cannot be activated safely."
}{
"detail": [
{
"loc": [
"body",
"language"
],
"msg": "Input should be a valid string",
"type": "string_type"
}
]
}{
"detail": "An unexpected internal error occurred."
}Authorizations
Path Parameters
Body
application/json
Response
Restore preview. Check state — ready previews can be accepted; failed previews list blocking issues.