Delete access token
curl -X DELETE http://localhost:6573/auth/api_key/12 \
-H "Accept: application/json" \
-H 'Authorization: Bearer <admin-jwt-or-access-token>'import requests
url = "http://localhost:6573/auth/api_key/{token_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:6573/auth/api_key/{token_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_PORT => "6573",
CURLOPT_URL => "http://localhost:6573/auth/api_key/{token_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "http://localhost:6573/auth/api_key/{token_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("http://localhost:6573/auth/api_key/{token_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:6573/auth/api_key/{token_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Access token deleted successfully"
}{
"status": "error",
"message": "Invalid or missing authorization token"
}{
"status": "error",
"message": "API key management API requires auth_enabled=true"
}{
"status": "error",
"message": "Access token not found"
}Access Tokens
Delete access token
Deletes an access token by its ID. The token is immediately invalidated and can no longer be used for authentication.
Requires auth_enabled=true and an admin access token or admin JWT.
DELETE
/
auth
/
api_key
/
{token_id}
Delete access token
curl -X DELETE http://localhost:6573/auth/api_key/12 \
-H "Accept: application/json" \
-H 'Authorization: Bearer <admin-jwt-or-access-token>'import requests
url = "http://localhost:6573/auth/api_key/{token_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:6573/auth/api_key/{token_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_PORT => "6573",
CURLOPT_URL => "http://localhost:6573/auth/api_key/{token_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "http://localhost:6573/auth/api_key/{token_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("http://localhost:6573/auth/api_key/{token_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:6573/auth/api_key/{token_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Access token deleted successfully"
}{
"status": "error",
"message": "Invalid or missing authorization token"
}{
"status": "error",
"message": "API key management API requires auth_enabled=true"
}{
"status": "error",
"message": "Access token not found"
}Authorizations
Admin JWT obtained from the login endpoint.
Headers
Admin JWT or admin access token. Format Bearer <admin-jwt-or-access-token>.
Path Parameters
The unique identifier of the access token to delete.
⌘I