Revoke with a reason
await fetch('/api/v1/keys/<uuid>', {
method: 'DELETE',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ reason: 'rotation: 2026-Q2 quarterly key refresh' }),
});curl --request DELETE \
--url https://socdefenders.ai/api/v1/keys/{keyId} \
--header 'Content-Type: application/json' \
--cookie sb-access-token= \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://socdefenders.ai/api/v1/keys/{keyId}"
payload = { "reason": "<string>" }
headers = {
"cookie": "sb-access-token=",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://socdefenders.ai/api/v1/keys/{keyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'reason' => '<string>'
]),
CURLOPT_COOKIE => "sb-access-token=",
CURLOPT_HTTPHEADER => [
"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://socdefenders.ai/api/v1/keys/{keyId}"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("cookie", "sb-access-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.delete("https://socdefenders.ai/api/v1/keys/{keyId}")
.header("cookie", "sb-access-token=")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://socdefenders.ai/api/v1/keys/{keyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["cookie"] = 'sb-access-token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "API key revoked successfully"
}{
"error": {
"code": "missing_api_key",
"message": "API key is required. Include it in the Authorization header as \"Bearer sk_live_...\"",
"request_id": "req_abc123"
}
}{
"error": {
"code": "not_found",
"message": "The requested resource was not found",
"request_id": "req_abc123"
}
}API Keys
Revoke an API key
Revokes an API key — requests made with it from this point on return 401 invalid_api_key. This action cannot be undone: revoked keys cannot be reactivated; create a new key instead.
The optional reason field is stored for audit purposes and shown in the dashboard. Use it to track why keys were revoked (compromise, rotation, employee departure, etc.).
DELETE
/
api
/
v1
/
keys
/
{keyId}
Revoke with a reason
await fetch('/api/v1/keys/<uuid>', {
method: 'DELETE',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ reason: 'rotation: 2026-Q2 quarterly key refresh' }),
});curl --request DELETE \
--url https://socdefenders.ai/api/v1/keys/{keyId} \
--header 'Content-Type: application/json' \
--cookie sb-access-token= \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://socdefenders.ai/api/v1/keys/{keyId}"
payload = { "reason": "<string>" }
headers = {
"cookie": "sb-access-token=",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://socdefenders.ai/api/v1/keys/{keyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'reason' => '<string>'
]),
CURLOPT_COOKIE => "sb-access-token=",
CURLOPT_HTTPHEADER => [
"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://socdefenders.ai/api/v1/keys/{keyId}"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("cookie", "sb-access-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.delete("https://socdefenders.ai/api/v1/keys/{keyId}")
.header("cookie", "sb-access-token=")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://socdefenders.ai/api/v1/keys/{keyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["cookie"] = 'sb-access-token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "API key revoked successfully"
}{
"error": {
"code": "missing_api_key",
"message": "API key is required. Include it in the Authorization header as \"Bearer sk_live_...\"",
"request_id": "req_abc123"
}
}{
"error": {
"code": "not_found",
"message": "The requested resource was not found",
"request_id": "req_abc123"
}
}Authorizations
Session cookie (for API key management endpoints)
Path Parameters
API key ID to revoke
Example:
"00000000-0000-4000-8000-000000000123"
Body
application/json
Reason for revocation (optional)
⌘I