Delete API Key
curl --request DELETE \
--url https://api.buena.ai/api/v2/keys/{keyId} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.buena.ai/api/v2/keys/{keyId}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.buena.ai/api/v2/keys/{keyId}', 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.buena.ai/api/v2/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_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.buena.ai/api/v2/keys/{keyId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.buena.ai/api/v2/keys/{keyId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buena.ai/api/v2/keys/{keyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "API key key_123abc has been successfully deleted"
}
Authentication
Delete API Key
Permanently delete an API key
DELETE
/
api
/
v2
/
keys
/
{keyId}
Delete API Key
curl --request DELETE \
--url https://api.buena.ai/api/v2/keys/{keyId} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.buena.ai/api/v2/keys/{keyId}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.buena.ai/api/v2/keys/{keyId}', 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.buena.ai/api/v2/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_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.buena.ai/api/v2/keys/{keyId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.buena.ai/api/v2/keys/{keyId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buena.ai/api/v2/keys/{keyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "API key key_123abc has been successfully deleted"
}
Permanently delete an API key. This action cannot be undone and will immediately revoke access for any applications using this key.
This action is irreversible. Make sure you’re not using this key in any
production applications before deleting it.
Request
The unique identifier of the API key to delete
Your API key with
keys:manage permissionExamples
Delete API Key
curl -X DELETE "https://api.buena.ai/api/v2/keys/key_123abc" \
-H "x-api-key: YOUR_API_KEY"
const response = await fetch("https://api.buena.ai/api/v2/keys/key_123abc", {
method: "DELETE",
headers: {
"x-api-key": "YOUR_API_KEY",
},
});
const data = await response.json();
console.log(data);
import requests
response = requests.delete(
'https://api.buena.ai/api/v2/keys/key_123abc',
headers={
'x-api-key': 'YOUR_API_KEY'
}
)
print(response.json())
Response
Always
true for successful requestsConfirmation message
{
"success": true,
"message": "API key key_123abc has been successfully deleted"
}
Next Steps
Create New Key
Create a replacement API key
List Keys
View remaining API keys
⌘I

