curl --request POST \
--url https://api.platform.soax.com/v1/api-keys/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "CI analytics reader",
"scopes": [
"proxy:analytics:read"
],
"package_ids": [
"b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e"
]
}
'import requests
url = "https://api.platform.soax.com/v1/api-keys/"
payload = {
"name": "CI analytics reader",
"scopes": ["proxy:analytics:read"],
"package_ids": ["b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'CI analytics reader',
scopes: ['proxy:analytics:read'],
package_ids: ['b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e']
})
};
fetch('https://api.platform.soax.com/v1/api-keys/', 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://api.platform.soax.com/v1/api-keys/",
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' => 'CI analytics reader',
'scopes' => [
'proxy:analytics:read'
],
'package_ids' => [
'b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e'
]
]),
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://api.platform.soax.com/v1/api-keys/"
payload := strings.NewReader("{\n \"name\": \"CI analytics reader\",\n \"scopes\": [\n \"proxy:analytics:read\"\n ],\n \"package_ids\": [\n \"b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.platform.soax.com/v1/api-keys/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"CI analytics reader\",\n \"scopes\": [\n \"proxy:analytics:read\"\n ],\n \"package_ids\": [\n \"b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platform.soax.com/v1/api-keys/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"CI analytics reader\",\n \"scopes\": [\n \"proxy:analytics:read\"\n ],\n \"package_ids\": [\n \"b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "7c2d9e0f-1a2b-4c3d-8e9f-a0b1c2d3e4f5",
"name": "CI analytics reader",
"scopes": [
"proxy:analytics:read"
],
"package_ids": [
"b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e"
],
"secret": "s_live_Qh1kT3examplenotarealsecretvalueXo9pW2zR8vY5uB0mN4cL7dS6fG1jK",
"created_at": "2026-08-11T12:00:00Z"
}{
"error": "Requested scopes exceed the calling key's own scopes"
}{
"detail": "Invalid API key"
}{
"detail": "Missing required scope: proxy:packages:read"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": "Rate limit exceeded: 5 per 1 second"
}Create an API key
Create a new API key. To prevent privilege escalation, the new key’s scopes must be a subset of the calling key’s scopes, and package_ids (if provided) must be a subset of the calling key’s package restriction. If package_ids is omitted, the new key inherits the calling key’s restriction.
The response includes the plaintext secret — this is the only time it is ever returned. Store it immediately in a secure location.
Requires the api-keys:write scope.
curl --request POST \
--url https://api.platform.soax.com/v1/api-keys/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "CI analytics reader",
"scopes": [
"proxy:analytics:read"
],
"package_ids": [
"b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e"
]
}
'import requests
url = "https://api.platform.soax.com/v1/api-keys/"
payload = {
"name": "CI analytics reader",
"scopes": ["proxy:analytics:read"],
"package_ids": ["b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'CI analytics reader',
scopes: ['proxy:analytics:read'],
package_ids: ['b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e']
})
};
fetch('https://api.platform.soax.com/v1/api-keys/', 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://api.platform.soax.com/v1/api-keys/",
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' => 'CI analytics reader',
'scopes' => [
'proxy:analytics:read'
],
'package_ids' => [
'b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e'
]
]),
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://api.platform.soax.com/v1/api-keys/"
payload := strings.NewReader("{\n \"name\": \"CI analytics reader\",\n \"scopes\": [\n \"proxy:analytics:read\"\n ],\n \"package_ids\": [\n \"b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.platform.soax.com/v1/api-keys/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"CI analytics reader\",\n \"scopes\": [\n \"proxy:analytics:read\"\n ],\n \"package_ids\": [\n \"b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platform.soax.com/v1/api-keys/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"CI analytics reader\",\n \"scopes\": [\n \"proxy:analytics:read\"\n ],\n \"package_ids\": [\n \"b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "7c2d9e0f-1a2b-4c3d-8e9f-a0b1c2d3e4f5",
"name": "CI analytics reader",
"scopes": [
"proxy:analytics:read"
],
"package_ids": [
"b2f0c3d4-e5a6-4b7c-8d9e-0f1a2b3c4d5e"
],
"secret": "s_live_Qh1kT3examplenotarealsecretvalueXo9pW2zR8vY5uB0mN4cL7dS6fG1jK",
"created_at": "2026-08-11T12:00:00Z"
}{
"error": "Requested scopes exceed the calling key's own scopes"
}{
"detail": "Invalid API key"
}{
"detail": "Missing required scope: proxy:packages:read"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": "Rate limit exceeded: 5 per 1 second"
}Authorizations
API key secret (starts with s_live_). Create keys in the dashboard under Settings → API keys, or via POST /v1/api-keys/. Send it as Authorization: Bearer <secret>.
Body
Request schema for POST /v1/api-keys endpoint.
Human-readable name for the key (shown in the dashboard and key listings).
Scopes to grant. Must be a subset of the calling key's own scopes.
Optional list of package IDs the key is restricted to. Must be a subset of the calling key's own restriction. Omit to inherit the calling key's restriction; null on an unrestricted caller creates an unrestricted key.
Response
Successful Response
Response schema for POST /v1/api-keys endpoint.
Includes the plaintext secret, which is only revealed at creation time and can never be retrieved again. The secret should be immediately stored by the client in a secure location.
Was this page helpful?