Getting Started

Overview

MTH Health is a unified wearable health data platform. It connects data from Fitbit, Garmin, Whoop, and Dexcom into a single normalized REST API -- so you can build health-powered experiences without managing separate provider integrations.

Introduction

Health and fitness data is fragmented across wearable platforms. Each provider has its own API, authentication flow, data format, and rate limits. Building on top of multiple providers means writing and maintaining separate integrations for each one.

MTH Health solves this by acting as a middleware layer between your application and wearable providers. You integrate with one API and get access to activity, sleep, heart rate, recovery, glucose, nutrition journal, and health score data -- in a single, consistent schema.

Dexcom support is currently glucose-focused. It participates in the connection and sync flow, but the public score endpoints documented here remain focused on sleep, activity, and recovery data.

What you get:
  • One REST API for all wearable data, regardless of provider
  • Automatic OAuth token management and background data sync
  • Normalized data model -- same schema across all providers
  • User nutrition journaling with manual meals, generic drinks, dedicated water or coffee logs, and AI meal-photo analysis
  • Built-in health scoring engine that combines data across devices
  • Multi-tenant architecture with scoped API keys and user-level tokens

Prerequisites

Before you can start making API calls, you need three things:

1
An admin portal account with a tenant

Your tenant is your organization's isolated environment within MTH Health. Tenants are provisioned by the MTH Health team -- contact us to get started.

2
An application

Each tenant can have multiple apps (e.g., production, staging). Provider connections and API keys are scoped per app. Create apps in the admin portal.

3
An API key

Use it in the Authorization: Bearer ... header for server-side API requests. Created per app in the admin portal.

Apps and API keys are managed through the Admin Portal.

Quick Start

Get from zero to a connected user and the current public read APIs in five steps.

1

Set up your app

Sign in to the Admin Portal and create an application within your tenant. Enable the wearable providers you want to support (Fitbit, Garmin, Whoop, Dexcom) -- provider credentials are managed by MTH Health, so no setup with individual providers is required on your end.

2

Generate an API key

Navigate to the API Keys page for your app and create a key. Copy it immediately -- it is only shown once. This key authenticates your server for user management operations.

3

Create a user

Use your API key to create a user. The response includes a token field -- this is the user token you will need for all user-scoped operations (connections, journal entries, scores).

curl -- Create a user
curl -X POST \
  https://health-api.movetohappiness.com/api/v1/users \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "externalUserId": "user-123",
    "locale": "en-US",
    "timezone": "Europe/Brussels"
  }'

The response contains the full user object including the token field. Store this token securely -- you will use it to connect providers, write nutrition journals, and fetch scores.

4

Connect a provider

Using the user token, create an OAuth connect session. This returns an authorizationUrl that you redirect the end user to. After they grant permission, they are redirected back to your redirectUrl with ?success=true or ?success=false.

FitbitGarminWhoopDexcom

Once connected, a background worker automatically syncs the user's data. No manual triggering is needed.

Dexcom connections sync glucose-oriented data. Fitbit and Garmin support the legacy daily activity summary route, while Whoop exposes recovery and load-oriented activity reads through the dedicated activity-load endpoint.

5

Fetch journals, scores, and normalized reads

After data syncs, use the user token to retrieve health scores, normalized provider data, and nutrition journal entries. Scores are available as date ranges, activity or glucose data can be queried as date ranges with an optional provider filter, and journal entries are grouped by journal date. Journal logs can represent meals, generic drinks, or dedicated water and coffee entries.

curl -- List journal entries
curl -X GET \
  "https://health-api.movetohappiness.com/api/v1/users/a1b2c3d4-e5f6-7890-abcd-ef1234567890/journal-entries?date=2026-03-18" \
  -H "Authorization: Bearer USER_TOKEN"
curl -- Fetch daily scores
curl -X GET \
  "https://health-api.movetohappiness.com/api/v1/scores/daily?from=2026-03-10&to=2026-03-15" \
  -H "Authorization: Bearer USER_TOKEN"

Example response:

Response -- 200 OK
[
  {
    "date": "2026-03-15",
    "sleepScore": 82,
    "activityScore": 71,
    "recoveryScore": 78,
    "overallScore": 77,
    "components": { ... }
  }
]
curl -- Fetch glucose range
curl -X GET \
  "https://health-api.movetohappiness.com/api/v1/users/a1b2c3d4-e5f6-7890-abcd-ef1234567890/connections/glucose?from=2026-03-10&to=2026-03-15&provider=Dexcom" \
  -H "Authorization: Bearer USER_TOKEN"

These score endpoints currently return sleep, activity, and recovery-based scoring fields. Dexcom is still separate from the public scoring model, but glucose reads are available through the dedicated range endpoint documented in the API reference.

Supported providers

MTH Health currently supports the following wearable and health device providers. Each provider uses OAuth for authorization and supports different data types.

ProviderAuth TypeSupported Data Types
FitbitOAuth 2.0ActivityDaily, ActivitySession, Sleep, HeartRate, Recovery
GarminOAuth 1.0aActivityDaily, ActivitySession, Sleep, HeartRate, Recovery
WhoopOAuth 2.0Sleep, ActivitySession, Recovery, ActivityLoadDaily, ProfileSnapshot, BodyMeasurementSnapshot
DexcomOAuth 2.0GlucoseReading, GlucoseEvent, GlucoseCalibration

Now that you understand the basics, learn about the two-tier authentication system and how to manage API keys and user tokens.

Authentication →