External: Mobile SDK

Import health data from SDK provider asynchronously via Celery.

Supports Apple HealthKit and Samsung Health SDK formats (identical payloads):

{
    "provider": "apple",
    "sdkVersion": "1.0.0",
    "syncTimestamp": "2021-01-01T00:00:00Z",
    "data": {
        "records": [...],
        "sleep": [...],
        "workouts": [...]
    }
}

Args: user_id: SDK user identifier body: Health data payload auth: SDK authentication (Bearer token or API key)

Returns: UploadDataResponse with 202 status and task queued message

Raises: HTTPException: 403 if token doesn't match user_id, 400 if provider unsupported. Payload validation runs async in the worker, not here.

post/api/v1/sdk/users/{user_id}/sync

Request

  • Base URL: https://api.openwearables.io (the document declares no server; this is the origin it was published from)
  • URL: https://api.openwearables.io/api/v1/sdk/users/{user_id}/sync
  • Auth: OAuth 2 (password, token URL /api/v1/auth/login)

Path parameters

user_idstring required

Headers

X-Open-Wearables-API-Keystring nullable

Request body

providerstring required
sdkVersionstring required
syncTimestampstring date-time required
syncSessionIdstring nullable

Device-generated id, stable for one historical export and shared by every batch it produces. Absent on SDK versions that do not send it yet.

syncType'historical' | 'live' nullable

Whether the run backfills history or delivers current data.

Example request

{
  "data": {
    "records": [
      {
        "endDate": "2026-02-24T08:30:00Z",
        "id": "abc-xyz-123-sys",
        "parentId": "abc-xyz-123",
        "source": {
          "appId": "com.sec.android.app.shealth",
          "deviceId": "R9ZW30ABC12",
          "deviceManufacturer": "Samsung",
          "deviceModel": "SM-R960",
          "deviceName": "Galaxy Watch7",
          "deviceType": "watch"
        },
        "startDate": "2026-02-24T08:30:00Z",
        "type": "BLOOD_PRESSURE_SYSTOLIC",
        "unit": "mmHg",
        "value": 122,
        "zoneOffset": "+01:00"
      }
    ],
    "sleep": [
      {
        "endDate": "2026-02-24T00:00:00Z",
        "id": "slp-001-s0-0",
        "parentId": "slp-001",
        "source": {
          "appId": "com.sec.android.app.shealth",
          "deviceId": "R9ZW30ABC12",
          "deviceManufacturer": "Samsung",
          "deviceModel": "SM-R960",
          "deviceName": "Galaxy Watch7",
          "deviceType": "watch"
        },
        "stage": "light",
        "startDate": "2026-02-23T23:10:00Z",
        "values": [
          {
            "type": "sleepScore",
            "unit": "score",
            "value": 82
          }
        ],
        "zoneOffset": "+01:00"
      }
    ],
    "workouts": [
      {
        "endDate": "2026-02-24T06:45:00Z",
        "id": "wrk-001-s0",
        "notes": "Morning run in the park",
        "parentId": "wrk-001",
        "route": [
          {
            "altitudeM": 142,
            "horizontalAccuracyM": 3.5,
            "latitude": 52.229676,
            "longitude": 21.012229,
            "timestamp": "2026-02-24T06:01:00Z"
          }
        ],
        "samples": [
          {
            "timestamp": "2026-02-24T06:01:00Z",
            "type": "heartRate",
            "unit": "bpm",
            "value": 110
          },
          {
            "timestamp": "2026-02-24T06:01:00Z",
            "type": "cadence",
            "unit": "spm",
            "value": 155
          },
          {
            "timestamp": "2026-02-24T06:01:00Z",
            "type": "speed",
            "unit": "m/s",
            "value": 1.8
          }
        ],
        "source": {
          "appId": "com.sec.android.app.shealth",
          "deviceId": "R9ZW30ABC12",
          "deviceManufacturer": "Samsung",
          "deviceModel": "SM-R960",
          "deviceName": "Galaxy Watch7",
          "deviceType": "watch"
        },
        "startDate": "2026-02-24T06:00:00Z",
        "type": "RUNNING",
        "values": [
          {
            "type": "duration",
            "unit": "ms",
            "value": 2700000
          },
          {
            "type": "calories",
            "unit": "kcal",
            "value": 345.5
          },
          {
            "type": "distance",
            "unit": "m",
            "value": 5234
          },
          {
            "type": "meanHeartRate",
            "unit": "bpm",
            "value": 142.3
          },
          {
            "type": "maxHeartRate",
            "unit": "bpm",
            "value": 178
          },
          {
            "type": "minHeartRate",
            "unit": "bpm",
            "value": 95
          },
          {
            "type": "meanSpeed",
            "unit": "m/s",
            "value": 1.5
          },
          {
            "type": "maxSpeed",
            "unit": "m/s",
            "value": 3.2
          },
          {
            "type": "meanCadence",
            "unit": "spm",
            "value": 165
          },
          {
            "type": "maxCadence",
            "unit": "spm",
            "value": 182
          },
          {
            "type": "altitudeGain",
            "unit": "m",
            "value": 45
          },
          {
            "type": "altitudeLoss",
            "unit": "m",
            "value": 42
          },
          {
            "type": "maxAltitude",
            "unit": "m",
            "value": 185
          },
          {
            "type": "minAltitude",
            "unit": "m",
            "value": 140
          },
          {
            "type": "vo2Max",
            "unit": "mL/kg/min",
            "value": 42.5
          }
        ],
        "zoneOffset": "+01:00"
      }
    ]
  },
  "provider": "samsung",
  "sdkVersion": "0.1.0",
  "syncTimestamp": "2026-02-24T10:00:00Z"
}

