List API Keys
curl --request GET \
--url https://api.example.com/api/api-keys \
--header 'Authorization: <authorization>' \
--header 'X-Organization-Id: <x-organization-id>'import requests
url = "https://api.example.com/api/api-keys"
headers = {
"Authorization": "<authorization>",
"X-Organization-Id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<authorization>', 'X-Organization-Id': '<x-organization-id>'}
};
fetch('https://api.example.com/api/api-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://api.example.com/api/api-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: <authorization>",
"X-Organization-Id: <x-organization-id>"
],
]);
$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/api/api-keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("X-Organization-Id", "<x-organization-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/api-keys")
.header("Authorization", "<authorization>")
.header("X-Organization-Id", "<x-organization-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["X-Organization-Id"] = '<x-organization-id>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"key_id": "apikey_a1b2c3d4e5f6",
"name": "Production API Key",
"role": "agent_manager",
"prefix": "bk_live_xxxx",
"client_id": "org_abc123",
"user_id": "user_def456",
"status": "active",
"created_at": "2024-01-15T10:30:00Z",
"last_used_at": "2024-01-15T14:45:00Z",
"expires_at": "2025-12-31T23:59:59Z"
}
]
}
API Keys
List API Keys
GET
/
api
/
api-keys
List API Keys
curl --request GET \
--url https://api.example.com/api/api-keys \
--header 'Authorization: <authorization>' \
--header 'X-Organization-Id: <x-organization-id>'import requests
url = "https://api.example.com/api/api-keys"
headers = {
"Authorization": "<authorization>",
"X-Organization-Id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<authorization>', 'X-Organization-Id': '<x-organization-id>'}
};
fetch('https://api.example.com/api/api-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://api.example.com/api/api-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: <authorization>",
"X-Organization-Id: <x-organization-id>"
],
]);
$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/api/api-keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("X-Organization-Id", "<x-organization-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/api-keys")
.header("Authorization", "<authorization>")
.header("X-Organization-Id", "<x-organization-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["X-Organization-Id"] = '<x-organization-id>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"key_id": "apikey_a1b2c3d4e5f6",
"name": "Production API Key",
"role": "agent_manager",
"prefix": "bk_live_xxxx",
"client_id": "org_abc123",
"user_id": "user_def456",
"status": "active",
"created_at": "2024-01-15T10:30:00Z",
"last_used_at": "2024-01-15T14:45:00Z",
"expires_at": "2025-12-31T23:59:59Z"
}
]
}
Retrieve a list of all API keys for your organization.
Headers
string
required
Bearer token from Cognito authentication (JWT).
string
required
The organization ID.
Response
boolean
Indicates if the request was successful.
array
List of API key objects.
Show API Key Object
Show API Key Object
string
Unique key identifier.
string
The name of the API key.
string
The role assigned to this key.
string
The first 12 characters of the key (for identification).
string
The organization ID this key belongs to.
string
The user ID who created this key.
string
Current status (
active or revoked).string
ISO 8601 timestamp of creation.
string
ISO 8601 timestamp of last usage.
string
ISO 8601 timestamp of expiration.
{
"success": true,
"data": [
{
"key_id": "apikey_a1b2c3d4e5f6",
"name": "Production API Key",
"role": "agent_manager",
"prefix": "bk_live_xxxx",
"client_id": "org_abc123",
"user_id": "user_def456",
"status": "active",
"created_at": "2024-01-15T10:30:00Z",
"last_used_at": "2024-01-15T14:45:00Z",
"expires_at": "2025-12-31T23:59:59Z"
}
]
}
⌘I