Create an API key
curl --request POST \
--url https://{dsn}/api/v1/api-keys \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "Production"
}
'import requests
url = "https://{dsn}/api/v1/api-keys"
payload = { "name": "Production" }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Production'})
};
fetch('https://{dsn}/api/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://{dsn}/api/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' => 'Production'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <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://{dsn}/api/v1/api-keys"
payload := strings.NewReader("{\n \"name\": \"Production\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<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://{dsn}/api/v1/api-keys")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{dsn}/api/v1/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production\"\n}"
response = http.request(request)
puts response.read_body{
"object": "ApiKey",
"id": "pk_0f1e2d3c4b5a69788796a5b4c3d2e1f0",
"name": "Production",
"prefix": "ee_Zq3Rk",
"role": "service",
"issued_at": "2026-10-07T08:00:00Z",
"last_used_at": null,
"key": "ee_Zq3Rk8Tn2Vb6Xy1Lm4Pw7Hs9Jd5Fg0aB"
}{
"status": 400,
"type": "errors/invalid_parameters",
"title": "Invalid parameters",
"detail": "limit must be between 1 and 250"
}{
"status": 401,
"type": "errors/unauthorized",
"title": "Unauthorized",
"detail": "missing or invalid API key"
}API keys
Create an API key
Creates an access token. The key is in this response only; store it safely.
POST
/
api-keys
Create an API key
curl --request POST \
--url https://{dsn}/api/v1/api-keys \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "Production"
}
'import requests
url = "https://{dsn}/api/v1/api-keys"
payload = { "name": "Production" }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Production'})
};
fetch('https://{dsn}/api/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://{dsn}/api/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' => 'Production'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <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://{dsn}/api/v1/api-keys"
payload := strings.NewReader("{\n \"name\": \"Production\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<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://{dsn}/api/v1/api-keys")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{dsn}/api/v1/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production\"\n}"
response = http.request(request)
puts response.read_body{
"object": "ApiKey",
"id": "pk_0f1e2d3c4b5a69788796a5b4c3d2e1f0",
"name": "Production",
"prefix": "ee_Zq3Rk",
"role": "service",
"issued_at": "2026-10-07T08:00:00Z",
"last_used_at": null,
"key": "ee_Zq3Rk8Tn2Vb6Xy1Lm4Pw7Hs9Jd5Fg0aB"
}{
"status": 400,
"type": "errors/invalid_parameters",
"title": "Invalid parameters",
"detail": "limit must be between 1 and 250"
}{
"status": 401,
"type": "errors/unauthorized",
"title": "Unauthorized",
"detail": "missing or invalid API key"
}Authorizations
Your access token, from your dashboard under API keys.
Body
application/json
Your name for the key.
Maximum string length:
100Example:
"Production"