Response

Successful Response

status_codeinteger required

HTTP status code (typically 202 for async operations)

responsestring required

Human-readable response message

user_idstring nullable

User ID associated with the import operation

dropped_countinteger

Number of individual records dropped by per-record validation

records_savedinteger

Time-series samples saved

records_insertedinteger

Time-series rows that did not exist before

records_updatedinteger

Time-series rows refreshed in place

typesstring[]

Canonical SeriesType identifiers written by this batch (e.g. 'heart_rate'), sorted. Empty when the batch saved no time-series samples.

workouts_savedinteger

Workouts saved

meals_savedinteger

Meal correlations saved

sleep_savedinteger

Sleep records saved

Changes

    • info

      added the new HKQuantityTypeIdentifierHeartRateVariabilityRMSSD enum value to the request property ////

    • info

      added the new DIETARY_BIOTIN enum value to the request property ////

    • info

      added the new DIETARY_CAFFEINE enum value to the request property ////

    • info

      added the new DIETARY_CALCIUM enum value to the request property ////

    • info

      added the new DIETARY_CARBOHYDRATE enum value to the request property ////

    • info

      added the new DIETARY_CHLORIDE enum value to the request property ////

    • info

      added the new DIETARY_CHOLESTEROL enum value to the request property ////

    • info

      added the new DIETARY_CHROMIUM enum value to the request property ////

    • info

      added the new DIETARY_COPPER enum value to the request property ////

    • info

      added the new DIETARY_ENERGY enum value to the request property ////

    • info

      added the new DIETARY_ENERGY_FROM_FAT enum value to the request property ////

    • info

      added the new DIETARY_FIBER enum value to the request property ////

    • info

      added the new DIETARY_FOLATE enum value to the request property ////

    • info

      added the new DIETARY_FOLIC_ACID enum value to the request property ////

    • info

      added the new DIETARY_IODINE enum value to the request property ////

    • info

      added the new DIETARY_IRON enum value to the request property ////

    • info

      added the new DIETARY_MAGNESIUM enum value to the request property ////

    • info

      added the new DIETARY_MANGANESE enum value to the request property ////

    • info

      added the new DIETARY_MOLYBDENUM enum value to the request property ////

    • info

      added the new DIETARY_MONOUNSATURATED_FAT enum value to the request property ////

    • info

      added the new DIETARY_NIACIN enum value to the request property ////

    • info

      added the new DIETARY_PANTOTHENIC_ACID enum value to the request property ////

    • info

      added the new DIETARY_PHOSPHORUS enum value to the request property ////

    • info

      added the new DIETARY_POLYUNSATURATED_FAT enum value to the request property ////

    • info

      added the new DIETARY_POTASSIUM enum value to the request property ////

    • info

      added the new DIETARY_PROTEIN enum value to the request property ////

    • info

      added the new DIETARY_RIBOFLAVIN enum value to the request property ////

    • info

      added the new DIETARY_SATURATED_FAT enum value to the request property ////

    • info

      added the new DIETARY_SELENIUM enum value to the request property ////

    • info

      added the new DIETARY_SODIUM enum value to the request property ////

    • info

      added the new DIETARY_SUGAR enum value to the request property ////

    • info

      added the new DIETARY_THIAMIN enum value to the request property ////

    • info

      added the new DIETARY_TOTAL_FAT enum value to the request property ////

    • info

      added the new DIETARY_TRANS_FAT enum value to the request property ////

    • info

      added the new DIETARY_UNSATURATED_FAT enum value to the request property ////

    • info

      added the new DIETARY_VITAMIN_A enum value to the request property ////

    • info

      added the new DIETARY_VITAMIN_B12 enum value to the request property ////

    • info

      added the new DIETARY_VITAMIN_B6 enum value to the request property ////

    • info

      added the new DIETARY_VITAMIN_C enum value to the request property ////

    • info

      added the new DIETARY_VITAMIN_D enum value to the request property ////

    • info

      added the new DIETARY_VITAMIN_E enum value to the request property ////

    • info

      added the new DIETARY_VITAMIN_K enum value to the request property ////

    • info

      added the new DIETARY_ZINC enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryBiotin enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryCaffeine enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryCalcium enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryCarbohydrates enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryChloride enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryCholesterol enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryChromium enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryCopper enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryEnergyConsumed enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryFatMonounsaturated enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryFatPolyunsaturated enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryFatSaturated enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryFatTotal enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryFiber enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryFolate enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryIodine enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryIron enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryMagnesium enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryManganese enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryMolybdenum enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryNiacin enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryPantothenicAcid enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryPhosphorus enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryPotassium enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryProtein enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryRiboflavin enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietarySelenium enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietarySodium enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietarySugar enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryThiamin enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryVitaminA enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryVitaminB12 enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryVitaminB6 enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryVitaminC enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryVitaminD enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryVitaminE enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryVitaminK enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryWater enum value to the request property ////

    • info

      added the new HKQuantityTypeIdentifierDietaryZinc enum value to the request property ////

    • info

      added the optional property to the response with the status