Skip to content

Stats & Export

GET /api/stats

Required scope: stats:read

Returns aggregate statistics about the authenticated user’s data.

HTTP/1.1 200 OK
{
"totalCategories": 12,
"totalEntries": 47,
"total2fa": 8,
"byKeyType": {
"simple": 30,
"group": 10,
"ssh": 4,
"json": 3
},
"byEnvironment": {
"development": 15,
"staging": 10,
"production": 22
}
}
FieldTypeDescription
totalCategoriesnumberNumber of key categories
totalEntriesnumberTotal number of key entries
total2fanumberNumber of 2FA tokens
byKeyTypeobjectEntry count broken down by key type
byEnvironmentobjectEntry count broken down by environment

GET /api/export

Required scope: export:read

Exports all entries as a single .env-formatted text file. All values are decrypted on the server and included in the output.

HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment; filename="kagi-export.env"
# OpenAI API — Blog Project (production)
OPENAI_API_KEY=sk-abc123...
# AWS Credentials — My AWS Account (production)
AWS_ACCESS_KEY_ID=AKIA...
AWS_SECRET_ACCESS_KEY=...
# ...
  • Each entry is preceded by a comment line: # <category name> — <entry name> (<environment>)
  • simple entries: ENV_VAR_NAME=value
  • group entries: each field is emitted as a separate KEY=value line
  • ssh and json entries: skipped (cannot be expressed as env vars)