Access Tokens
Create API token
Generate a new API token. The raw token value is only returned once. Requires Pro plan.
POST
/
api
/
access_tokens
Create API token
curl --request POST \
--url https://spitshake.io/api/access_tokens \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"name": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"scopes": [],
"allowed_ips": [
"<string>"
]
}
'import requests
url = "https://spitshake.io/api/access_tokens"
payload = {
"name": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"scopes": [],
"allowed_ips": ["<string>"]
}
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: '<string>',
expires_at: '2023-11-07T05:31:56Z',
scopes: [],
allowed_ips: ['<string>']
})
};
fetch('https://spitshake.io/api/access_tokens', 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/access_tokens",
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' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z',
'scopes' => [
],
'allowed_ips' => [
'<string>'
]
]),
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/access_tokens"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"scopes\": [],\n \"allowed_ips\": [\n \"<string>\"\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/access_tokens")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"scopes\": [],\n \"allowed_ips\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://spitshake.io/api/access_tokens")
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\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"scopes\": [],\n \"allowed_ips\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"token": {
"id": 123,
"name": "<string>",
"user_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"scopes": [
"templates:read"
],
"allowed_ips": [
"<string>"
],
"expired": true,
"token_prefix": "<string>"
},
"raw_token": "<string>"
}Authorizations
ApiTokenSessionCookie
API token generated at Settings > API
Body
application/json
Descriptive name for the token
Expiration date (null for no expiry)
Permission scopes (empty = full access)
Available options:
templates:read, templates:write, submissions:read, submissions:write, submissions:draft, submissions:send, submissions:remind, submitters:read, submitters:write, audit_events:read, users:read, users:write, account:read, account:write, webhooks:read, webhooks:write IP allowlist (empty = all IPs)
⌘I
Create API token
curl --request POST \
--url https://spitshake.io/api/access_tokens \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"name": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"scopes": [],
"allowed_ips": [
"<string>"
]
}
'import requests
url = "https://spitshake.io/api/access_tokens"
payload = {
"name": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"scopes": [],
"allowed_ips": ["<string>"]
}
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: '<string>',
expires_at: '2023-11-07T05:31:56Z',
scopes: [],
allowed_ips: ['<string>']
})
};
fetch('https://spitshake.io/api/access_tokens', 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/access_tokens",
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' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z',
'scopes' => [
],
'allowed_ips' => [
'<string>'
]
]),
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/access_tokens"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"scopes\": [],\n \"allowed_ips\": [\n \"<string>\"\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/access_tokens")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"scopes\": [],\n \"allowed_ips\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://spitshake.io/api/access_tokens")
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\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"scopes\": [],\n \"allowed_ips\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"token": {
"id": 123,
"name": "<string>",
"user_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"scopes": [
"templates:read"
],
"allowed_ips": [
"<string>"
],
"expired": true,
"token_prefix": "<string>"
},
"raw_token": "<string>"
}
