Revoke or Delete API Key
curl --request DELETE \
--url https://developer.encrata.com/api/account/keys \
--header 'Authorization: Bearer <token>'import requests
url = "https://developer.encrata.com/api/account/keys"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://developer.encrata.com/api/account/keys', 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://developer.encrata.com/api/account/keys",
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 := "https://developer.encrata.com/api/account/keys"
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("https://developer.encrata.com/api/account/keys")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.encrata.com/api/account/keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "API key revoked"
}
{
"message": "API key deleted"
}
{
"success": false,
"result": { "code": "missing_id" },
"message": "Key ID is required",
"request_id": "req_7f3a9c21",
"error": "Key ID is required"
}
{
"success": false,
"result": { "code": "not_found" },
"message": "API key not found",
"request_id": "req_7f3a9c21",
"error": "API key not found"
}
API Keys
Revoke or Delete API Key
Revoke an API key (soft disable) or permanently delete it.
DELETE
/
api
/
account
/
keys
Revoke or Delete API Key
curl --request DELETE \
--url https://developer.encrata.com/api/account/keys \
--header 'Authorization: Bearer <token>'import requests
url = "https://developer.encrata.com/api/account/keys"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://developer.encrata.com/api/account/keys', 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://developer.encrata.com/api/account/keys",
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 := "https://developer.encrata.com/api/account/keys"
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("https://developer.encrata.com/api/account/keys")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.encrata.com/api/account/keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "API key revoked"
}
{
"message": "API key deleted"
}
{
"success": false,
"result": { "code": "missing_id" },
"message": "Key ID is required",
"request_id": "req_7f3a9c21",
"error": "Key ID is required"
}
{
"success": false,
"result": { "code": "not_found" },
"message": "API key not found",
"request_id": "req_7f3a9c21",
"error": "API key not found"
}
Authentication
Requires an API key in theAuthorization header.
Authorization: Bearer YOUR_API_KEY
Request
string
required
The key’s database id, as returned by
List API keys. Not the
key_prefix.string
Set to the exact string
true to permanently delete the key instead of
revoking it. Any other value revokes.Revoke (soft disable)
curl -X DELETE "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000" \
-H "Authorization: Bearer YOUR_API_KEY"
Delete (permanent removal)
curl -X DELETE "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000&permanent=true" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"message": "API key revoked"
}
{
"message": "API key deleted"
}
Revocation is immediate - any request using the key returns
401. Permanent
deletion removes the key record entirely and cannot be undone.Permissions
readonly members get 403. A tech member can only revoke their own keys;
only a workspace admin can revoke another member’s key. A key that is out of
your scope returns 404, the same as an unknown id.
Errors
Errors return the shared envelope withsuccess, result.code, message, and
request_id. A legacy error key is included alongside it.
{
"message": "API key revoked"
}
{
"message": "API key deleted"
}
{
"success": false,
"result": { "code": "missing_id" },
"message": "Key ID is required",
"request_id": "req_7f3a9c21",
"error": "Key ID is required"
}
{
"success": false,
"result": { "code": "not_found" },
"message": "API key not found",
"request_id": "req_7f3a9c21",
"error": "API key not found"
}
Was this page helpful?