Restore a published theme or the original
curl --request POST \
--url http://localhost:8080/hc/{id}/themes/restore \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_live_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirmed_tracking_losses": []
}
'import requests
url = "http://localhost:8080/hc/{id}/themes/restore"
payload = {
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_live_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirmed_tracking_losses": []
}
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({
revision_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expected_live_revision_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
confirmed_tracking_losses: []
})
};
fetch('http://localhost:8080/hc/{id}/themes/restore', 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 => "8080",
CURLOPT_URL => "http://localhost:8080/hc/{id}/themes/restore",
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([
'revision_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expected_live_revision_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'confirmed_tracking_losses' => [
]
]),
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:8080/hc/{id}/themes/restore"
payload := strings.NewReader("{\n \"revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_live_revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmed_tracking_losses\": []\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:8080/hc/{id}/themes/restore")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_live_revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmed_tracking_losses\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/hc/{id}/themes/restore")
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 \"revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_live_revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmed_tracking_losses\": []\n}"
response = http.request(request)
puts response.read_body{
"live_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"statusCode": 400,
"code": "theme_page_check_failed",
"message": "<string>",
"issue": {
"reason": "missing_article_body",
"template": "<string>",
"page": "<string>",
"locale": "<string>",
"title": "<string>"
}
}{
"statusCode": 422,
"code": "theme_tracking_confirmation_required",
"message": "<string>",
"tracking_losses": [
"search_results"
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Theme designs
Restore
Restore a previously published version, or pass null for the original site design. The request must identify the currently live revision.
POST
/
hc
/
{id}
/
themes
/
restore
Restore a published theme or the original
curl --request POST \
--url http://localhost:8080/hc/{id}/themes/restore \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_live_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirmed_tracking_losses": []
}
'import requests
url = "http://localhost:8080/hc/{id}/themes/restore"
payload = {
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_live_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirmed_tracking_losses": []
}
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({
revision_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expected_live_revision_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
confirmed_tracking_losses: []
})
};
fetch('http://localhost:8080/hc/{id}/themes/restore', 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 => "8080",
CURLOPT_URL => "http://localhost:8080/hc/{id}/themes/restore",
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([
'revision_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'expected_live_revision_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'confirmed_tracking_losses' => [
]
]),
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:8080/hc/{id}/themes/restore"
payload := strings.NewReader("{\n \"revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_live_revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmed_tracking_losses\": []\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:8080/hc/{id}/themes/restore")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_live_revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmed_tracking_losses\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/hc/{id}/themes/restore")
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 \"revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"expected_live_revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmed_tracking_losses\": []\n}"
response = http.request(request)
puts response.read_body{
"live_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"statusCode": 400,
"code": "theme_page_check_failed",
"message": "<string>",
"issue": {
"reason": "missing_article_body",
"template": "<string>",
"page": "<string>",
"locale": "<string>",
"title": "<string>"
}
}{
"statusCode": 422,
"code": "theme_tracking_confirmation_required",
"message": "<string>",
"tracking_losses": [
"search_results"
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}A restore compares the reviewed version with the current live design. If it would lose search reporting or helpfulness votes, the response is
422 with code theme_tracking_confirmation_required and a tracking_losses list. After the editor explicitly accepts the losses, repeat the same restore with those values in confirmed_tracking_losses. Restoring tracking requires no confirmation.
Restoring a saved revision checks its templates against current content in each language. A 400 with code theme_page_check_failed includes the affected title, locale, localized preview path (page), template, and reason in issue. Repair a private draft based on that revision, preview the affected page, then publish the repaired draft. You can restore the site’s original design by passing null.
If the response is 400 and names a conditional control, the comparison could not verify that version. You can choose another published version or publish a draft with the affected search or feedback control outside the condition.Authorizations
Path Parameters
Body
application/json
Was this page helpful?