API Reference
Auth Model
All endpoints use session cookie auth (widt_session).
- Missing/invalid session ->
401 Unauthorized - Mutating actions are protected by CSRF origin checks and rate limiting
Export Endpoints
GET /api/export/csv
Download report as CSV.
Query params:
date=YYYY-MM-DD(single day)- or
start=YYYY-MM-DD&end=YYYY-MM-DD(range) scope=personal|team(defaultpersonal)
Response:
200 OK- CSV attachment file
Errors:
401 Unauthorized429 Rate limit exceeded
GET /api/export/pdf
Download report as PDF.
Query params:
date=YYYY-MM-DDorstart+endscope=personal|team(defaultpersonal)
Response:
200 OK- PDF attachment file
Errors:
401 Unauthorized429 Rate limit exceeded
Server Actions
File: src/app/actions/index.ts
Auth
setupActionloginActionlogoutAction
Logs
createLogActiondeleteLogAction
Category/Project
createCategoryActionupdateCategoryActiondeleteCategoryActioncreateProjectActionupdateProjectActiondeleteProjectAction
Team / RBAC
createTeamMemberActionupdateTeamMemberRoleActiondeleteTeamMemberAction
Planning + Drift
createPlanAllocationActiondeletePlanAllocationAction
Automation
createScheduledExportActionupdateScheduledExportActiondeleteScheduledExportActionrunScheduledExportsNowAction
AI Summary
generateDailyNarrativeAction
Validation Highlights
date:YYYY-MM-DDtime:HH:mm,endTime > startTimeenergy: integer1..5- planned minutes:
15..1440 - role enums:
OWNER,ADMIN,MEMBER - export enums:
- frequency
DAILY|WEEKLY|MONTHLY - format
CSV|PDF - scope
PERSONAL|TEAM
- frequency