API Reference
Base URL: https://retrace-zeta.vercel.app
Authentication
API endpoints support two authentication methods:
- Session cookies — automatically sent by the browser when logged in via GitHub/Google OAuth
- Bearer token — for API/MCP clients:
Authorization: Bearer rt_abc123...
Auth Endpoints
POST /api/auth/register
Create a new user account.
{
"email": "user@example.com",
"password": "securepassword",
"name": "Jane Developer"
}POST /api/auth/login
Verify credentials (for web UI).
POST /api/auth/generate-token
Login and generate an API token in one step.
{
"email": "user@example.com",
"password": "securepassword",
"label": "work-laptop"
}⚠️ The raw token is only returned once. Store it securely.
POST /api/auth/tokens 🔒
Generate a new API token (requires session or token auth).
GET /api/auth/tokens 🔒
List all tokens for the authenticated user (without secrets).
DELETE /api/auth/tokens/:id 🔒
Revoke a token.
Entry Endpoints
POST /api/entries 🔒
Create a journal entry. Only content is required.
{
"content": "Implemented user authentication flow",
"category": "coding",
"project": "retrace",
"tags": ["auth", "feature"],
"people": ["Alice"],
"refs": ["PR-42"],
"component": "auth-service",
"source": "copilot",
"timestamp": "2026-07-22T14:30:00Z"
}GET /api/entries 🔒
Query journal entries with filters. Returns a paginated response: { entries, total, limit, offset }
| Param | Type | Description |
|---|---|---|
| from | ISO 8601 | Start date/time |
| to | ISO 8601 | End date/time |
| category | string | Filter by category |
| project | string | Filter by project name |
| search | string | Full-text search in content |
| tag | string | Filter by tag |
| person | string | Filter by person |
| component | string | Filter by component |
| limit | number | Max results (default 50, max 200) |
| offset | number | Offset for pagination (default 0) |
GET /api/entries/summary 🔒
Get a daily summary with category and project breakdowns.
| Param | Type | Description |
|---|---|---|
| date | YYYY-MM-DD | Date to summarize (default: today) |
| timezone | IANA timezone | User's timezone for correct date boundaries (e.g. America/Denver) |
GET /api/entries/search 🔒
Search entries by content using blind index matching.
DELETE /api/entries/:id 🔒
Delete a journal entry by ID.
Project Endpoints
GET /api/projects 🔒
List all projects for the authenticated user. Returns array of { id, name, description, created_at }.
POST /api/projects 🔒
Create a new project.
{
"name": "retrace",
"description": "AI-powered work memory"
}POST /mcp
MCP streamable HTTP endpoint. Supports OAuth 2.1 with PKCE or Bearer token authentication.