API Reference: Querying Data
Get Provider Record
Query a Provider Record by ID
Query a single provider record with metrics by ID.
This endpoint allows you to query for the provider record with support for:
- Including sample data based on time series in the response.
- Including provider-specific metrics in the response.
The response includes a single record with raw data from the provider transformed into the unified data model, possibly including:
- base information (start, end, duration, user time offset, input method, source provider, etc.)
- metrics (base and provider-specific)
- activity information such as activity ID, type, and tags
- activity breakdown into laps, sessions, etc. with related sample data
- sleep with sample data
All timestamps in the response are in the UTC timezone.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Query Parameters
Response
200
application/json
OK
The response is of type object
.
Previous
List Sleeps### Sleep Stages
Sleep stages represent the different phases of sleep that a person goes through during a sleep cycle. Each stage is characterized by distinct physiological and neurological patterns. Understanding these stages can provide insights into sleep quality and overall health.
The different sleep stages are:
- **awake**: The state of being fully conscious and alert.
- **sleeping**: A general term for being in a state of sleep.
- **out_of_bed**: The state when a person is not in bed, possibly indicating a brief interruption in sleep.
- **light**: A stage of sleep where the body begins to relax, and the heart rate slows down. It is easier to wake up from this stage.
- **deep**: A restorative stage of sleep where the body repairs and regrows tissues, builds bone and muscle, and strengthens the immune system.
- **rem**: Rapid Eye Movement sleep, a stage where dreaming occurs, and the brain is very active. It plays a role in memory consolidation and mood regulation.
- **awake_in_bed**: The state of being awake while still in bed, often occurring before falling asleep or after waking up.
- **nap**: A short sleep, typically taken during the day, that can help improve alertness and performance.
- **unknown**: A stage that cannot be classified into any of the known categories, possibly due to insufficient data or anomalies in the sleep pattern.
### Sleep attribution date
The sleep date attribution follows two simple rules to determine which date a sleep record should be associated with:
1. **Provider Payload Date**: The primary source of truth is the date provided in the payload from the sleep tracking provider. This date is used if available.
2. **End Date Rule**: If the provider payload date is not available, the sleep date is attributed to the day on which the sleep session ended.
This straightforward approach ensures consistent date attribution for sleep records, regardless of when the sleep session started or ended.
Next