const r = await fetch('/api/v1/keys', { credentials: 'include' });
const { data } = await r.json();
data.forEach(k => console.log(`${k.key_prefix}: ${k.name} (${k.tier})`));{
"data": [
{
"id": "00000000-0000-4000-8000-000000000123",
"key_prefix": "sk_live_zIc8",
"name": "Production SIEM",
"tier": "pro",
"scopes": [
"read:iocs",
"read:articles",
"read:articles:export",
"read:stix"
],
"total_requests": 142587,
"last_used_at": "2026-05-17T09:42:11Z",
"created_at": "2026-01-15T10:00:00Z",
"expires_at": null,
"revoked_at": null
},
{
"id": "00000000-0000-4000-8000-000000000456",
"key_prefix": "sk_live_aB3x",
"name": "Dev sandbox",
"tier": "free",
"scopes": [
"read:iocs",
"read:articles"
],
"total_requests": 234,
"last_used_at": "2026-05-16T18:30:00Z",
"created_at": "2026-05-10T08:00:00Z",
"expires_at": "2026-08-10T08:00:00Z",
"revoked_at": null
}
],
"meta": {
"total": 2
}
}Returns all API keys belonging to the authenticated user. Used by the SOC Defenders dashboard to populate the key-management UI.
Auth: Session cookie (browser), not Bearer token. Hit this from a logged-in fetch — programmatic Bearer access is not allowed for the keys endpoints (chicken-and-egg).
Each list item includes the key prefix (e.g. sk_live_zIc8) but not the full secret — full keys are only ever shown once at creation time. Use the prefix to identify keys in your code or telemetry.
const r = await fetch('/api/v1/keys', { credentials: 'include' });
const { data } = await r.json();
data.forEach(k => console.log(`${k.key_prefix}: ${k.name} (${k.tier})`));{
"data": [
{
"id": "00000000-0000-4000-8000-000000000123",
"key_prefix": "sk_live_zIc8",
"name": "Production SIEM",
"tier": "pro",
"scopes": [
"read:iocs",
"read:articles",
"read:articles:export",
"read:stix"
],
"total_requests": 142587,
"last_used_at": "2026-05-17T09:42:11Z",
"created_at": "2026-01-15T10:00:00Z",
"expires_at": null,
"revoked_at": null
},
{
"id": "00000000-0000-4000-8000-000000000456",
"key_prefix": "sk_live_aB3x",
"name": "Dev sandbox",
"tier": "free",
"scopes": [
"read:iocs",
"read:articles"
],
"total_requests": 234,
"last_used_at": "2026-05-16T18:30:00Z",
"created_at": "2026-05-10T08:00:00Z",
"expires_at": "2026-08-10T08:00:00Z",
"revoked_at": null
}
],
"meta": {
"total": 2
}
}Documentation Index
Fetch the complete documentation index at: https://docs.socdefenders.ai/llms.txt
Use this file to discover all available pages before exploring further.