Create brand
Admin only. Creates a named brand. A template or submission uses it by setting preferences.brand_id to the returned id. Branding keys sent as null or "" are dropped.
curl --request POST \
--url https://spitshake.io/api/brands \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"name": "Acme Legal",
"branding": {
"display_title": "Acme Legal",
"logo_url": "https://cdn.example.com/acme/logo.png",
"primary_button_color": "#2f5d8a",
"header_color": "#14213d",
"show_branding": false
}
}
'import requests
url = "https://spitshake.io/api/brands"
payload = {
"name": "Acme Legal",
"branding": {
"display_title": "Acme Legal",
"logo_url": "https://cdn.example.com/acme/logo.png",
"primary_button_color": "#2f5d8a",
"header_color": "#14213d",
"show_branding": False
}
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Legal',
branding: {
display_title: 'Acme Legal',
logo_url: 'https://cdn.example.com/acme/logo.png',
primary_button_color: '#2f5d8a',
header_color: '#14213d',
show_branding: false
}
})
};
fetch('https://spitshake.io/api/brands', 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/brands",
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([
'name' => 'Acme Legal',
'branding' => [
'display_title' => 'Acme Legal',
'logo_url' => 'https://cdn.example.com/acme/logo.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/brands"
payload := strings.NewReader("{\n \"name\": \"Acme Legal\",\n \"branding\": {\n \"display_title\": \"Acme Legal\",\n \"logo_url\": \"https://cdn.example.com/acme/logo.png\",\n \"primary_button_color\": \"#2f5d8a\",\n \"header_color\": \"#14213d\",\n \"show_branding\": false\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://spitshake.io/api/brands")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Legal\",\n \"branding\": {\n \"display_title\": \"Acme Legal\",\n \"logo_url\": \"https://cdn.example.com/acme/logo.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/brands")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Legal\",\n \"branding\": {\n \"display_title\": \"Acme Legal\",\n \"logo_url\": \"https://cdn.example.com/acme/logo.png\",\n \"primary_button_color\": \"#2f5d8a\",\n \"header_color\": \"#14213d\",\n \"show_branding\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"brand": {
"id": 7,
"name": "Acme Legal",
"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
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}Authorizations
API token generated at Settings > API
Body
120A set of signing-page and email branding keys, stored on a custom domain (CustomDomain.branding) or a named brand (Brand.branding). Only these keys are accepted; an unknown key, a wrong type, a non-http(s) URL or a header_color that is not a dark #rrggbb is rejected with 422. Resolved when the page or email is rendered, so an edit applies to signers who have not finished yet.
Show child attributes
Show child attributes
Response
Brand created
A named set of branding for accounts that sign on behalf of more than one brand. A template or submission uses it by setting preferences.brand_id to its id.
Show child attributes
Show child attributes
curl --request POST \
--url https://spitshake.io/api/brands \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"name": "Acme Legal",
"branding": {
"display_title": "Acme Legal",
"logo_url": "https://cdn.example.com/acme/logo.png",
"primary_button_color": "#2f5d8a",
"header_color": "#14213d",
"show_branding": false
}
}
'import requests
url = "https://spitshake.io/api/brands"
payload = {
"name": "Acme Legal",
"branding": {
"display_title": "Acme Legal",
"logo_url": "https://cdn.example.com/acme/logo.png",
"primary_button_color": "#2f5d8a",
"header_color": "#14213d",
"show_branding": False
}
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Legal',
branding: {
display_title: 'Acme Legal',
logo_url: 'https://cdn.example.com/acme/logo.png',
primary_button_color: '#2f5d8a',
header_color: '#14213d',
show_branding: false
}
})
};
fetch('https://spitshake.io/api/brands', 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/brands",
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([
'name' => 'Acme Legal',
'branding' => [
'display_title' => 'Acme Legal',
'logo_url' => 'https://cdn.example.com/acme/logo.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/brands"
payload := strings.NewReader("{\n \"name\": \"Acme Legal\",\n \"branding\": {\n \"display_title\": \"Acme Legal\",\n \"logo_url\": \"https://cdn.example.com/acme/logo.png\",\n \"primary_button_color\": \"#2f5d8a\",\n \"header_color\": \"#14213d\",\n \"show_branding\": false\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://spitshake.io/api/brands")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Legal\",\n \"branding\": {\n \"display_title\": \"Acme Legal\",\n \"logo_url\": \"https://cdn.example.com/acme/logo.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/brands")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Legal\",\n \"branding\": {\n \"display_title\": \"Acme Legal\",\n \"logo_url\": \"https://cdn.example.com/acme/logo.png\",\n \"primary_button_color\": \"#2f5d8a\",\n \"header_color\": \"#14213d\",\n \"show_branding\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"brand": {
"id": 7,
"name": "Acme Legal",
"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
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}
