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{
"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": {
"candidate_hash": "<string>",
"resource_hash": "<string>",
"config": {},
"dependency_hash": "<string>",
"preparation_operation_id": "<string>",
"retry_after_seconds": 30
},
"candidate": {}
}{
"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": {
"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."
}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.
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{
"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": {
"candidate_hash": "<string>",
"resource_hash": "<string>",
"config": {},
"dependency_hash": "<string>",
"preparation_operation_id": "<string>",
"retry_after_seconds": 30
},
"candidate": {}
}{
"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": {
"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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Voice agent ID.
"550e8400-e29b-41d4-a716-446655440000"
Agent config version number.
x >= 1Body
When true, also restore the agent name recorded in the version. By
default the agent keeps its current name.
Response
Restore preview. Check state — ready previews can be accepted; failed previews list blocking issues.
ready: the restore can be accepted with the returned hashes.preparing: referenced organisation resources are still being resolved; retry the preview.failed: the restore is blocked by the listedissues.
ready, preparing, failed exact Version number being restored.
"550e8400-e29b-41d4-a716-446655440000"
The agent's latest version number.
"550e8400-e29b-41d4-a716-446655440000"
Content hash of the agent's current config.
Content hash of the version being restored.
Content hash of the config that would be applied.
Opaque hash binding this preview; pass it unchanged to the accept endpoint. Present when state is ready.
Top-level config fields that would change.
Show child attributes
Show child attributes
Source of candidate_hash, resource_hash, and dependency_hash for the accept request.
Show child attributes
Show child attributes
The config document that would be applied.
Was this page helpful?