Skip to main content

Data format

Request body format

The POST requests made to webhook have a JSON body with the following structure:

{
"uuid": "<uuid of the user configured in SDK>",
"data": {
"steps": [
{
"value": 29836,
"source": "google_fit" or "apple_healthkit",
"end_time": 1673793698220,
"start_time": 1672994707450,
"source_device": "User's iPhone",
"manual_entry": false
}
],
"calories": [
{
"value": 112.94265772702549,
"source": "google_fit",
"end_time": 1673793698220,
"start_time": 1672994707450,
"source_device": null,
"manual_entry": false
}
],
"move_minutes": [
{
"value": 288,
"source": "google_fit",
"end_time": 1673793698220,
"start_time": 1672994707450,
"source_device": null,
"manual_entry": true
}
]
}
}

The top level of the JSON structure contains two entries:

  • uuid: The UUID of the user configured in the SDK.

  • data: A map containing the health and fitness data. Each entry in the map has a key that represents the data type name, and a value that is a list of entries.

    Each entry in the list has the following attributes:

    • source: The platform from where the data came.
    • start_time: Start time for the data, represented as a UNIX timestamp in milliseconds.
    • end_time: End time for the data, represented as a UNIX timestamp in milliseconds.
    • value: Value of that data type during the time range. The value can be an integer, float, etc. based on the data type.
    • manual_entry: A boolean value that indicates whether the data point was entered manually by the user.
    • source_device: The name of the device on which this data was captured. This attribute is only filled for Apple Healthkit data.

Platform keys

The table below shows the platforms and the keys used in the request body:

PlatformThe key used in the request body
Google Fitgoogle_fit
Apple Healthkitapple_healthkit
Fitbitfitbit
Stravastrava
Garmingarmin

Data types keys

The table below shows the fitness data types, the key used in the request body, and the data type:

Fitness DataKey used in Request BodyValue type
StepsstepsInteger
SleepsleepInteger
Move Minutesmove_minutesInteger
Distance Movedmove_distanceFloat
Calories BurnedcaloriesFloat
Calories BMRcalories_bmrFloat
WeightweightFloat
HeightheightFloat
Blood Glucoseblood_glucoseFloat
Bloood Oxygenblood_oxygenFloat
Water Consumedwater_consumedFloat

Sleep type

In addition to the value field, which represents the duration of a sleep phase, sleep data also includes a sleep_type field that indicates the type of sleep. The sleep_type field provides information about the specific sleep phase. The possible values for sleep_type are:

  • awake: Represents the awake phase during sleep.
  • light: Indicates light sleep.
  • deep: Refers to deep sleep.
  • rem: Represents the rapid eye movement (REM) sleep phase.
  • unspecified: Indicates that the sleep phase is unspecified or unknown.

By using the sleep_type field from the sleep data, you can gain insights into the different phases of a user's sleep pattern.