Skip to main content
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

sb-access-token
string
cookie
required

Session cookie (for API key management endpoints)

Path Parameters

keyId
string<uuid>
required

API key ID to revoke

Example:

"00000000-0000-4000-8000-000000000123"

Body

application/json
reason
string

Reason for revocation (optional)

Response

API key revoked

success
boolean
Example:

true

message
string
Example:

"API key revoked successfully"