API Overview
The FitRepo API is a JSON REST API that powers both the web app and the MCP server. You can call it directly to build integrations or automate data access.
Base URL
Section titled “Base URL”https://mydatafor.lifeIf self-hosting, replace with your instance URL.
Authentication
Section titled “Authentication”All API endpoints (except /api/health) require a personal API key sent as a Bearer token:
Authorization: Bearer your-api-key-hereGenerate an API key in Settings → MCP API Key.
Response format
Section titled “Response format”All responses are JSON. Successful responses return HTTP 2xx. Errors return a JSON body:
{ "error": "Human-readable error message" }Common status codes:
| Code | Meaning |
|---|---|
| 200 | OK |
| 400 | Bad request (invalid parameters) |
| 401 | Unauthorized (missing or invalid API key) |
| 404 | Not found |
| 409 | Conflict (e.g. backfill already running) |
| 503 | Service degraded (see /api/health) |
Pagination
Section titled “Pagination”List endpoints accept limit (default 20, max 100) and offset query parameters.
Date parameters
Section titled “Date parameters”Dates are accepted as YYYY-MM-DD strings. Timestamps are returned as ISO 8601 UTC strings (2025-03-15T07:30:00Z).
Endpoints
Section titled “Endpoints”| Method | Path | Description |
|---|---|---|
| GET | /api/health | Healthcheck |
| GET | /api/mcp/activities | List activities |
| GET | /api/mcp/activities/:id | Get activity |
| GET | /api/mcp/fitness | Fitness timeline (CTL/ATL/TSB) |
| GET | /api/mcp/best-efforts | All-time best efforts |
| GET | /api/mcp/wellness | Wellness log |
| GET | /api/mcp/thresholds | Threshold history |
| GET | /api/mcp/profile | Athlete profile |
| POST | /api/mcp/keys | Generate API key |
| DELETE | /api/mcp/keys | Revoke API key |
| GET | /api/account/export | Export all data (JSON download) |
| DELETE | /api/account/delete | Delete account (GDPR erasure) |