curl --request GET \
--url https://api.athenahq.ai/api/v1/api-keys \
--header 'x-api-key: <api-key>'import requests
url = "https://api.athenahq.ai/api/v1/api-keys"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.athenahq.ai/api/v1/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.athenahq.ai/api/v1/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 => [
"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.athenahq.ai/api/v1/api-keys"
req, _ := http.NewRequest("GET", 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.get("https://api.athenahq.ai/api/v1/api-keys")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.athenahq.ai/api/v1/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"api_keys": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"key_prefix": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>"
},
"is_global": true,
"website_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"is_revoked": true
}
],
"pagination": {
"page_num": 123,
"page_size": 123,
"has_more": true
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Listar claves de API
Lista metadatos de claves de API de la organización de la clave autenticada, con creador (ID, nombre y correo actuales), fecha de creación, alcance y revocación. Requiere una clave global; las limitadas a sitios reciben 403. No acepta ID de organización. Nunca devuelve secretos ni hashes. Incluye revocadas para detectar claves creadas y revocadas entre consultas. Ordena por creación ascendente y después por ID ascendente.
Para alertas de claves nuevas, registra primero los ID de referencia. En cada consulta fija until al momento actual menos un minuto, solapa since con la ventana correcta anterior y mantén ambos límites mientras aumentas page_num hasta pagination.has_more false. Ambos límites son inclusivos. Deduplica alertas por ID y avanza la ventana solo tras completar todas las páginas. Filtra is_revoked localmente si solo necesitas activas.
Es un inventario actual, no un registro de auditoría duradero ni webhook: eliminar la cuenta del creador elimina sus claves y las eliminaciones simultáneas pueden desplazar páginas. Solapar ventanas reduce huecos, pero no garantiza detectar toda creación. La herramienta MCP list_api_keys expone los mismos campos y filtros para claves globales y conexiones OAuth de administradores de organización, según permisos MCP.
curl --request GET \
--url https://api.athenahq.ai/api/v1/api-keys \
--header 'x-api-key: <api-key>'import requests
url = "https://api.athenahq.ai/api/v1/api-keys"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.athenahq.ai/api/v1/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.athenahq.ai/api/v1/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 => [
"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.athenahq.ai/api/v1/api-keys"
req, _ := http.NewRequest("GET", 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.get("https://api.athenahq.ai/api/v1/api-keys")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.athenahq.ai/api/v1/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"api_keys": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"key_prefix": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>"
},
"is_global": true,
"website_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"is_revoked": true
}
],
"pagination": {
"page_num": 123,
"page_size": 123,
"has_more": true
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Parámetros de consulta
Incluye claves creadas en esta marca de tiempo ISO 8601 o después.
Incluye claves creadas en esta marca de tiempo ISO 8601 o antes. Mantén el valor fijo al paginar.
Número de página, empezando en cero.
x >= 0Número de claves por página, hasta 100.
1 <= x <= 100¿Esta página le ayudó?