> ## Documentation Index
> Fetch the complete documentation index at: https://openwearables.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync Sdk Data

> Import health data from SDK provider asynchronously via Celery.

Supports Apple HealthKit and Samsung Health SDK formats (identical payloads):
```json
{
    "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.



## OpenAPI

````yaml /openapi.json post /api/v1/sdk/users/{user_id}/sync
openapi: 3.1.0
info:
  title: Open Wearables API
  version: 1.0.0
servers: []
security: []
paths:
  /api/v1/sdk/users/{user_id}/sync:
    post:
      tags:
        - 'External: Mobile SDK'
      summary: Sync Sdk Data
      description: >-
        Import health data from SDK provider asynchronously via Celery.


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

        ```json

        {
            "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.
      operationId: sync_sdk_data_api_v1_sdk_users__user_id__sync_post
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            title: User Id
        - name: X-Open-Wearables-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Open-Wearables-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              title: SyncRequest
              description: >-
                Schema for Apple HealthKit data import via SDK.


                This schema represents the structure of health data exported
                from Apple HealthKit

                and sent to the SDK sync endpoint. The data is processed
                asynchronously via Celery.


                Structure:

                - `data.records`: Time-series measurements (heart rate, steps,
                distance, etc.)

                - `data.sleep`: Sleep phase records (in bed, awake, light, deep,
                REM)

                - `data.workouts`: Exercise/workout sessions with statistics


                All fields within `data` are optional - you can send any
                combination of records, sleep, and workouts.
              example:
                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'
              properties:
                provider:
                  type: string
                  title: Provider
                sdkVersion:
                  type: string
                  title: Sdkversion
                syncTimestamp:
                  format: date-time
                  title: Synctimestamp
                  type: string
                syncSessionId:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: >-
                    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.
                  title: Syncsessionid
                syncType:
                  anyOf:
                    - type: string
                      enum:
                        - historical
                        - live
                      title: SyncScope
                      description: >-
                        Whether the run backfills history or delivers current
                        data.
                    - type: 'null'
                  description: >-
                    Whether this batch belongs to a historical export or to live
                    sync.
                data:
                  description: Container for health data arrays (records, sleep, workouts)
                  properties:
                    records:
                      description: >-
                        Time-series health measurements (heart rate, steps,
                        distance, etc.)
                      items:
                        description: >-
                          Health metric record from HealthKit (heart rate,
                          steps, distance, etc.).
                        properties:
                          id:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Id
                          parentId:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Parentid
                          type:
                            anyOf:
                              - description: >-
                                  Metric type identifiers for Apple HealthKit
                                  and Samsung/Health Connect SDK.


                                  Apple types use HKQuantityTypeIdentifier...
                                  strings.

                                  Samsung/HC types use uppercase
                                  SCREAMING_SNAKE_CASE strings (e.g.
                                  "HEART_RATE").
                                enum:
                                  - HKQuantityTypeIdentifierHeartRate
                                  - HEART_RATE
                                  - HKQuantityTypeIdentifierRestingHeartRate
                                  - RESTING_HEART_RATE
                                  - >-
                                    HKQuantityTypeIdentifierHeartRateVariabilitySDNN
                                  - >-
                                    HKQuantityTypeIdentifierHeartRateVariabilityRMSSD
                                  - HEART_RATE_VARIABILITY
                                  - >-
                                    HKQuantityTypeIdentifierHeartRateRecoveryOneMinute
                                  - >-
                                    HKQuantityTypeIdentifierWalkingHeartRateAverage
                                  - HKQuantityTypeIdentifierOxygenSaturation
                                  - OXYGEN_SATURATION
                                  - HKQuantityTypeIdentifierBloodGlucose
                                  - BLOOD_GLUCOSE
                                  - >-
                                    HKQuantityTypeIdentifierBloodPressureSystolic
                                  - BLOOD_PRESSURE_SYSTOLIC
                                  - >-
                                    HKQuantityTypeIdentifierBloodPressureDiastolic
                                  - BLOOD_PRESSURE_DIASTOLIC
                                  - HKQuantityTypeIdentifierRespiratoryRate
                                  - RESPIRATORY_RATE
                                  - HKQuantityTypeIdentifierHeight
                                  - HEIGHT
                                  - WEIGHT
                                  - HKQuantityTypeIdentifierBodyMass
                                  - LEAN_BODY_MASS
                                  - SKELETAL_MUSCLE_MASS
                                  - BODY_FAT_MASS
                                  - HKQuantityTypeIdentifierBodyFatPercentage
                                  - BODY_FAT
                                  - HKQuantityTypeIdentifierBodyMassIndex
                                  - BMI
                                  - HKQuantityTypeIdentifierLeanBodyMass
                                  - HKQuantityTypeIdentifierBodyTemperature
                                  - BODY_TEMPERATURE
                                  - HKQuantityTypeIdentifierVO2Max
                                  - VO2_MAX
                                  - >-
                                    HKQuantityTypeIdentifierSixMinuteWalkTestDistance
                                  - HKQuantityTypeIdentifierStepCount
                                  - STEP_COUNT
                                  - HKQuantityTypeIdentifierActiveEnergyBurned
                                  - HKQuantityTypeIdentifierBasalEnergyBurned
                                  - ACTIVE_CALORIES_BURNED
                                  - BASAL_METABOLIC_RATE
                                  - HKQuantityTypeIdentifierAppleStandTime
                                  - HKQuantityTypeIdentifierAppleExerciseTime
                                  - HKQuantityTypeIdentifierFlightsClimbed
                                  - FLOORS_CLIMBED
                                  - DISTANCE
                                  - >-
                                    HKQuantityTypeIdentifierDistanceWalkingRunning
                                  - HKQuantityTypeIdentifierDistanceCycling
                                  - HKQuantityTypeIdentifierDistanceSwimming
                                  - >-
                                    HKQuantityTypeIdentifierDistanceDownhillSnowSports
                                  - HKQuantityTypeIdentifierDistancePaddleSports
                                  - HKQuantityTypeIdentifierDistanceRowing
                                  - >-
                                    HKQuantityTypeIdentifierDistanceSkatingSports
                                  - HKQuantityTypeIdentifierDistanceWheelchair
                                  - >-
                                    HKQuantityTypeIdentifierDistanceCrossCountrySkiing
                                  - HKQuantityTypeIdentifierWalkingStepLength
                                  - HKQuantityTypeIdentifierWalkingSpeed
                                  - >-
                                    HKQuantityTypeIdentifierWalkingDoubleSupportPercentage
                                  - >-
                                    HKQuantityTypeIdentifierWalkingAsymmetryPercentage
                                  - >-
                                    HKQuantityTypeIdentifierAppleWalkingSteadiness
                                  - HKQuantityTypeIdentifierStairDescentSpeed
                                  - HKQuantityTypeIdentifierStairAscentSpeed
                                  - HKQuantityTypeIdentifierRunningPower
                                  - HKQuantityTypeIdentifierRunningSpeed
                                  - >-
                                    HKQuantityTypeIdentifierRunningVerticalOscillation
                                  - >-
                                    HKQuantityTypeIdentifierRunningGroundContactTime
                                  - HKQuantityTypeIdentifierRunningStrideLength
                                  - HKQuantityTypeIdentifierSwimmingStrokeCount
                                  - >-
                                    HKQuantityTypeIdentifierEnvironmentalAudioExposure
                                  - >-
                                    HKQuantityTypeIdentifierHeadphoneAudioExposure
                                  - >-
                                    HKQuantityTypeIdentifierEnvironmentalSoundReduction
                                  - HKQuantityTypeIdentifierTimeInDaylight
                                  - HKQuantityTypeIdentifierPhysicalEffort
                                  - HKQuantityTypeIdentifierWorkoutEffortScore
                                  - >-
                                    HKQuantityTypeIdentifierEstimatedWorkoutEffortScore
                                  - HKQuantityTypeIdentifierAppleMoveTime
                                  - >-
                                    HKQuantityTypeIdentifierAppleSleepingWristTemperature
                                  - HKQuantityTypeIdentifierBloodAlcoholContent
                                  - >-
                                    HKQuantityTypeIdentifierPeripheralPerfusionIndex
                                  - HKQuantityTypeIdentifierForcedVitalCapacity
                                  - >-
                                    HKQuantityTypeIdentifierForcedExpiratoryVolume1
                                  - >-
                                    HKQuantityTypeIdentifierPeakExpiratoryFlowRate
                                  - HKQuantityTypeIdentifierBasalBodyTemperature
                                  - >-
                                    HKQuantityTypeIdentifierAppleSleepingBreathingDisturbances
                                  - HKQuantityTypeIdentifierWaistCircumference
                                  - HKQuantityTypeIdentifierInsulinDelivery
                                  - HKQuantityTypeIdentifierNumberOfTimesFallen
                                  - HKQuantityTypeIdentifierInhalerUsage
                                  - >-
                                    HKQuantityTypeIdentifierNumberOfAlcoholicBeverages
                                  - HYDRATION
                                  - >-
                                    HKQuantityTypeIdentifierElectrodermalActivity
                                  - HKQuantityTypeIdentifierUVExposure
                                  - HKQuantityTypeIdentifierPushCount
                                  - >-
                                    HKQuantityTypeIdentifierAtrialFibrillationBurden
                                  - HKQuantityTypeIdentifierUnderwaterDepth
                                  - HKQuantityTypeIdentifierWaterTemperature
                                  - HKQuantityTypeIdentifierCyclingCadence
                                  - >-
                                    HKQuantityTypeIdentifierCyclingFunctionalThresholdPower
                                  - HKQuantityTypeIdentifierCyclingPower
                                  - HKQuantityTypeIdentifierCyclingSpeed
                                  - POWER
                                  - SPEED
                                  - CYCLING_PEDALING_CADENCE
                                  - TOTAL_CALORIES_BURNED
                                  - >-
                                    HKQuantityTypeIdentifierCrossCountrySkiingSpeed
                                  - HKQuantityTypeIdentifierPaddleSportsSpeed
                                  - HKQuantityTypeIdentifierRowingSpeed
                                  - HKQuantityTypeIdentifierNikeFuel
                                  - >-
                                    HKQuantityTypeIdentifierDietaryEnergyConsumed
                                  - DIETARY_ENERGY
                                  - HKQuantityTypeIdentifierDietaryCarbohydrates
                                  - DIETARY_CARBOHYDRATE
                                  - HKQuantityTypeIdentifierDietaryFiber
                                  - DIETARY_FIBER
                                  - HKQuantityTypeIdentifierDietarySugar
                                  - DIETARY_SUGAR
                                  - HKQuantityTypeIdentifierDietaryFatTotal
                                  - DIETARY_TOTAL_FAT
                                  - HKQuantityTypeIdentifierDietaryFatSaturated
                                  - DIETARY_SATURATED_FAT
                                  - >-
                                    HKQuantityTypeIdentifierDietaryFatMonounsaturated
                                  - DIETARY_MONOUNSATURATED_FAT
                                  - >-
                                    HKQuantityTypeIdentifierDietaryFatPolyunsaturated
                                  - DIETARY_POLYUNSATURATED_FAT
                                  - HKQuantityTypeIdentifierDietaryCholesterol
                                  - DIETARY_CHOLESTEROL
                                  - HKQuantityTypeIdentifierDietaryProtein
                                  - DIETARY_PROTEIN
                                  - HKQuantityTypeIdentifierDietarySodium
                                  - DIETARY_SODIUM
                                  - HKQuantityTypeIdentifierDietaryPotassium
                                  - DIETARY_POTASSIUM
                                  - HKQuantityTypeIdentifierDietaryCalcium
                                  - DIETARY_CALCIUM
                                  - HKQuantityTypeIdentifierDietaryIron
                                  - DIETARY_IRON
                                  - HKQuantityTypeIdentifierDietaryMagnesium
                                  - DIETARY_MAGNESIUM
                                  - HKQuantityTypeIdentifierDietaryPhosphorus
                                  - DIETARY_PHOSPHORUS
                                  - HKQuantityTypeIdentifierDietaryZinc
                                  - DIETARY_ZINC
                                  - HKQuantityTypeIdentifierDietaryCopper
                                  - DIETARY_COPPER
                                  - HKQuantityTypeIdentifierDietaryManganese
                                  - DIETARY_MANGANESE
                                  - HKQuantityTypeIdentifierDietarySelenium
                                  - DIETARY_SELENIUM
                                  - HKQuantityTypeIdentifierDietaryChromium
                                  - DIETARY_CHROMIUM
                                  - HKQuantityTypeIdentifierDietaryMolybdenum
                                  - DIETARY_MOLYBDENUM
                                  - HKQuantityTypeIdentifierDietaryIodine
                                  - DIETARY_IODINE
                                  - HKQuantityTypeIdentifierDietaryChloride
                                  - DIETARY_CHLORIDE
                                  - HKQuantityTypeIdentifierDietaryVitaminA
                                  - DIETARY_VITAMIN_A
                                  - HKQuantityTypeIdentifierDietaryVitaminB6
                                  - DIETARY_VITAMIN_B6
                                  - HKQuantityTypeIdentifierDietaryVitaminB12
                                  - DIETARY_VITAMIN_B12
                                  - HKQuantityTypeIdentifierDietaryVitaminC
                                  - DIETARY_VITAMIN_C
                                  - HKQuantityTypeIdentifierDietaryVitaminD
                                  - DIETARY_VITAMIN_D
                                  - HKQuantityTypeIdentifierDietaryVitaminE
                                  - DIETARY_VITAMIN_E
                                  - HKQuantityTypeIdentifierDietaryVitaminK
                                  - DIETARY_VITAMIN_K
                                  - HKQuantityTypeIdentifierDietaryThiamin
                                  - DIETARY_THIAMIN
                                  - HKQuantityTypeIdentifierDietaryRiboflavin
                                  - DIETARY_RIBOFLAVIN
                                  - HKQuantityTypeIdentifierDietaryNiacin
                                  - DIETARY_NIACIN
                                  - HKQuantityTypeIdentifierDietaryFolate
                                  - DIETARY_FOLATE
                                  - >-
                                    HKQuantityTypeIdentifierDietaryPantothenicAcid
                                  - DIETARY_PANTOTHENIC_ACID
                                  - HKQuantityTypeIdentifierDietaryBiotin
                                  - DIETARY_BIOTIN
                                  - HKQuantityTypeIdentifierDietaryCaffeine
                                  - DIETARY_CAFFEINE
                                  - HKQuantityTypeIdentifierDietaryWater
                                  - DIETARY_TRANS_FAT
                                  - DIETARY_ENERGY_FROM_FAT
                                  - DIETARY_UNSATURATED_FAT
                                  - DIETARY_FOLIC_ACID
                                title: SDKMetricType
                                type: string
                              - type: string
                              - type: 'null'
                            title: Type
                          startDate:
                            format: date-time
                            title: Startdate
                            type: string
                          endDate:
                            type: string
                            format: date-time
                            title: Enddate
                          zoneOffset:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Zoneoffset
                          source:
                            anyOf:
                              - description: >-
                                  Source/device information for HealthKit
                                  records.
                                properties:
                                  appId:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Appid
                                  name:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Name
                                  bundleIdentifier:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Bundleidentifier
                                  version:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Version
                                  productType:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Producttype
                                  operatingSystemVersion:
                                    anyOf:
                                      - description: >-
                                          Operating system version info from
                                          HealthKit source.
                                        properties:
                                          majorVersion:
                                            title: Majorversion
                                            type: integer
                                          minorVersion:
                                            title: Minorversion
                                            type: integer
                                          patchVersion:
                                            title: Patchversion
                                            type: integer
                                        required:
                                          - majorVersion
                                          - minorVersion
                                          - patchVersion
                                        title: OSVersion
                                        type: object
                                      - type: 'null'
                                  deviceId:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Deviceid
                                  deviceName:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicename
                                  deviceManufacturer:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicemanufacturer
                                  deviceType:
                                    anyOf:
                                      - description: Device type for HealthKit records.
                                        enum:
                                          - phone
                                          - watch
                                          - scale
                                          - ring
                                          - fitness_band
                                          - chest_strap
                                          - head_mounted
                                          - smart_display
                                          - unknown
                                        title: DeviceType
                                        type: string
                                      - type: string
                                      - type: 'null'
                                    title: Devicetype
                                  deviceModel:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicemodel
                                  deviceHardwareVersion:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicehardwareversion
                                  deviceSoftwareVersion:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicesoftwareversion
                                  recordingMethod:
                                    anyOf:
                                      - description: Recording method for HealthKit records.
                                        enum:
                                          - active
                                          - automatic
                                          - manual
                                          - unknown
                                        title: RecordingMethod
                                        type: string
                                      - type: string
                                      - type: 'null'
                                    title: Recordingmethod
                                title: SourceInfo
                                type: object
                              - type: 'null'
                          value:
                            anyOf:
                              - type: number
                              - type: string
                            title: Value
                          unit:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Unit
                          count:
                            anyOf:
                              - type: integer
                              - type: 'null'
                            description: >-
                              HKQuantitySample.count. Above 1 for a quantity
                              series, e.g. one HealthKit condensed from older
                              samples.
                            title: Count
                          metadata:
                            anyOf:
                              - items:
                                  additionalProperties: true
                                  type: object
                                type: array
                              - additionalProperties: true
                                type: object
                              - type: 'null'
                            title: Metadata
                        required:
                          - startDate
                          - endDate
                          - value
                          - unit
                        title: MetricRecord
                        type: object
                      title: Records
                      type: array
                    sleep:
                      description: Sleep phase records (in bed, awake, light, deep, REM).
                      items:
                        description: Sleep analysis record from HealthKit.
                        properties:
                          id:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Id
                          parentId:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Parentid
                          stage:
                            anyOf:
                              - enum:
                                  - in_bed
                                  - sleeping
                                  - awake
                                  - light
                                  - deep
                                  - rem
                                  - unknown
                                title: SleepPhase
                                type: string
                              - type: string
                            title: Stage
                          startDate:
                            format: date-time
                            title: Startdate
                            type: string
                          endDate:
                            type: string
                            format: date-time
                            title: Enddate
                          zoneOffset:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Zoneoffset
                          source:
                            anyOf:
                              - description: >-
                                  Source/device information for HealthKit
                                  records.
                                properties:
                                  appId:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Appid
                                  name:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Name
                                  bundleIdentifier:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Bundleidentifier
                                  version:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Version
                                  productType:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Producttype
                                  operatingSystemVersion:
                                    anyOf:
                                      - description: >-
                                          Operating system version info from
                                          HealthKit source.
                                        properties:
                                          majorVersion:
                                            title: Majorversion
                                            type: integer
                                          minorVersion:
                                            title: Minorversion
                                            type: integer
                                          patchVersion:
                                            title: Patchversion
                                            type: integer
                                        required:
                                          - majorVersion
                                          - minorVersion
                                          - patchVersion
                                        title: OSVersion
                                        type: object
                                      - type: 'null'
                                  deviceId:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Deviceid
                                  deviceName:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicename
                                  deviceManufacturer:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicemanufacturer
                                  deviceType:
                                    anyOf:
                                      - description: Device type for HealthKit records.
                                        enum:
                                          - phone
                                          - watch
                                          - scale
                                          - ring
                                          - fitness_band
                                          - chest_strap
                                          - head_mounted
                                          - smart_display
                                          - unknown
                                        title: DeviceType
                                        type: string
                                      - type: string
                                      - type: 'null'
                                    title: Devicetype
                                  deviceModel:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicemodel
                                  deviceHardwareVersion:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicehardwareversion
                                  deviceSoftwareVersion:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicesoftwareversion
                                  recordingMethod:
                                    anyOf:
                                      - description: Recording method for HealthKit records.
                                        enum:
                                          - active
                                          - automatic
                                          - manual
                                          - unknown
                                        title: RecordingMethod
                                        type: string
                                      - type: string
                                      - type: 'null'
                                    title: Recordingmethod
                                title: SourceInfo
                                type: object
                              - type: 'null'
                          values:
                            anyOf:
                              - items:
                                  additionalProperties: true
                                  type: object
                                type: array
                              - type: 'null'
                            title: Values
                          metadata:
                            anyOf:
                              - items:
                                  additionalProperties: true
                                  type: object
                                type: array
                              - additionalProperties: true
                                type: object
                              - type: 'null'
                            title: Metadata
                        required:
                          - stage
                          - startDate
                          - endDate
                        title: SleepRecord
                        type: object
                      title: Sleep
                      type: array
                    workouts:
                      description: >-
                        Exercise/workout sessions with optional statistics
                        (distance, heart rate, calories, etc.)
                      items:
                        description: Schema for workout/exercise session from HealthKit.
                        properties:
                          id:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Id
                          parentId:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Parentid
                          type:
                            anyOf:
                              - description: >-
                                  Mobile SDK workout activity types (apple,
                                  samsung, health_connect).


                                  HealthKit snake_case vocabulary plus the
                                  Health Connect vocabulary the Android SDK

                                  emits in uppercase; lookup normalizes case.
                                enum:
                                  - walking
                                  - running
                                  - cycling
                                  - wheelchair_walk
                                  - wheelchair_run
                                  - hand_cycling
                                  - elliptical
                                  - stair_climbing
                                  - stairs
                                  - jump_rope
                                  - core_training
                                  - functional_strength_training
                                  - strength_training
                                  - cross_training
                                  - mixed_cardio
                                  - hiit
                                  - step_training
                                  - fitness_gaming
                                  - preparation_and_recovery
                                  - flexibility
                                  - cooldown
                                  - barre
                                  - cardio_dance
                                  - social_dance
                                  - yoga
                                  - mind_and_body
                                  - pilates
                                  - american_football
                                  - australian_football
                                  - baseball
                                  - basketball
                                  - cricket
                                  - disc_sports
                                  - handball
                                  - hockey
                                  - lacrosse
                                  - rugby
                                  - soccer
                                  - softball
                                  - volleyball
                                  - badminton
                                  - pickleball
                                  - racquetball
                                  - squash
                                  - table_tennis
                                  - tennis
                                  - climbing
                                  - equestrian
                                  - fishing
                                  - golf
                                  - hiking
                                  - hunting
                                  - play
                                  - cross_country_skiing
                                  - curling
                                  - downhill_skiing
                                  - snow_sports
                                  - snowboarding
                                  - skating
                                  - paddle_sports
                                  - rowing
                                  - sailing
                                  - surfing
                                  - swimming
                                  - underwater_diving
                                  - water_fitness
                                  - water_polo
                                  - water_sports
                                  - boxing
                                  - kickboxing
                                  - martial_arts
                                  - tai_chi
                                  - wrestling
                                  - archery
                                  - bowling
                                  - fencing
                                  - gymnastics
                                  - track_and_field
                                  - swim_bike_run
                                  - transition
                                  - dance
                                  - dance_inspired_training
                                  - mixed_metabolic_cardio_training
                                  - cycling_stationary
                                  - boot_camp
                                  - calisthenics
                                  - dancing
                                  - exercise_class
                                  - football_american
                                  - football_australian
                                  - frisbee_disc
                                  - guided_breathing
                                  - ice_hockey
                                  - ice_skating
                                  - paddling
                                  - paragliding
                                  - rock_climbing
                                  - roller_hockey
                                  - rowing_machine
                                  - running_treadmill
                                  - scuba_diving
                                  - skiing
                                  - snowshoeing
                                  - stair_climbing_machine
                                  - stretching
                                  - swimming_open_water
                                  - swimming_pool
                                  - weightlifting
                                  - wheelchair
                                  - other
                                title: SDKWorkoutType
                                type: string
                              - type: string
                              - type: 'null'
                            title: Type
                          startDate:
                            format: date-time
                            title: Startdate
                            type: string
                          endDate:
                            type: string
                            format: date-time
                            title: Enddate
                          zoneOffset:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Zoneoffset
                          source:
                            anyOf:
                              - description: >-
                                  Source/device information for HealthKit
                                  records.
                                properties:
                                  appId:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Appid
                                  name:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Name
                                  bundleIdentifier:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Bundleidentifier
                                  version:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Version
                                  productType:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Producttype
                                  operatingSystemVersion:
                                    anyOf:
                                      - description: >-
                                          Operating system version info from
                                          HealthKit source.
                                        properties:
                                          majorVersion:
                                            title: Majorversion
                                            type: integer
                                          minorVersion:
                                            title: Minorversion
                                            type: integer
                                          patchVersion:
                                            title: Patchversion
                                            type: integer
                                        required:
                                          - majorVersion
                                          - minorVersion
                                          - patchVersion
                                        title: OSVersion
                                        type: object
                                      - type: 'null'
                                  deviceId:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Deviceid
                                  deviceName:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicename
                                  deviceManufacturer:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicemanufacturer
                                  deviceType:
                                    anyOf:
                                      - description: Device type for HealthKit records.
                                        enum:
                                          - phone
                                          - watch
                                          - scale
                                          - ring
                                          - fitness_band
                                          - chest_strap
                                          - head_mounted
                                          - smart_display
                                          - unknown
                                        title: DeviceType
                                        type: string
                                      - type: string
                                      - type: 'null'
                                    title: Devicetype
                                  deviceModel:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicemodel
                                  deviceHardwareVersion:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicehardwareversion
                                  deviceSoftwareVersion:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    title: Devicesoftwareversion
                                  recordingMethod:
                                    anyOf:
                                      - description: Recording method for HealthKit records.
                                        enum:
                                          - active
                                          - automatic
                                          - manual
                                          - unknown
                                        title: RecordingMethod
                                        type: string
                                      - type: string
                                      - type: 'null'
                                    title: Recordingmethod
                                title: SourceInfo
                                type: object
                              - type: 'null'
                          title:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Title
                          notes:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Notes
                          values:
                            anyOf:
                              - items:
                                  description: >-
                                    Schema for workout statistic (distance,
                                    heart rate, calories, etc.).
                                  properties:
                                    type:
                                      anyOf:
                                        - description: >-
                                            Apple HealthKit workout statistic types.


                                            These represent the different metrics
                                            that can be recorded during a workout
                                            session.
                                          enum:
                                            - duration
                                            - totalDuration
                                            - activeEnergyBurned
                                            - basalEnergyBurned
                                            - calories
                                            - totalCalories
                                            - distance
                                            - stepCount
                                            - swimmingStrokeCount
                                            - minHeartRate
                                            - averageHeartRate
                                            - maxHeartRate
                                            - meanHeartRate
                                            - meanSpeed
                                            - meanCadence
                                            - maxCadence
                                            - averageRunningPower
                                            - averageRunningSpeed
                                            - averageRunningStrideLength
                                            - averageVerticalOscillation
                                            - averageGroundContactTime
                                            - vo2Max
                                            - averageCyclingPower
                                            - averageCyclingCadence
                                            - averageCyclingSpeed
                                            - meanPower
                                            - maxPower
                                            - meanRpm
                                            - elevationAscended
                                            - elevationDescended
                                            - altitudeGain
                                            - altitudeLoss
                                            - maxAltitude
                                            - minAltitude
                                            - averageSpeed
                                            - maxSpeed
                                            - averageMETs
                                            - lapLength
                                            - swimmingLocationType
                                            - indoorWorkout
                                            - weatherTemperature
                                            - weatherHumidity
                                          title: WorkoutStatisticType
                                          type: string
                                        - type: string
                                      title: Type
                                    unit:
                                      type: string
                                      title: Unit
                                    value:
                                      anyOf:
                                        - type: number
                                        - type: integer
                                      title: Value
                                  required:
                                    - type
                                    - unit
                                    - value
                                  title: WorkoutStatistic
                                  type: object
                                type: array
                              - type: 'null'
                            title: Values
                          route:
                            anyOf:
                              - items:
                                  description: >-
                                    One GPS location of a workout route. Other
                                    keys (accuracy, speed, course) are ignored.
                                  properties:
                                    timestamp:
                                      anyOf:
                                        - type: string
                                          format: date-time
                                        - type: 'null'
                                      title: Timestamp
                                    latitude:
                                      anyOf:
                                        - type: number
                                        - type: 'null'
                                      title: Latitude
                                    longitude:
                                      anyOf:
                                        - type: number
                                        - type: 'null'
                                      title: Longitude
                                    altitudeM:
                                      anyOf:
                                        - type: number
                                        - type: 'null'
                                      title: Altitudem
                                  title: WorkoutRoutePoint
                                  type: object
                                type: array
                              - type: 'null'
                            title: Route
                          samples:
                            anyOf:
                              - items:
                                  description: >-
                                    One per-sample measurement recorded during a
                                    workout (heart rate, speed, cadence, power).
                                  properties:
                                    timestamp:
                                      anyOf:
                                        - type: string
                                          format: date-time
                                        - type: 'null'
                                      title: Timestamp
                                    type:
                                      anyOf:
                                        - type: string
                                        - type: 'null'
                                      title: Type
                                    value:
                                      anyOf:
                                        - type: number
                                        - type: 'null'
                                      title: Value
                                    unit:
                                      anyOf:
                                        - type: string
                                        - type: 'null'
                                      title: Unit
                                  title: WorkoutSample
                                  type: object
                                type: array
                              - type: 'null'
                            title: Samples
                          segments:
                            anyOf:
                              - items:
                                  description: >-
                                    Exercise segment of a workout (Health
                                    Connect `ExerciseSegment`).
                                  properties:
                                    type:
                                      anyOf:
                                        - type: string
                                        - type: 'null'
                                      title: Type
                                    startDate:
                                      format: date-time
                                      title: Startdate
                                      type: string
                                    endDate:
                                      type: string
                                      format: date-time
                                      title: Enddate
                                    repetitions:
                                      anyOf:
                                        - type: integer
                                        - type: 'null'
                                      title: Repetitions
                                    metadata:
                                      anyOf:
                                        - additionalProperties: true
                                          type: object
                                        - type: 'null'
                                      title: Metadata
                                  required:
                                    - startDate
                                    - endDate
                                  title: WorkoutSegment
                                  type: object
                                type: array
                              - type: 'null'
                            title: Segments
                          laps:
                            anyOf:
                              - items:
                                  description: >-
                                    HealthKit workout event (lap, segment or
                                    marker) or Health Connect lap (no `type`).
                                  properties:
                                    type:
                                      anyOf:
                                        - type: string
                                        - type: 'null'
                                      title: Type
                                    startDate:
                                      format: date-time
                                      title: Startdate
                                      type: string
                                    endDate:
                                      type: string
                                      format: date-time
                                      title: Enddate
                                    duration:
                                      anyOf:
                                        - type: number
                                        - type: 'null'
                                      title: Duration
                                    distanceM:
                                      anyOf:
                                        - type: number
                                        - type: 'null'
                                      title: Distancem
                                    strokeStyle:
                                      anyOf:
                                        - type: string
                                        - type: 'null'
                                      title: Strokestyle
                                    strokeCount:
                                      anyOf:
                                        - type: number
                                        - type: 'null'
                                      title: Strokecount
                                    swolf:
                                      anyOf:
                                        - type: number
                                        - type: 'null'
                                      title: Swolf
                                    metadata:
                                      anyOf:
                                        - additionalProperties: true
                                          type: object
                                        - type: 'null'
                                      title: Metadata
                                  required:
                                    - startDate
                                    - endDate
                                  title: WorkoutLap
                                  type: object
                                type: array
                              - type: 'null'
                            title: Laps
                          metadata:
                            anyOf:
                              - items:
                                  additionalProperties: true
                                  type: object
                                type: array
                              - additionalProperties: true
                                type: object
                              - type: 'null'
                            title: Metadata
                        required:
                          - startDate
                          - endDate
                        title: Workout
                        type: object
                      title: Workouts
                      type: array
                  title: SyncRequestData
                  type: object
              required:
                - provider
                - sdkVersion
                - syncTimestamp
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadDataResponse'
        '422':
          description: Validation Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationProblem'
        4XX:
          description: Client error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        5XX:
          description: Server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    UploadDataResponse:
      properties:
        status_code:
          type: integer
          title: Status Code
          description: HTTP status code (typically 202 for async operations)
        response:
          type: string
          title: Response
          description: Human-readable response message
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: User ID associated with the import operation
        dropped_count:
          type: integer
          title: Dropped Count
          description: Number of individual records dropped by per-record validation
          default: 0
        records_saved:
          type: integer
          title: Records Saved
          description: Time-series samples saved
          default: 0
        records_inserted:
          type: integer
          title: Records Inserted
          description: Time-series rows that did not exist before
          default: 0
        records_updated:
          type: integer
          title: Records Updated
          description: Time-series rows refreshed in place
          default: 0
        types:
          items:
            type: string
          type: array
          title: Types
          description: >-
            Canonical SeriesType identifiers written by this batch (e.g.
            'heart_rate'), sorted. Empty when the batch saved no time-series
            samples.
        workouts_saved:
          type: integer
          title: Workouts Saved
          description: Workouts saved
          default: 0
        meals_saved:
          type: integer
          title: Meals Saved
          description: Meal correlations saved
          default: 0
        sleep_saved:
          type: integer
          title: Sleep Saved
          description: Sleep records saved
          default: 0
      type: object
      required:
        - status_code
        - response
      title: UploadDataResponse
      description: >-
        Response schema for data upload/sync operations.


        Returned when health data is queued for asynchronous processing via
        Celery.

        The actual import happens in the background - this response indicates
        the task was queued successfully.
    ValidationProblem:
      description: A 422 for a request that failed validation, listing every failure.
      examples:
        - code: VALIDATION_ERROR
          detail: >-
            body.email: value is not a valid email address: An email address
            must have an @-sign. (and 1 more)
          errors:
            - loc:
                - body
                - email
              msg: >-
                value is not a valid email address: An email address must have
                an @-sign.
              type: value_error
            - loc:
                - body
                - first_name
              msg: String should have at most 100 characters
              type: string_too_long
          status: 422
          title: Unprocessable Content
      properties:
        title:
          description: HTTP status phrase
          title: Title
          type: string
        status:
          description: HTTP status code, the same as the response's
          title: Status
          type: integer
        detail:
          description: Human-readable explanation of this occurrence
          title: Detail
          type: string
        code:
          description: Machine-readable error code, stable across releases
          title: Code
          type: string
        errors:
          description: Every validation failure in the request
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
          title: Errors
          type: array
      required:
        - title
        - status
        - detail
        - code
        - errors
      title: ValidationProblem
      type: object
    Problem:
      description: >-
        An error response: RFC 9457 Problem Details, served as
        ``application/problem+json``.


        ``type`` is omitted, which per the RFC means ``about:blank``: ``title``
        is the status

        phrase, and ``code`` tells errors with the same status apart.
      examples:
        - code: NOT_FOUND
          detail: 'User with ID: 123e4567-e89b-12d3-a456-426614174000 not found.'
          status: 404
          title: Not Found
      properties:
        title:
          description: HTTP status phrase
          title: Title
          type: string
        status:
          description: HTTP status code, the same as the response's
          title: Status
          type: integer
        detail:
          description: Human-readable explanation of this occurrence
          title: Detail
          type: string
        code:
          description: Machine-readable error code, stable across releases
          title: Code
          type: string
      required:
        - title
        - status
        - detail
        - code
      title: Problem
      type: object
    ValidationErrorItem:
      properties:
        loc:
          description: Where the invalid value is, e.g. ['body', 'email']
          items:
            anyOf:
              - type: string
              - type: integer
          title: Loc
          type: array
        msg:
          description: What is wrong with it
          title: Msg
          type: string
        type:
          description: Pydantic error type, e.g. 'missing'
          title: Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationErrorItem
      type: object
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /api/v1/auth/login

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.