Stats & Export
GET /api/statsRequired scope: stats:read
Returns aggregate statistics about the authenticated user’s data.
Response
Section titled “Response”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 }}Response fields
Section titled “Response fields”| Field | Type | Description |
|---|---|---|
totalCategories | number | Number of key categories |
totalEntries | number | Total number of key entries |
total2fa | number | Number of 2FA tokens |
byKeyType | object | Entry count broken down by key type |
byEnvironment | object | Entry count broken down by environment |
Export
Section titled “Export”GET /api/exportRequired 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.
Response
Section titled “Response”HTTP/1.1 200 OKContent-Type: text/plain; charset=utf-8Content-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=...
# ...Format
Section titled “Format”- Each entry is preceded by a comment line:
# <category name> — <entry name> (<environment>) simpleentries:ENV_VAR_NAME=valuegroupentries: each field is emitted as a separateKEY=valuelinesshandjsonentries: skipped (cannot be expressed as env vars)