List API Keys
curl --request GET \
--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.get(url, headers=headers)
print(response.text)const options = {method: 'GET', 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 => "GET",
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("GET", 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.get("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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "a1b2c3d4-0000-4000-8000-000000000000",
"name": "Production",
"key_prefix": "enc_0be0a9a0",
"is_active": true,
"disabled_by_admin": false,
"created_at": "2024-01-15T10:00:00Z",
"last_used_at": "2024-03-01T14:30:00Z",
"credits_used": 980,
"credit_limit": null,
"creator_email": "jane@example.com",
"revealable": true
}
]
{
"success": false,
"result": { "code": "unauthorized" },
"message": "Unauthorized",
"request_id": "req_7f3a9c21",
"error": "Unauthorized"
}
API Keys
List API Keys
List the API keys you can see, newest first.
GET
/
api
/
account
/
keys
List API Keys
curl --request GET \
--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.get(url, headers=headers)
print(response.text)const options = {method: 'GET', 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 => "GET",
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("GET", 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.get("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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "a1b2c3d4-0000-4000-8000-000000000000",
"name": "Production",
"key_prefix": "enc_0be0a9a0",
"is_active": true,
"disabled_by_admin": false,
"created_at": "2024-01-15T10:00:00Z",
"last_used_at": "2024-03-01T14:30:00Z",
"credits_used": 980,
"credit_limit": null,
"creator_email": "jane@example.com",
"revealable": true
}
]
{
"success": false,
"result": { "code": "unauthorized" },
"message": "Unauthorized",
"request_id": "req_7f3a9c21",
"error": "Unauthorized"
}
Authentication
Requires an API key in theAuthorization header.
Authorization: Bearer YOUR_API_KEY
Scope depends on your workspace. When a workspace is active, this returns
every key in the workspace, including other members’ keys and their metadata.
Outside a workspace it returns only your own keys.
Request
No request body required.Example request
curl https://developer.encrata.com/api/account/keys \
-H "Authorization: Bearer YOUR_API_KEY"
Response
Returns a JSON array of API key objects (not wrapped in an object), ordered newest first and capped at 500 entries.string
The key’s database id. Use this - never
key_prefix - when renaming, toggling, limiting, or revoking a key.string
Display name for the key.
string
The key’s non-secret prefix (the leading characters, e.g.
enc_0be0a9a0).boolean
Whether the key is currently active.
boolean
Whether the key was disabled by an administrator.
string
ISO 8601 creation timestamp.
string | null
ISO 8601 timestamp of last use, or
null if never used.integer
Total credits consumed by this key.
integer | null
Per-key credit cap, or
null if unlimited.string
Email of the workspace member who created the key. The literal
removed user when that member no longer exists.boolean
Whether the full key can still be read back via
GET /api/account/keys/reveal?id={id}.Errors
Errors return the shared envelope withsuccess, result.code, message, and
request_id. A legacy error key is included alongside it.
| Status | Cause |
|---|---|
401 | Missing or invalid API key |
429 | Rate limit exceeded. See Rate limits |
[
{
"id": "a1b2c3d4-0000-4000-8000-000000000000",
"name": "Production",
"key_prefix": "enc_0be0a9a0",
"is_active": true,
"disabled_by_admin": false,
"created_at": "2024-01-15T10:00:00Z",
"last_used_at": "2024-03-01T14:30:00Z",
"credits_used": 980,
"credit_limit": null,
"creator_email": "jane@example.com",
"revealable": true
}
]
{
"success": false,
"result": { "code": "unauthorized" },
"message": "Unauthorized",
"request_id": "req_7f3a9c21",
"error": "Unauthorized"
}
Was this page helpful?