Account
PUT /v1/key/allowed-ips — Restrict a Key to Your Servers
Bind an API key to specific IP addresses or CIDR ranges so a leaked key is useless from anywhere else.
PUT
/
key
/
allowed-ips
Restrict this key to your own addresses
curl --request PUT \
--url https://csboard.com/v1/key/allowed-ips \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ips": [
"<string>"
]
}
'import requests
url = "https://csboard.com/v1/key/allowed-ips"
payload = { "ips": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ips: ['<string>']})
};
fetch('https://csboard.com/v1/key/allowed-ips', 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://csboard.com/v1/key/allowed-ips",
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([
'ips' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://csboard.com/v1/key/allowed-ips"
payload := strings.NewReader("{\n \"ips\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://csboard.com/v1/key/allowed-ips")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ips\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://csboard.com/v1/key/allowed-ips")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ips\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"allowed_ips": [
"<string>"
],
"your_ip": "<string>"
}
}Binds the key to the addresses your servers actually call from. Requests from anywhere else are refused with
The same setting is available in the account panel at csboard.com/profile?tab=api. Neither is the only way in.
Authentication required. Send your key as
403 ip_not_allowed. An empty array clears the restriction.
This is the cheapest protection against the most common way keys leak: a log line, a screenshot, a committed .env.
A list that does not include the address you are calling from is refused, not applied — setting an allowlist you are not inside is indistinguishable from revoking your own key. The error echoes the address we saw. To hand a key to servers you are not on, include your own address, apply, then remove it once they are connecting.
Authorization: Bearer csb_pub_....Authorizations
Send your key as a Bearer token on every request: Authorization: Bearer csb_pub_.... Generate keys in your CSBoard profile.
Body
application/json
Addresses or CIDR ranges. Empty clears the restriction. Max 20.
Response
Applied.
Show child attributes
Show child attributes
⌘I
Restrict this key to your own addresses
curl --request PUT \
--url https://csboard.com/v1/key/allowed-ips \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ips": [
"<string>"
]
}
'import requests
url = "https://csboard.com/v1/key/allowed-ips"
payload = { "ips": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ips: ['<string>']})
};
fetch('https://csboard.com/v1/key/allowed-ips', 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://csboard.com/v1/key/allowed-ips",
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([
'ips' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://csboard.com/v1/key/allowed-ips"
payload := strings.NewReader("{\n \"ips\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://csboard.com/v1/key/allowed-ips")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ips\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://csboard.com/v1/key/allowed-ips")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ips\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"allowed_ips": [
"<string>"
],
"your_ip": "<string>"
}
}