Custom Domains
Add custom domain
Admin only. Register a new domain. After creation, add two DNS records: a CNAME from the domain to the target shown in Settings -> Custom Domains (the host you use SpitShake on), and the TXT record in verification_record_name / verification_record_value. SpitShake checks the TXT record automatically (first after 30 seconds, then with backoff up to every 5 minutes, failing after 60 checks), or call the verify endpoint. Once DNS is verified, SpitShake provisions the TLS certificate (status ssl_pending, then active).
The domain is lowercased and must be unique across all accounts, removed domains included. SpitShake’s own hosts are reserved.
POST
/
api
/
custom_domains
Add custom domain
curl --request POST \
--url https://spitshake.io/api/custom_domains \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"domain": "sign.yourcompany.com"
}
'import requests
url = "https://spitshake.io/api/custom_domains"
payload = { "domain": "sign.yourcompany.com" }
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({domain: 'sign.yourcompany.com'})
};
fetch('https://spitshake.io/api/custom_domains', 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",
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([
'domain' => 'sign.yourcompany.com'
]),
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"
payload := strings.NewReader("{\n \"domain\": \"sign.yourcompany.com\"\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/custom_domains")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"sign.yourcompany.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://spitshake.io/api/custom_domains")
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 \"domain\": \"sign.yourcompany.com\"\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": [
"Domain has already been taken"
]
}⌘I
Add custom domain
curl --request POST \
--url https://spitshake.io/api/custom_domains \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"domain": "sign.yourcompany.com"
}
'import requests
url = "https://spitshake.io/api/custom_domains"
payload = { "domain": "sign.yourcompany.com" }
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({domain: 'sign.yourcompany.com'})
};
fetch('https://spitshake.io/api/custom_domains', 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",
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([
'domain' => 'sign.yourcompany.com'
]),
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"
payload := strings.NewReader("{\n \"domain\": \"sign.yourcompany.com\"\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/custom_domains")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"sign.yourcompany.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://spitshake.io/api/custom_domains")
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 \"domain\": \"sign.yourcompany.com\"\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": [
"Domain has already been taken"
]
}
