Set a custom domain's branding
Replaces the domain’s branding. Every submission sent on this domain (its own preferences.custom_domain, its template’s, or the account’s primary domain) shows it for any key the submission and template leave unset. A key sent as null or "" is removed. Unknown keys are rejected with 422. A brand selected by the submission or its template (preferences.brand_id) outranks the domain’s branding.
Also sets website_url, where the bare domain redirects visitors. branding and website_url are each changed only when sent.
curl --request PUT \
--url https://spitshake.io/api/custom_domains/{id} \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"branding": {
"display_title": "Acme Legal",
"logo_url": "https://cdn.example.com/acme/logo.png",
"favicon_url": "https://cdn.example.com/acme/favicon.png",
"primary_button_color": "#2f5d8a",
"header_color": "#14213d",
"show_branding": false
}
}
'import requests
url = "https://spitshake.io/api/custom_domains/{id}"
payload = { "branding": {
"display_title": "Acme Legal",
"logo_url": "https://cdn.example.com/acme/logo.png",
"favicon_url": "https://cdn.example.com/acme/favicon.png",
"primary_button_color": "#2f5d8a",
"header_color": "#14213d",
"show_branding": False
} }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branding: {
display_title: 'Acme Legal',
logo_url: 'https://cdn.example.com/acme/logo.png',
favicon_url: 'https://cdn.example.com/acme/favicon.png',
primary_button_color: '#2f5d8a',
header_color: '#14213d',
show_branding: false
}
})
};
fetch('https://spitshake.io/api/custom_domains/{id}', 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://spitshake.io/api/custom_domains/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'branding' => [
'display_title' => 'Acme Legal',
'logo_url' => 'https://cdn.example.com/acme/logo.png',
'favicon_url' => 'https://cdn.example.com/acme/favicon.png',
'primary_button_color' => '#2f5d8a',
'header_color' => '#14213d',
'show_branding' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>"
],
]);
$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://spitshake.io/api/custom_domains/{id}"
payload := strings.NewReader("{\n \"branding\": {\n \"display_title\": \"Acme Legal\",\n \"logo_url\": \"https://cdn.example.com/acme/logo.png\",\n \"favicon_url\": \"https://cdn.example.com/acme/favicon.png\",\n \"primary_button_color\": \"#2f5d8a\",\n \"header_color\": \"#14213d\",\n \"show_branding\": false\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
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.put("https://spitshake.io/api/custom_domains/{id}")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"branding\": {\n \"display_title\": \"Acme Legal\",\n \"logo_url\": \"https://cdn.example.com/acme/logo.png\",\n \"favicon_url\": \"https://cdn.example.com/acme/favicon.png\",\n \"primary_button_color\": \"#2f5d8a\",\n \"header_color\": \"#14213d\",\n \"show_branding\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://spitshake.io/api/custom_domains/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Auth-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"branding\": {\n \"display_title\": \"Acme Legal\",\n \"logo_url\": \"https://cdn.example.com/acme/logo.png\",\n \"favicon_url\": \"https://cdn.example.com/acme/favicon.png\",\n \"primary_button_color\": \"#2f5d8a\",\n \"header_color\": \"#14213d\",\n \"show_branding\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"domain": {
"id": 123,
"domain": "sign.example.com",
"branding": {
"display_title": "Acme Legal",
"logo_url": "https://cdn.example.com/acme/logo.png",
"favicon_url": "https://cdn.example.com/acme/favicon.png",
"company_name": "Acme Legal LLP",
"primary_button_color": "#2f5d8a",
"header_color": "#14213d",
"show_branding": true
},
"website_url": "https://example.com",
"status": "pending",
"primary": true,
"verification_record_name": "<string>",
"verification_record_value": "<string>",
"ssl_status": "<string>",
"dns_verified_at": "2023-11-07T05:31:56Z",
"ssl_provisioned_at": "2023-11-07T05:31:56Z",
"last_checked_at": "2023-11-07T05:31:56Z",
"last_error": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}Authorizations
API token generated at Settings > API
Path Parameters
Body
Signing-page and email branding for every submission sent on this domain. Resolution, key by key, is submission > submission's brand > template > template's brand > domain > account: a template, submission or brand that sets a key still wins, and a key left out here falls back to the account.
Show child attributes
Show child attributes
http(s) URL the bare domain redirects to; null or "" clears it.
Response
Updated domain
Show child attributes
Show child attributes
curl --request PUT \
--url https://spitshake.io/api/custom_domains/{id} \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"branding": {
"display_title": "Acme Legal",
"logo_url": "https://cdn.example.com/acme/logo.png",
"favicon_url": "https://cdn.example.com/acme/favicon.png",
"primary_button_color": "#2f5d8a",
"header_color": "#14213d",
"show_branding": false
}
}
'import requests
url = "https://spitshake.io/api/custom_domains/{id}"
payload = { "branding": {
"display_title": "Acme Legal",
"logo_url": "https://cdn.example.com/acme/logo.png",
"favicon_url": "https://cdn.example.com/acme/favicon.png",
"primary_button_color": "#2f5d8a",
"header_color": "#14213d",
"show_branding": False
} }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branding: {
display_title: 'Acme Legal',
logo_url: 'https://cdn.example.com/acme/logo.png',
favicon_url: 'https://cdn.example.com/acme/favicon.png',
primary_button_color: '#2f5d8a',
header_color: '#14213d',
show_branding: false
}
})
};
fetch('https://spitshake.io/api/custom_domains/{id}', 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://spitshake.io/api/custom_domains/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'branding' => [
'display_title' => 'Acme Legal',
'logo_url' => 'https://cdn.example.com/acme/logo.png',
'favicon_url' => 'https://cdn.example.com/acme/favicon.png',
'primary_button_color' => '#2f5d8a',
'header_color' => '#14213d',
'show_branding' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>"
],
]);
$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://spitshake.io/api/custom_domains/{id}"
payload := strings.NewReader("{\n \"branding\": {\n \"display_title\": \"Acme Legal\",\n \"logo_url\": \"https://cdn.example.com/acme/logo.png\",\n \"favicon_url\": \"https://cdn.example.com/acme/favicon.png\",\n \"primary_button_color\": \"#2f5d8a\",\n \"header_color\": \"#14213d\",\n \"show_branding\": false\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
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.put("https://spitshake.io/api/custom_domains/{id}")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"branding\": {\n \"display_title\": \"Acme Legal\",\n \"logo_url\": \"https://cdn.example.com/acme/logo.png\",\n \"favicon_url\": \"https://cdn.example.com/acme/favicon.png\",\n \"primary_button_color\": \"#2f5d8a\",\n \"header_color\": \"#14213d\",\n \"show_branding\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://spitshake.io/api/custom_domains/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Auth-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"branding\": {\n \"display_title\": \"Acme Legal\",\n \"logo_url\": \"https://cdn.example.com/acme/logo.png\",\n \"favicon_url\": \"https://cdn.example.com/acme/favicon.png\",\n \"primary_button_color\": \"#2f5d8a\",\n \"header_color\": \"#14213d\",\n \"show_branding\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"domain": {
"id": 123,
"domain": "sign.example.com",
"branding": {
"display_title": "Acme Legal",
"logo_url": "https://cdn.example.com/acme/logo.png",
"favicon_url": "https://cdn.example.com/acme/favicon.png",
"company_name": "Acme Legal LLP",
"primary_button_color": "#2f5d8a",
"header_color": "#14213d",
"show_branding": true
},
"website_url": "https://example.com",
"status": "pending",
"primary": true,
"verification_record_name": "<string>",
"verification_record_value": "<string>",
"ssl_status": "<string>",
"dns_verified_at": "2023-11-07T05:31:56Z",
"ssl_provisioned_at": "2023-11-07T05:31:56Z",
"last_checked_at": "2023-11-07T05:31:56Z",
"last_error": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}
