Revoke API Key
curl --request DELETE \
--url https://api.example.com/v1/api-keys/{id}import requests
url = "https://api.example.com/v1/api-keys/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/v1/api-keys/{id}', 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.example.com/v1/api-keys/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/api-keys/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/v1/api-keys/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/api-keys/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_bodyAPI Keys
Revoke API Key
Revoke an API key. The key is soft-deleted and cannot authenticate further requests.
DELETE
/
v1
/
api-keys
/
{id}
Revoke API Key
curl --request DELETE \
--url https://api.example.com/v1/api-keys/{id}import requests
url = "https://api.example.com/v1/api-keys/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/v1/api-keys/{id}', 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.example.com/v1/api-keys/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/api-keys/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/v1/api-keys/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/api-keys/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_bodyRequest
Revocation is a soft delete: the key row is preserved in theapi_keys table with revoked_at populated, so audit trails and last-used timestamps remain queryable. All requests using the key after revocation fail with 401 invalid_key. There is no “unrevoke” - create a new key if needed.
Path Parameters
string
required
API key UUID.
Headers
Authorization: Bearer wbk_your_api_key_here
string
Optional UUID. Repeated revokes with the same key return the same result without erroring.
Response
On success returns HTTP204 No Content. The response still carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID for observability.
curl -X DELETE \
https://data.leadlex.com/functions/v1/api-gateway/v1/api-keys/key_01HY1 \
-H "Authorization: Bearer wbk_your_api_key_here" \
-i
import requests
API_KEY = "wbk_your_api_key_here"
key_id = "key_01HY1"
r = requests.delete(
f"https://data.leadlex.com/functions/v1/api-gateway/v1/api-keys/{key_id}",
headers={"Authorization": f"Bearer {API_KEY}"},
)
assert r.status_code == 204, r.text
const id = 'key_01HY1';
const res = await fetch(
`https://data.leadlex.com/functions/v1/api-gateway/v1/api-keys/${id}`,
{
method: 'DELETE',
headers: { Authorization: 'Bearer wbk_your_api_key_here' },
}
);
if (res.status !== 204) throw new Error(`Failed: ${res.status}`);
Example Response
HTTP/1.1 204 No Content
X-Request-ID: req_01HY1K0E7V8Q0YXH7DSTX5B3CA
Errors
| Status | Code | Description |
|---|---|---|
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing admin:api_keys permission, or the calling key is the last active admin key |
| 404 | not_found | API key not found |
| 429 | rate_limited | Rate limit exceeded |