API Reference

Base URL: https://retrace-zeta.vercel.app

Authentication

API endpoints support two authentication methods:


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 }

ParamTypeDescription
fromISO 8601Start date/time
toISO 8601End date/time
categorystringFilter by category
projectstringFilter by project name
searchstringFull-text search in content
tagstringFilter by tag
personstringFilter by person
componentstringFilter by component
limitnumberMax results (default 50, max 200)
offsetnumberOffset for pagination (default 0)

GET /api/entries/summary 🔒

Get a daily summary with category and project breakdowns.

ParamTypeDescription
dateYYYY-MM-DDDate to summarize (default: today)
timezoneIANA timezoneUser'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.