Skip to content

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.

https://mydatafor.life

If self-hosting, replace with your instance URL.

Different route groups use different auth mechanisms:

Route groupAuth mechanism
/api/mcp/* (except keys)MCP Bearer token (Authorization: Bearer <api-key>)
POST/DELETE /api/mcp/keysSupabase session cookie (web app login)
/api/account/*, /api/settings, /api/connections/*, /api/backfill/*, /api/activities/*, /api/documents/*Supabase session cookie
/api/webhooks/wahooPer-user webhook token (encoded in the webhook URL)
/api/health, /api/oauth/.*Public or session-mediated (see individual endpoint docs)

For direct API access to the MCP endpoints, generate an API key in Settings → MCP & API Keys and pass it as a Bearer token.

All responses are JSON. Successful responses return HTTP 2xx. Errors return a JSON body:

{ "error": "Human-readable error message" }

Common status codes:

CodeMeaning
200OK
400Bad request (invalid parameters)
401Unauthorized (missing or invalid API key)
404Not found
409Conflict (e.g. a push to that destination is already in progress)
422Unprocessable (e.g. streams requested for an activity with no stored FIT file)
429Too many requests: e.g. more than 5 imports started in an hour, more than 60 manual pushes to Strava/Intervals.icu in an hour, or more than 60 MCP calls a minute. Wait and retry; the response’s Retry-After header gives the window in seconds.
502Upstream provider error (e.g. Intervals.icu rejected the request)
503Service degraded (see /api/health)

List endpoints accept limit and offset query parameters. The activities endpoint defaults to limit=50 with a maximum of 200. Other list endpoints may differ — check the individual endpoint docs.

Dates are accepted as YYYY-MM-DD strings. Timestamps are returned as ISO 8601 UTC strings (2025-03-15T07:30:00Z).

MethodPathDescription
GET/api/healthHealthcheck
GET/api/mcp/activitiesList activities
GET/api/mcp/activities/:idGet activity
GET/api/mcp/fitnessFitness timeline (CTL/ATL/TSB)
GET/api/mcp/best-effortsAll-time best efforts
GET/api/mcp/wellnessWellness log
GET/api/mcp/thresholdsThreshold history
GET/api/mcp/profileAthlete profile
GET/api/mcp/activities/:id/streamsDownsampled per-second streams (resolution, channels, startOffset, endOffset)
GET/api/mcp/activities/:id/lapsDevice laps and detected climbs (detectClimbs=false to skip)
POST/api/mcp/planned-workoutsPush planned workouts to Intervals.icu ({ workouts, dryRun })
GET/api/mcp/planned-workoutsRead planned events (oldest, newest, onlyFitrepo, categories)
GET/api/mcp/backfillImport sources, latest activity, job status (jobIds, waitSeconds)
POST/api/mcp/backfillStart an import ({ source, from, to, force })
POST/api/mcp/file-import/uploadsStart a multipart upload of an archive ({ filename, bytes } → { uploadId, partSize, partCount })
POST/api/mcp/file-import/uploads/:id/partsPresigned PUT URLs for parts ({ partNumbers }, max 50)
POST/api/mcp/file-import/uploads/:id/completeFinish the upload ({ parts: [{ partNumber, etag }] }); the size is verified
POST/api/mcp/file-import/startImport an uploaded archive ({ uploadId?, source?, dryRun?, force? }). dryRun defaults to true. Follow with GET /api/mcp/backfill
POST/api/mcp/file-import/jobs (+ /:id/files, /:id/total, /:id/finish)Legacy per-file upload used by @fitrepo/mcp-server 0.2.x (raw file bytes, max 4 MB each). Kept for compatibility; new clients use the upload routes above
POST/api/mcp/wellness/syncPull wellness from Intervals.icu or WHOOP ({ source?, from?, to? })
GET/api/mcp/documentsCoaching documents: ?active=1, ?id= / ?slug=, or list (?type=)
POST/api/mcp/documentsSave a new document version ({ type, content, slug, name, activate, basedOn })
POST/api/mcp/documents/activeMake a document active ({ id } or { slug, type })
POST/api/mcp/keysGenerate API key
DELETE/api/mcp/keysRevoke API key
GET/api/account/exportExport all data (JSON download)
DELETE/api/account/deleteDelete account (GDPR erasure)
POST/api/activities/recompute-loadFill missing TSS / IF from the FTP active on each ride’s date (session; 5 an hour) → { checked, updated, noFtpForDate }