Skip to main content

Overview

Providers allow you to connect your wearable devices and health platforms to Mirobody Health. Once connected, your health data is automatically synced and available for AI analysis.

Garmin Connect

Comprehensive fitness and health tracking

Whoop

Recovery, strain, and sleep optimization
More providers are coming soon. You can also add custom providers yourself!

Connecting a Provider

1

Get your device credentials

Obtain API credentials from your health device provider:
You’ll need these credentials to configure your provider connection.
2

Configure the provider

Add your credentials to config.yaml:
config.yaml
# For Garmin
GARMIN_CLIENT_ID: 'your_consumer_key'
GARMIN_CLIENT_SECRET: 'your_consumer_secret'
GARMIN_REDIRECT_URL: 'http://localhost:18080/api/v1/pulse/theta/theta_garmin/callback'

# For Whoop
WHOOP_CLIENT_ID: 'your_client_id'
WHOOP_CLIENT_SECRET: 'your_client_secret'
WHOOP_REDIRECT_URL: 'http://localhost:18080/api/v1/pulse/theta/theta_whoop/callback'
3

Link your account

Use the API to initiate OAuth flow:
# Get authorization URL
curl "http://localhost:18080/api/v1/pulse/theta/theta_garmin/link?user_id=YOUR_USER_ID"
Visit the returned URL to authorize access.
4

Verify connection

Check that your provider is linked:
curl "http://localhost:18080/api/v1/pulse/providers"
Your connected provider should show "status": "connected"

Available Providers

Garmin Connect

Authentication: OAuth 1.0
Status: Production Ready
Data Sync: Automatic daily sync
Garmin Connect provides comprehensive health data from Garmin wearables, including fitness trackers, smartwatches, and cycling computers.
Garmin data includes detailed activity tracking, advanced sleep analysis, and comprehensive heart rate metrics.

Whoop

Authentication: OAuth 2.0
Status: Production Ready
Data Sync: Automatic sync with configurable frequency
Whoop specializes in recovery, strain, and sleep optimization data, providing insights into training readiness and performance.
Whoop excels in recovery metrics, sleep coaching, and strain tracking for athletes and fitness enthusiasts.

Managing Connected Providers

List All Providers

curl http://localhost:18080/api/v1/pulse/providers

Disconnect a Provider

curl -X POST http://localhost:18080/api/v1/pulse/theta/theta_garmin/unlink \
  -H "Content-Type: application/json" \
  -d '{"user_id": "YOUR_USER_ID"}'

Data Synchronization

Once a provider is connected, data synchronization happens automatically:
When you first connect a provider, Mirobody Health pulls historical data:
  • Garmin: Last 30 days of data
  • Whoop: Last 30 days of data
This may take a few minutes depending on data volume.
After initial sync, data is updated automatically:
  • Schedule: Daily at configured intervals
  • Incremental: Only new data is fetched
  • Deduplication: Prevents duplicate records
You can also trigger manual syncs via the API if needed.
All provider data is transformed into standardized indicators:
  • Consistent naming across providers
  • Unified units (SI system)
  • Timestamps in ISO 8601 format
  • Stored in theta_ai.th_series_data table
See Data Format for details.

Troubleshooting

Problem: OAuth authorization fails or times outSolutions:
  1. Verify API credentials are correct in config.yaml
  2. Check redirect URL matches exactly (including http/https)
  3. Ensure Mirobody Health is accessible at the redirect URL
  4. Review provider’s developer console for errors
  5. Check OAuth token hasn’t expired
Problem: Provider connected but no data appearsSolutions:
  1. Wait for initial sync to complete (check logs)
  2. Verify user has data in their provider account
  3. Check for API rate limiting issues
  4. Review sync logs for errors
  5. Trigger manual sync if needed
Problem: Health data is outdatedSolutions:
  1. Check sync schedule in configuration
  2. Verify provider API is accessible
  3. Review sync logs for failures
  4. Check for provider API changes or downtime
  5. Trigger manual resync

Provider Status

Check provider connection status:
import aiohttp

async def check_provider_status(user_id: str):
    async with aiohttp.ClientSession() as session:
        async with session.get(
            f"http://localhost:18080/api/v1/pulse/providers",
            params={"user_id": user_id}
        ) as resp:
            data = await resp.json()
            
            for provider in data["providers"]:
                print(f"{provider['name']}: {provider['status']}")
                if provider['status'] == 'connected':
                    print(f"  Last sync: {provider.get('last_sync', 'N/A')}")

# Usage
await check_provider_status("your_user_id")

Next Steps