> ## 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 https://api.openwearables.io/openapi.json post /api/v1/sdk/users/{user_id}/sync
openapi: 3.1.0
info:
  title: Open Wearables API
  version: 0.1.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
                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
                                  - 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
                                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
                              - pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
                                type: string
                            title: Value
                          unit:
                            anyOf:
                              - type: string
                              - type: 'null'
                            title: Unit
                          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: >-
                                  Apple HealthKit SDK workout activity types.


                                  These are the workout types sent from the iOS
                                  SDK in snake_case format.
                                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
                                            - 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
                          segments:
                            anyOf:
                              - items:
                                  additionalProperties: true
                                  type: object
                                type: array
                              - type: 'null'
                            title: Segments
                          laps:
                            anyOf:
                              - items:
                                  additionalProperties: true
                                  type: object
                                type: array
                              - type: 'null'
                            title: Laps
                          route:
                            anyOf:
                              - items:
                                  additionalProperties: true
                                  type: object
                                type: array
                              - type: 'null'
                            title: Route
                          samples:
                            anyOf:
                              - items:
                                  additionalProperties: true
                                  type: object
                                type: array
                              - type: 'null'
                            title: Samples
                          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/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      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
        workouts_saved:
          type: integer
          title: Workouts Saved
          description: Workouts 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.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /api/v1/auth/login

````