API Reference Update Organization Theme
Update Organization Theme
Save a new version of an organization theme, or rename it
Session token
Changing preset, appearance or themeOverrides creates a new version;
every earlier version stays as it was. Projects that follow the latest version
pick it up on their next build; pinned projects don't. A request that only
changes name renames the theme in place, without a new version.
Needs the organization admin role (or owner). A caller outside the organization gets 404. These endpoints need a session token; API keys get 401.
Request Body
Send at least one field.
NameDescription
nameNew display name, 1–80 characters.
presetA v2 preset name.
appearanceThe new version's
appearance settings.themeOverridesThe new version's
themeOverrides.Response
The updated theme, with its new version.
Error Responses
| Status | Code | When |
|---|---|---|
| 400 | validation_error | No field sent |
| 400 | invalid_theme | An unknown preset, or an appearance value the build would reject |
| 403 | org_admin_required | You're a member, not an admin |
| 404 | theme_not_found | No theme with this slug |
Was this page helpful? Yes No
Previous
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl -X PATCH https://api.syntext.dev/v1/orgs/org_123/themes/brand \
-H "Authorization: Bearer <session token>" \
-H "Content-Type: application/json" \
-d '{ "appearance": { "accent": "#0F766E", "radius": "small" } }'
const response = await fetch('https://api.syntext.dev/v1/orgs/org_123/themes/brand', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer <session token>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"appearance": {
"accent": "#0F766E",
"radius": "small"
}
}),
});
const data = await response.json();
console.log(response.status, data);
import requests
url = "https://api.syntext.dev/v1/orgs/org_123/themes/brand"
headers = {
"Authorization": "Bearer <session token>",
}
payload = {
"appearance": {
"accent": "#0F766E",
"radius": "small",
},
}
response = requests.patch(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"appearance": {
"accent": "#0F766E",
"radius": "small"
}
}`)
req, err := http.NewRequest("PATCH", "https://api.syntext.dev/v1/orgs/org_123/themes/brand", bytes.NewReader(payload))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <session token>")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status)
fmt.Println(string(body))
}
require "json"
require "net/http"
require "uri"
uri = URI("https://api.syntext.dev/v1/orgs/org_123/themes/brand")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Patch.new(uri)
request["Authorization"] = "Bearer <session token>"
request["Content-Type"] = "application/json"
request.body = JSON.generate({
"appearance" => {
"accent" => "#0F766E",
"radius" => "small",
},
})
response = http.request(request)
puts response.code
puts response.body
<?php
$payload = [
'appearance' => [
'accent' => '#0F766E',
'radius' => 'small',
],
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.syntext.dev/v1/orgs/org_123/themes/brand',
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <session token>',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
echo $status, PHP_EOL, $response, PHP_EOL;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String payload = """
{
"appearance": {
"accent": "#0F766E",
"radius": "small"
}
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.syntext.dev/v1/orgs/org_123/themes/brand"))
.header("Authorization", "Bearer <session token>")
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Patch, "https://api.syntext.dev/v1/orgs/org_123/themes/brand");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <session token>");
request.Content = new StringContent(
"""
{
"appearance": {
"accent": "#0F766E",
"radius": "small"
}
}
""",
Encoding.UTF8,
"application/json");
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());