Skip to main content
POST
Sync Sdk Data

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

X-Open-Wearables-API-Key
string | null

Path Parameters

user_id
string
required

Body

application/json

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.

provider
string
required
sdkVersion
string
required
syncTimestamp
string<date-time>
required
syncSessionId
string | null

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

syncType
enum<string> | null

Whether this batch belongs to a historical export or to live sync.

Available options:
historical,
live
data
SyncRequestData · object

Container for health data arrays (records, sleep, workouts)

Response

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.

status_code
integer
required

HTTP status code (typically 202 for async operations)

response
string
required

Human-readable response message

user_id
string | null

User ID associated with the import operation

dropped_count
integer
default:0

Number of individual records dropped by per-record validation

records_saved
integer
default:0

Time-series samples saved

records_inserted
integer
default:0

Time-series rows that did not exist before

records_updated
integer
default:0

Time-series rows refreshed in place

types
string[]

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

workouts_saved
integer
default:0

Workouts saved

sleep_saved
integer
default:0

Sleep records saved