Syncing Data
Learn how to sync activities, wellness metrics, and nutrition logs to Coach Watts.
This guide explains how to sync third-party data—including activities, wellness metrics, and nutrition logs—to Coach Watts via our OAuth 2.0 API.
Core Scopes
To write data, your application must request the following scopes during the authorization flow:
| Scope | Resource | Access Provided |
|---|---|---|
workout:write | Activities | Upload .FIT files and manage workouts. |
health:write | Wellness | Log daily metrics like HRV, Sleep, and Weight. |
nutrition:write | Nutrition | Log calories, macros, and individual meal items. |
profile:write | Profile | Update core athlete metrics (Weight, FTP). |
1. Activities (FIT Files)
Coach Watts is built to process high-resolution training data. We recommend uploading original .fit files whenever possible.
- Endpoint:
POST /api/workouts/upload-fit - Content-Type:
multipart/form-data
Example (cURL)
curl -X POST https://app.coachwatts.com/api/workouts/upload-fit
-H "Authorization: Bearer YOUR_TOKEN"
-F "[email protected]"
-F "name=Sunday Endurance Ride"
-F "metadata={"app_version": "1.2.0", "device_id": "XYZ-99"}"
2. Wellness Metrics
Use this endpoint to sync daily health indicators. Coach Watts uses these to adjust the athlete's recovery capacity scores.
- Endpoint:
POST /api/wellness - Content-Type:
application/json
Payload Schema (Partial)
| Field | Type | Description |
|---|---|---|
date | String | Required. YYYY-MM-DD or ISO 8601. |
hrv | Number | Heart Rate Variability (ms). |
restingHr | Integer | Resting Heart Rate (bpm). |
sleepSecs | Integer | Total sleep duration in seconds. |
weight | Number | Body weight in kilograms (kg). |
vo2max | Number | Estimated VO2 Max. |
rawJson | Object | (Optional) Your raw payload for historical reference. |
3. Nutrition & Fueling
Nutrition sync is critical for our Metabolic Wave engine. We use exact timestamps to calculate glycogen availability for future workouts.
- Endpoint:
POST /api/nutrition - Content-Type:
application/json
Example Payload
{
"date": "2026-02-15",
"items": [
{
"name": "Pre-Ride Gel",
"carbs": 25,
"logged_at": "2026-02-15T06:00:00Z",
"absorptionType": "RAPID"
}
],
"rawJson": { "original_app": "MyFitnessPal" }
}
General Principles
Idempotency
All sync endpoints use an upsert logic based on the date (for wellness/nutrition) or hash (for files). Sending the same data multiple times will update the existing record rather than creating duplicates.
Timezones
Always send timestamps in ISO 8601 with timezone offsets (e.g., 2026-02-15T08:00:00+01:00). For daily aggregates (the date field), use the user's local calendar date.
