Env Projects
Env Projects let you store encrypted .env files (.env, .env.local, .env.production, .env.development) organized by project.
Schema
Section titled “Schema”{ "id": "uuid", "userId": "user_abc123", "name": "Blog Project", "description": "Next.js blog environment files", "fileCount": 3, "createdAt": "2026-01-15T00:00:00.000Z", "updatedAt": "2026-01-15T00:00:00.000Z"}List projects
Section titled “List projects”GET /api/envsAuthorization: Bearer kagi_<your-key>Scope: envs:read
Query parameters:
| Parameter | Type | Description |
|---|---|---|
search | string | Filter by name |
Response: 200 OK
{ "data": [ { "id": "uuid", "name": "Blog Project", "description": "...", "fileCount": 3, "createdAt": "...", "updatedAt": "..." } ]}Create project
Section titled “Create project”POST /api/envsAuthorization: Bearer kagi_<your-key>Content-Type: application/json
{ "name": "Blog Project", "description": "Next.js blog environment files"}Scope: envs:write
Response: 201 Created
Get project with files
Section titled “Get project with files”GET /api/envs/{id}Authorization: Bearer kagi_<your-key>Scope: envs:read
Returns the project metadata plus a list of its files (without content).
Update project
Section titled “Update project”PUT /api/envs/{id}Authorization: Bearer kagi_<your-key>Content-Type: application/json
{ "name": "Updated Name", "description": "Updated description"}Scope: envs:write
Delete project
Section titled “Delete project”DELETE /api/envs/{id}Authorization: Bearer kagi_<your-key>Scope: envs:write
Cascade-deletes all files in the project.
Save / upsert file
Section titled “Save / upsert file”POST /api/envs/{id}/filesAuthorization: Bearer kagi_<your-key>Content-Type: application/json
{ "fileType": "env", "content": "DATABASE_URL=postgresql://...\nAPI_KEY=sk-..."}Scope: envs:write
fileType values |
|---|
env |
env.local |
env.production |
env.development |
If a file with the same fileType already exists in the project, it is updated (upsert).
Delete file
Section titled “Delete file”DELETE /api/envs/{id}/files/{fileId}Authorization: Bearer kagi_<your-key>Scope: envs:write
Reveal file content
Section titled “Reveal file content”POST /api/envs/{id}/files/{fileId}/revealAuthorization: Bearer kagi_<your-key>Scope: envs:reveal
Response: 200 OK
{ "data": { "id": "uuid", "projectId": "uuid", "fileType": "env", "content": "DATABASE_URL=postgresql://...\nAPI_KEY=sk-..." }}File content is decrypted server-side and returned as a plaintext string.