Edit a help center theme design
curl --request PATCH \
--url http://localhost:8080/hc/{id}/themes/{designId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"files": {}
}
'import requests
url = "http://localhost:8080/hc/{id}/themes/{designId}"
payload = {
"expected_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"files": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expected_revision_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', files: {}})
};
fetch('http://localhost:8080/hc/{id}/themes/{designId}', 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/{designId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expected_revision_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'files' => [
]
]),
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/{designId}"
payload := strings.NewReader("{\n \"expected_revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"files\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://localhost:8080/hc/{id}/themes/{designId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"files\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/hc/{id}/themes/{designId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"files\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"preset": "default",
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"help_center_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"languages": [
"<string>"
],
"files": {},
"history": [
{
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"published": true
}
],
"template_preview": true,
"history_page": {
"total": 4503599627370495,
"next_cursor": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"has_published_revision": true
},
"selected_revision": {
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"published": true
}
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Theme designs
Update
Save changed files together in a new revision. Pass the current draft revision and use null for each file you want to remove from the design.
PATCH
/
hc
/
{id}
/
themes
/
{designId}
Edit a help center theme design
curl --request PATCH \
--url http://localhost:8080/hc/{id}/themes/{designId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"files": {}
}
'import requests
url = "http://localhost:8080/hc/{id}/themes/{designId}"
payload = {
"expected_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"files": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expected_revision_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', files: {}})
};
fetch('http://localhost:8080/hc/{id}/themes/{designId}', 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/{designId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expected_revision_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'files' => [
]
]),
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/{designId}"
payload := strings.NewReader("{\n \"expected_revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"files\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://localhost:8080/hc/{id}/themes/{designId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"files\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/hc/{id}/themes/{designId}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_revision_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"files\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"preset": "default",
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"help_center_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"languages": [
"<string>"
],
"files": {},
"history": [
{
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"published": true
}
],
"template_preview": true,
"history_page": {
"total": 4503599627370495,
"next_cursor": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"has_published_revision": true
},
"selected_revision": {
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"published": true
}
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}For a template preview, the first successful update saves a private design with the same ID. Pass its preview revision as
expected_revision_id. An empty files map saves the starter as it appears. A validation error leaves the preview unsaved.
If the update returns a file count or size error, reduce the changes or remove unused files from the design and retry with the same revision. The update is applied as a whole.
Use the optional history_limit=0 query parameter when you only need the saved files and new revision. The default response includes the full history.Authorizations
Path Parameters
Query Parameters
Body
application/json
Response
Default Response
Was this page helpful?