Import health data from SDK provider asynchronously via Celery.
Supports Apple HealthKit and Samsung Health SDK formats (identical payloads):
{
"provider": "apple",
"sdkVersion": "1.0.0",
"syncTimestamp": "2021-01-01T00:00:00Z",
"data": {
"records": [...],
"sleep": [...],
"workouts": [...]
}
}
Args: user_id: SDK user identifier body: Health data payload auth: SDK authentication (Bearer token or API key)
Returns: UploadDataResponse with 202 status and task queued message
Raises: HTTPException: 403 if token doesn’t match user_id, 400 if provider unsupported
The access token received from the authorization server in the OAuth 2.0 flow.
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 statisticsAll fields within data are optional - you can send any combination of records, sleep, and workouts.
Successful Response
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.