> For the complete documentation index, see [llms.txt](https://docs.tryterra.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tryterra.co/reference/health-and-fitness-api/data-models.md).

# Data models

> 📘 Note
>
> All fields in all models are nullable unless explicitly stated otherwise.

> 🚧 Uniquely identifying payloads
>
> #### Activity & Sleep
>
> Activity & Sleep payloads can be uniquely identified by their `summary_id` field under `metadata`. If an activity comes in a second time, with the same summary ID, you should update the previous entries with the new data corresponding to that `summary_id`
>
> #### Body, Daily, Nutrition
>
> Body, Daily, Nutrition payloads can be uniquely identified by the combination of their `start_time` and `end_time` fields under `metadata`. If one of these payloads comes in again, with the same `start_time` and `end_time`, you should update the previous entries with the new data.
>
> For example, the `Daily` payload can come in multiple times in one day, with updated `steps` field every time
>
> #### Hormone
>
> Hormone payloads can be uniquely identified by their timestamp field (at the top level of each entry, not under metadata, since Hormone has no metadata wrapper). If a hormone payload comes in again with the same timestamp, you should update the previous entry with the new data.

> 🚧 Schema parser
>
> When building a parser for the models below, please take into account that more fields may be added down the line (but no field name should ever change within a given version)
>
> Also note that this version is equivalent to `2022_03_16`

{% hint style="info" %}
Our OpenAPI models are available [here](https://github.com/tryterra/openapi/blob/master/dist/core/v2-bundled.yaml)
{% endhint %}

### TerraUser

```json
{
    "user_id": String,  // not nullable
    "provider": String,  // not nullable
    "last_webhook_update": String,
    "scopes": String,
    "reference_id": String
}
```

## Core data types

### Activity

```json
{
  // NOTE ────────────────────────────────────────────────────
  // ❶  Unless a property is explicitly documented as
  //     “required / non‑null”, **it may be `null`.**
  // ❷  Date‑time strings are ISO‑8601.
  // ❸  Top‑level keys are listed alphabetically for clarity.
  // ─────────────────────────────────────────────────────────
  "active_durations_data": {
    "activity_levels_samples": Array<ActivityLevelSample>,
    "activity_seconds": Number,
    "inactivity_seconds": Number,
    "low_intensity_seconds": Number,
    "moderate_intensity_seconds": Number,
    "num_continuous_inactive_periods": Number,
    "rest_seconds": Number,
    "standing_hours_count": Number,
    "standing_seconds": Number,
    "vigorous_intensity_seconds": Number
  },
  "calories_data": {
    "BMR_calories": Number,
    "calorie_samples": Array<CalorieSample>, 
    "net_activity_calories": Number,
    "net_intake_calories": Number,
    "total_burned_calories": Number
  },
  "cheat_detection": CheatDetection,     
  "data_enrichment": {                   
    "stress_score": Number
  },

  "device_data": {
    "activation_timestamp": String,
    "data_provided": Array<DeviceDataType>,
    "hardware_version": String,
    "last_upload_date": String,
    "manufacturer": String,
    "name": String,
    "other_devices": Array<OtherDeviceData>,
    "serial_number": String,
    "software_version": String
  },

  /* schema for each element of other_devices */
  "OtherDeviceData": {
    "activation_timestamp": String,
    "data_provided": Array<DeviceDataType>,
    "hardware_version": String,
    "last_upload_date": String,         
    "manufacturer": String,
    "name": String,
    "serial_number": String,
    "software_version": String
  },

  "distance_data": {
    "detailed": {
      "distance_samples": Array<DistanceSample>,
      "elevation_samples": Array<ElevationSample>,
      "floors_climbed_samples": Array<FloorsClimbedSample>,
      "step_samples": Array<StepSample>
    },
    "summary": {
      "distance_meters": Number,
      "elevation": {
        "avg_meters": Number,
        "gain_actual_meters": Number,
        "gain_planned_meters": Number,
        "loss_actual_meters": Number,
        "max_meters": Number,
        "min_meters": Number
      },
      "floors_climbed": Number,
      "steps": Number,
      "swimming": {
        "num_laps": Number,
        "num_strokes": Number,
        "pool_length_meters": Number
      }
    }
  },

  "energy_data": {
    "energy_kilojoules": Number,
    "energy_planned_kilojoules": Number
  },

  "heart_rate_data": {
    "detailed": {
      "hr_samples": Array<HeartRateDataSample>,
      "hrv_samples_rmssd": Array<HeartRateVariabilityDataSampleRMSSD>,
      "hrv_samples_sdnn": Array<HeartRateVariabilityDataSampleSDNN>
    },
    "summary": {
      "avg_hr_bpm": Number,
      "avg_hrv_rmssd": Number,
      "avg_hrv_sdnn": Number,
      "hr_zone_data": Array<HeartRateZoneData>,
      "max_hr_bpm": Number,
      "min_hr_bpm": Number,
      "resting_hr_bpm": Number,
      "user_max_hr_bpm": Number
    }
  },

  "lap_data": {
    "laps": Array<LapSample>
  },

  "MET_data": {
    "MET_samples": Array<METSample>,
    "avg_level": Number,
    "num_high_intensity_minutes": Number,
    "num_inactive_minutes": Number,
    "num_low_intensity_minutes": Number,
    "num_moderate_intensity_minutes": Number
  },

  "metadata": {
    "city": String,
    "country": String,
    "end_time": String,                       // required
    "name": String,                   
    "start_time": String,                     // required
    "state": String,
    "summary_id": String,                     // required
    "timestamp_localization": Number,
    "type": ActivityType,                     // required
    "upload_type": UploadType                 // required
  },

  "movement_data": {
    "adjusted_max_speed_meters_per_second": Number,   
    "avg_cadence_rpm": Number,
    "avg_pace_minutes_per_kilometer": Number,
    "avg_speed_meters_per_second": Number,
    "avg_torque_newton_meters": Number,
    "avg_velocity_meters_per_second": Number,
    "cadence_samples": Array<CadenceSample>,
    "max_cadence_rpm": Number,
    "max_pace_minutes_per_kilometer": Number,
    "max_speed_meters_per_second": Number,
    "max_torque_newton_meters": Number,
    "max_velocity_meters_per_second": Number,
    "normalized_speed_meters_per_second": Number,
    "speed_samples": Array<SpeedSample>,
    "torque_samples": Array<TorqueSample>            
  },

  "oxygen_data": {
    "avg_saturation_percentage": Number,
    "day_avg_vo2max_ml_per_min_per_kg": Number,
    "saturation_samples": Array<OxygenSaturationSample>,
    "vo2_samples": Array<Vo2MaxSample>,
    "vo2max_ml_per_min_per_kg": Number
  },

  "polyline_map_data": {
    "summary_polyline": String
  },

  "position_data": {
    "center_pos_lat_lng_deg": [Number, Number],
    "end_pos_lat_lng_deg": [Number, Number],
    "position_samples": Array<PositionSample>,
    "start_pos_lat_lng_deg": [Number, Number]
  },

  "power_data": {
    "avg_watts": Number,
    "max_watts": Number,
    "power_samples": Array<PowerSample>
  },

  "strain_data": {        
    "strain_level": Number
  },

  /* null unless the activity carries strength content — the key is always
     present. No opt-in is required. */
  "strength_data": {
    "body_weight_kg": Number,
    "exercises": Array<StrengthExercise>
  },

  "TSS_data": {
    "TSS_samples": Array<TSSSample>
  },

  "work_data": {
    "work_kilojoules": Number
  }
}
```

### StrengthExercise

An exercise is one or more `movements` plus a set of `modifiers`, not a single name from a fixed list — a paused squat is `movements: ["squat"]` with `modifiers.tempo: "paused"`. Match on `movements` to group work by pattern; read `modifiers` when the variant matters.

```json
{
  "exercise_name": String,                 // the source's own label, verbatim; may be null
  "movements": Array<StrengthMovement>,    // ordered; a clean and jerk is ["clean", "jerk"]
  "target": StrengthTarget,                // the body part a stretch or mobility drill acts on; null for ordinary lifts
  "modifiers": {
    "implement": StrengthImplement,               // barbell, dumbbell, cable, machine, …
    "surface": StrengthSurface,
    "grip_width": StrengthGripWidth,              // close, wide
    "grip_orientation": StrengthGripOrientation,
    "laterality": StrengthLaterality,             // bilateral, unilateral, alternating
    "stance": StrengthStance,
    "position": StrengthPosition,
    "bar_position": StrengthBarPosition,
    "tempo": StrengthTempo,                       // paused, explosive, isometric, …
    "rom": StrengthRangeOfMotion,                 // range of motion
    "accommodating_resistance": String,           // bands or chains added to another implement
    "assistance": String,                         // what makes it easier: machine, band, partner, balance_support
    "programme": StrengthProgramme
  },
  "primary_muscles": Array<StrengthMuscle>,   // the focus of the exercise
  "secondary_muscles": Array<StrengthMuscle>, // worked, but not the focus
  "group_id": Number,                      // shared by exercises in the same superset/circuit; null otherwise
  "notes": String,
  "rpe": Number,                           // 0-10; set when the source records effort once per exercise rather than per set
  "source": StrengthSource,
  "sets": Array<StrengthSet>
}
```

An exercise with an empty `sets` array is one the user put in the workout and recorded nothing against — it happened, the per-set detail did not. `sets` is `[]` in that case, never `null`.

An unset modifier arrives as `null` and means **the source did not report that axis** — not that the exercise was bilateral, or barbell, or full range. `movements` and the muscle arrays are `null` rather than `[]` when unresolved, so null-check before iterating. `modifiers` itself is `null` when the source reports no axis at all.

`movements` is empty when the exercise could not be resolved — most often a coach-written or user-created exercise the source names but does not classify. `exercise_name` still carries the source's label, so display keeps working even when matching does not:

```json
{ "exercise_name": "Leg Press mit beiden Beinen", "movements": null,
  "modifiers": null, "sets": [ { "reps": 12, "weight_kg": 120, "load_type": "external" } ] }
```

`exercise_name` is passed through verbatim and its shape follows the source. A training app sends what the user sees (`Close Grip Bench Press`); a wearable sends its own catalogue key (`triceps_pressdown`). Never parse it — use `movements` and `modifiers` for logic and `exercise_name` for display.

`source`, `set_type`, `load_type` and the muscle arrays fall back to `unknown` rather than being omitted when the source reported something that could not be resolved.

`primary_muscles` is the focus of the exercise and `secondary_muscles` the work it also involves. They are kept apart because merging them would say a bench press trained chest and triceps equally. How specific they are varies by source.

Two shapes to allow for:

* A whole-body lift — an olympic lift, a loaded carry, a burpee — reports **every muscle it works as primary, with `secondary_muscles` empty**, because no single muscle is the focus.
* An exercise can report **secondary muscles with no primary**. Code that iterates `primary_muscles` alone will miss that work.

### StrengthSet

```json
{
  "set_type": StrengthSetType,
  "reps": Number,                  // per side for unilateral movements
  "weight_kg": Number,             // read together with load_type; as the source logged it —
                                   // a barbell's total, or one dumbbell. Never negative.
  "load_type": StrengthLoadType,   // always present
  "rpe": Number,                   // 0-10 rate of perceived exertion
  "rir": Number,                   // reps in reserve; never converted to or from rpe
  "duration_seconds": Number,      // timed holds and carries
  "distance_meters": Number,       // loaded carries
  "notes": String,
  "rest_after_seconds": Number,    // rest after this set, within its exercise;
                                   // rest between exercises is not represented
  "start_time": String,            // ISO 8601; null when the source does not timestamp sets
  "end_time": String
}
```

{% hint style="warning" %}
**`weight_kg` is meaningless without `load_type`.** Only `external` means the weight is load added to an otherwise unloaded body. Summing `weight_kg × reps` across all sets overstates volume, because it counts bodyweight and assistance as if they were added plates.

Test **for** `external` rather than against the other values — a load type you don't recognise must be treated as unknown, not as external.
{% endhint %}

### Athlete

```json
{
    "age": Number,
    "country": String,
    "bio": String,
    "state": String,
    "last_name": String,
    "sex": String,
    "city": String,
    "email": String,
    "date_of_birth": String,
    "first_name": String,
    "gender": String,
    "joined_provider": String,
    "devices": Array<device_data>
}
```

### Body

```json
{
  "blood_pressure_data": {
    "blood_pressure_samples": Array<BloodPressureSample>,
    "day_avg_systolic_bp": Number,
    "day_avg_diastolic_bp": Number
  },
  "device_data": {
    "activation_timestamp": String,
    "hardware_version": String,
    "software_version": String,
    "serial_number": String,
    "manufacturer": String,
    "name": String,
    "sensor_state": String,
    "other_devices": Array<OtherDeviceData>,
    "data_provided": Array<DeviceDataType>,
    "last_upload_date": String
  },
  "heart_data": {
    "afib_classification_samples": Array<AFibClassificationSample>,
    "ecg_signal": Array<ECGReading>,
    "heart_rate_data": {
      "detailed": {
        "hr_samples": Array<HeartRateDataSample>,
        "hrv_samples_rmssd": Array<HeartRateVariabilityDataSampleRMSSD>,
        "hrv_samples_sdnn": Array<HeartRateVariabilityDataSampleSDNN>
      },
      "summary": {
        "avg_hr_bpm": Number,
        "avg_hrv_rmssd": Number,
        "avg_hrv_sdnn": Number,
        "hr_zone_data": Array<HeartRateZoneData>,
        "max_hr_bpm": Number,
        "min_hr_bpm": Number,
        "resting_hr_bpm": Number,
        "user_max_hr_bpm": Number
      }
    },
    "pulse_wave_velocity_samples": Array<PulseVelocitySample>,
    "rr_interval_samples": Array<RRInterval>
  },
  "hydration_data": {
    "day_total_water_consumption_ml": Number,
    "hydration_amount_samples": Array<HydrationAmountSample>,
    "day_avg_hydration_kg": Number
  },

  "ketone_data": {
    "ketone_samples": Array<KetoneSample>,
    "day_avg_ketone_mg_per_dL": Number
  },
  "measurements_data": {
    "measurements": Array<MeasurementDataSample>,
    "day_avg_bmi": Number,
    "day_avg_bmr": Number,
    "day_avg_rmr": Number,
    "day_avg_estimated_fitness_age": Number,
    "day_avg_skin_fold_mm": Number,
    "day_avg_bodyfat_percentage": Number,
    "day_avg_weight_kg": Number,
    "day_avg_height_cm": Number,
    "day_avg_bone_mass_g": Number,
    "day_avg_muscle_mass_g": Number,
    "day_avg_lean_mass_g": Number,
    "day_avg_water_percentage": Number,
    "day_avg_insulin_units": Number,
    "day_avg_visceral_fat_level": Number
  },
  "metadata": {
    "start_time": String,               // required (ISO-8601)
    "end_time": String,                 // required (ISO-8601)
    "timestamp_localization": Number    // 0 = UTC, 1 = local-time, etc.
  },
  "oxygen_data": {
    "avg_saturation_percentage": Number,
    "day_avg_vo2max_ml_per_min_per_kg": Number,
    "saturation_samples": Array<OxygenSaturationSample>,
    "vo2_samples": Array<Vo2MaxSample>,
    "vo2max_ml_per_min_per_kg": Number
  },
  "temperature_data": {
    "ambient_temperature_samples": Array<TemperatureSample>,
    "body_temperature_samples": Array<TemperatureSample>,
    "day_avg_ambient_temperature_celsius": Number,
    "day_avg_body_temperature_celsius": Number,
    "day_avg_skin_temperature_celsius": Number,
    "skin_temperature_samples": Array<TemperatureSample>
  },
  "glucose_data": {
    "blood_glucose_samples": Array<GlucoseDataSample>,
    "detailed_blood_glucose_samples": Array<GlucoseDataSample>,
    "daily_patterns": Array<DailyPatternSample>,
    "sensor_usage": Number,
    "day_avg_blood_glucose_mg_per_dL": Number,
    "day_avg_detailed_blood_glucose_mg_per_dL": Number,
    "time_in_range": Number,
    "gmi": Number
  }
}
```

### Daily

```json
{
  "active_durations_data": {
    "activity_levels_samples": Array<ActivityLevelSample>,
    "activity_seconds": Number,
    "inactivity_seconds": Number,
    "low_intensity_seconds": Number,
    "moderate_intensity_seconds": Number,
    "num_continuous_inactive_periods": Number,
    "rest_seconds": Number,
    "standing_hours_count": Number,
    "standing_seconds": Number,
    "vigorous_intensity_seconds": Number
  },
  "calories_data": {
    "BMR_calories": Number,
    "calorie_samples": Array<CalorieSample>,
    "net_activity_calories": Number,
    "net_intake_calories": Number,
    "total_burned_calories": Number
  },
  "data_enrichment": {
    "cardiovascular_contributors": Array<DataContributor>,
    "cardiovascular_score": Number,
    "immune_contributors": Array<DataContributor>,
    "immune_index": Number,
    "readiness_contributors": Array<DataContributor>,
    "readiness_score": Number,
    "respiratory_contributors": Array<DataContributor>,
    "respiratory_score": Number,
    "start_time": String,
    "stress_contributors": Array<DataContributor>,
    "total_stress_score": Number
  },
  "device_data": {
    "activation_timestamp": String,
    "data_provided": Array<DeviceDataType>,
    "hardware_version": String,
    "last_upload_date": String,
    "manufacturer": String,
    "name": String,
    "other_devices": Array<OtherDeviceData>,
    "serial_number": String,
    "software_version": String
  },
  "distance_data": {
    "detailed": {
      "distance_samples": Array<DistanceSample>,
      "elevation_samples": Array<ElevationSample>,
      "floors_climbed_samples": Array<FloorsClimbedSample>,
      "step_samples": Array<StepSample>
    },
    "distance_meters": Number,
    "elevation": {
      "avg_meters": Number,
      "gain_actual_meters": Number,
      "gain_planned_meters": Number,
      "loss_actual_meters": Number,
      "max_meters": Number,
      "min_meters": Number
    },
    "floors_climbed": Number,
    "steps": Number,
    "swimming": {
      "num_laps": Number,
      "num_strokes": Number,
      "pool_length_meters": Number
    }
  },
  "heart_rate_data": {
    "detailed": {
      "hr_samples": Array<HeartRateDataSample>,
      "hrv_samples_rmssd": Array<HeartRateVariabilityDataSampleRMSSD>,
      "hrv_samples_sdnn": Array<HeartRateVariabilityDataSampleSDNN>
    },
    "summary": {
      "avg_hr_bpm": Number,
      "avg_hrv_rmssd": Number,
      "avg_hrv_sdnn": Number,
      "hr_zone_data": Array<HeartRateZoneData>,
      "max_hr_bpm": Number,
      "min_hr_bpm": Number,
      "resting_hr_bpm": Number,
      "user_max_hr_bpm": Number
    }
  },
  "MET_data": {
    "MET_samples": Array<METSample>,
    "avg_level": Number,
    "num_high_intensity_minutes": Number,
    "num_inactive_minutes": Number,
    "num_low_intensity_minutes": Number,
    "num_moderate_intensity_minutes": Number
  },
  "metadata": {
    "end_time": String,          // required
    "start_time": String,        // required
    "timestamp_localization": Number,
    "upload_type": UploadType    // required
  },
  "oxygen_data": {
    "avg_saturation_percentage": Number,
    "day_avg_vo2max_ml_per_min_per_kg": Number,
    "saturation_samples": Array<OxygenSaturationSample>,
    "vo2_samples": Array<Vo2MaxSample>,
    "vo2max_ml_per_min_per_kg": Number
  },
  "scores": {
    "activity": Number,
    "recovery": Number,
    "sleep": Number
  },
  "strain_data": {
    "strain_level": Number
  },
  "stress_data": {
    "activity_stress_duration_seconds": Number,
    "avg_stress_level": Number,
    "body_battery_samples": Array<BodyBatterySample>,
    "high_stress_duration_seconds": Number,
    "low_stress_duration_seconds": Number,
    "max_stress_level": Number,
    "medium_stress_duration_seconds": Number,
    "rest_stress_duration_seconds": Number,
    "samples": Array<StressSample>,
    "stress_duration_seconds": Number,
    "stress_rating": Number
  },
  "tag_data": {
    "tags": Array<TagEntry>
  }
}
```

### Hormone

```json
{
  "timestamp": String,        // required, ISO-8601 with timezone offset
  "lh_mIU_per_ml": Number,    // luteinizing hormone, mIU/ml
  "e3g_ng_per_ml": Number,    // estrone-3-glucuronide, ng/ml
  "pdg_ug_per_ml": Number,    // pregnanediol glucuronide, ug/ml
  "hcg_mIU_per_ml": Number,   // human chorionic gonadotropin, mIU/ml
  "fsh_mIU_per_ml": Number    // follicle-stimulating hormone, mIU/ml
}
```

### Menstruation

```json
{
    "metadata": {
        "end_time": String,
        "start_time": String,
        "timestamp_localization": Number
    },
    "menstruation_data": {
        "menstruation_flow": Array<MenstruationFlowSample>,
        "intervals": Array<MenstruationIntervalSample>,
        "period_length_days": Number,
        "fertility_window_start": String,
        "fertility_window_end": String,
        "predicted_cycle_length_days": Number,
        "last_updated_time": String,
        "day_in_cycle": Number,
        "length_of_current_phase_days": Number,
        "period_start_date": String,
        "cycle_length_days": Number,
        "ovulation_day": String,
        "current_phase": MenstruationInterval,
        "is_predicted_cycle": Boolean,
        "days_until_next_phase": Number
    }
}
```

### Nutrition

```json
{
  "drink_samples": Array<DrinkSample>,
  "meals": Array<Meal>,
  "metadata": {
    "end_time": String,               // required – ISO‑8601
    "start_time": String,             // required – ISO‑8601
    "timestamp_localization": Number
  },
  "summary": {
    "macros": {
      "alcohol_g": Number,
      "calories": Number,
      "carbohydrates_g": Number,
      "cholesterol_mg": Number,
      "fat_g": Number,
      "fiber_g": Number,
      "net_carbohydrates_g": Number,
      "protein_g": Number,
      "saturated_fat_g": Number,
      "sodium_mg": Number,
      "sugar_g": Number,
      "trans_fat_g": Number
    },
    "micros": {
      "biotin_mg": Number,
      "caffeine_mg": Number,
      "calcium_mg": Number,
      "chloride_mg": Number,
      "chromium_mg": Number,
      "copper_mg": Number,
      "folate_mg": Number,
      "folic_acid_mg": Number,
      "iodine_mg": Number,
      "iron_mg": Number,
      "magnesium_mg": Number,
      "manganese_mg": Number,
      "molybdenum_mg": Number,
      "niacin_mg": Number,
      "pantothenic_acid_mg": Number,
      "phosphorus_mg": Number,
      "potassium_mg": Number,
      "riboflavin_mg": Number,
      "selenium_mg": Number,
      "thiamin_mg": Number,
      "vitamin_A_mg": Number,
      "vitamin_B12_mg": Number,
      "vitamin_B6_mg": Number,
      "vitamin_C_mg": Number,
      "vitamin_D_mg": Number,
      "vitamin_D2_mg": Number,
      "vitamin_D3_mg": Number,
      "vitamin_E_mg": Number,
      "vitamin_K_mg": Number,
      "zinc_mg": Number,

      /* amino‑acids & related */
      "cystine_g": Number,
      "histidine_g": Number,
      "isoleucine_g": Number,
      "leucine_g": Number,
      "lysine_g": Number,
      "methionine_g": Number,
      "phenylalanine_g": Number,
      "threonine_g": Number,
      "tryptophan_g": Number,
      "tyrosine_g": Number,
      "valine_g": Number,

      /* fats & fatty‑acids */
      "monounsaturated_fat_g": Number,
      "polyunsaturated_fat_g": Number,
      "omega3_g": Number,
      "omega6_g": Number,

      /* carbohydrates */
      "starch_g": Number
    },
    "water_ml": Number,
    "drink_ml": Number
  }
}
```

### Sleep

```json
{
  "data_enrichment": {
    "sleep_contributors": Array<DataContributor>,
    "sleep_score": Number
  },

  "device_data": {
    "activation_timestamp": String,
    "data_provided": Array<DeviceDataType>,
    "hardware_version": String,
    "last_upload_date": String,
    "manufacturer": String,
    "name": String,
    "other_devices": Array<OtherDeviceData>,
    "serial_number": String,
    "software_version": String
  },

  "heart_rate_data": {
    "detailed": {
      "hr_samples": Array<HeartRateDataSample>,
      "hrv_samples_rmssd": Array<HeartRateVariabilityDataSampleRMSSD>,
      "hrv_samples_sdnn": Array<HeartRateVariabilityDataSampleSDNN>
    },
    "summary": {
      "avg_hr_bpm": Number,
      "avg_hrv_rmssd": Number,
      "avg_hrv_sdnn": Number,
      "hr_zone_data": Array<HeartRateZoneData>,
      "max_hr_bpm": Number,
      "min_hr_bpm": Number,
      "resting_hr_bpm": Number,
      "user_max_hr_bpm": Number
    }
  },

  "metadata": {
    "end_time": String,                 // required – ISO‑8601
    "start_time": String,               // required – ISO‑8601
    "is_nap": Boolean,
    "summary_id": String,
    "timestamp_localization": Number,
    "upload_type": SleepUploadType      // required
  },

  "readiness_data": {
    "readiness": Number,
    "recovery_level": RecoveryLevel
  },

  "respiration_data": {
    "breaths_data": {
      "avg_breaths_per_min": Number,
      "end_time": String,
      "max_breaths_per_min": Number,
      "min_breaths_per_min": Number,
      "on_demand_reading": Boolean,
      "samples": Array<BreathSample>,
      "start_time": String
    },
    "oxygen_saturation_data": {
      "avg_saturation_percentage": Number,
      "end_time": String,
      "samples": Array<OxygenSaturationSample>,
      "start_time": String
    },
    "snoring_data": {
      "end_time": String,
      "num_snoring_events": Number,
      "samples": Array<SnoringSample>,
      "start_time": String,
      "total_snoring_duration_seconds": Number
    }
  },

  "scores": {
    "sleep": Number
  },

  "sleep_durations_data": {
    "asleep": {
      "duration_asleep_state_seconds": Number,
      "duration_deep_sleep_state_seconds": Number,
      "duration_light_sleep_state_seconds": Number,
      "duration_REM_sleep_state_seconds": Number,
      "num_REM_events": Number
    },
    "awake": {
      "duration_awake_state_seconds": Number,
      "duration_long_interruption_seconds": Number,
      "duration_short_interruption_seconds": Number,
      "num_out_of_bed_events": Number,
      "num_wakeup_events": Number,
      "sleep_latency_seconds": Number,
      "wake_up_latency_seconds": Number
    },
    "hypnogram_samples": Array<SleepHypnogramSample>,
    "other": {
      "duration_in_bed_seconds": Number,
      "duration_unmeasurable_sleep_seconds": Number
    },
    "sleep_efficiency": Number
  },

  "temperature_data": {
    "delta": Number
  }
}
```

## Enums

### DeviceDataType

Represents data types that a certain device contributed to

| Name                      | Value              |
| ------------------------- | ------------------ |
| Steps                     | STEPS              |
| Active minutes            | ACTIVE\_MINUTES    |
| BMR                       | BMR                |
| Calories                  | CALORIES           |
| Distance                  | DISTANCE           |
| Heart Rate                | HEART\_RATE        |
| Oxygen Saturation (SpO2)  | OXYGEN\_SATURATION |
| Sleep type classification | SLEEP\_TYPE        |
| Speed                     | SPEED              |
| Cadence                   | CADENCE            |

### AFibFlag

| Name                        | Value |
| --------------------------- | ----- |
| Negative (AFib not present) | 0     |
| Positive (AFib present)     | 1     |
| Inconclusive                | 2     |

### VisceralFatCategory

Health-risk classification derived from `visceral_fat_level` using provider-specific thresholds. Null when thresholds are not available for the provider.

| Name      | Value      |
| --------- | ---------- |
| Normal    | normal     |
| High      | high       |
| Very High | very\_high |

### ActivityType

| Name                    | Value |
| ----------------------- | ----- |
| In Vehicle              | 0     |
| Biking                  | 1     |
| Still                   | 3     |
| Unknown                 | 4     |
| Tilting                 | 5     |
| Walking                 | 7     |
| Running                 | 8     |
| Aerobics                | 9     |
| Badminton               | 10    |
| Baseball                | 11    |
| Basketball              | 12    |
| Biathlon                | 13    |
| Handbiking              | 14    |
| Mountain Biking         | 15    |
| Road Biking             | 16    |
| Spinning                | 17    |
| Stationary Biking       | 18    |
| Utility Biking          | 19    |
| Boxing                  | 20    |
| Calisthenics            | 21    |
| Circuit Training        | 22    |
| Cricket                 | 23    |
| Dancing                 | 24    |
| Elliptical              | 25    |
| Fencing                 | 26    |
| American Football       | 27    |
| Australian Football     | 28    |
| English Football        | 29    |
| Frisbee                 | 30    |
| Gardening               | 31    |
| Golf                    | 32    |
| Gymnastics              | 33    |
| Handball                | 34    |
| Hiking                  | 35    |
| Hockey                  | 36    |
| Horseback Riding        | 37    |
| Housework               | 38    |
| Jumping Rope            | 39    |
| Kayaking                | 40    |
| Kettlebell Training     | 41    |
| Kickboxing              | 42    |
| Kitesurfing             | 43    |
| Martial Arts            | 44    |
| Meditation              | 45    |
| Mixed Martial Arts      | 46    |
| P90X Exercises          | 47    |
| Paragliding             | 48    |
| Pilates                 | 49    |
| Polo                    | 50    |
| Racquetball             | 51    |
| Rock Climbing           | 52    |
| Rowing                  | 53    |
| Rowing Machine          | 54    |
| Rugby                   | 55    |
| Jogging                 | 56    |
| Running On Sand         | 57    |
| Treadmill Running       | 58    |
| Sailing                 | 59    |
| Scuba Diving            | 60    |
| Skateboarding           | 61    |
| Skating                 | 62    |
| Cross Skating           | 63    |
| Indoor Rollerblading    | 64    |
| Skiing                  | 65    |
| Back Country Skiing     | 66    |
| Cross Country Skiing    | 67    |
| Downhill Skiing         | 68    |
| Kite Skiing             | 69    |
| Roller Skiing           | 70    |
| Sledding                | 71    |
| Snowboarding            | 73    |
| Snowmobile              | 74    |
| Snowshoeing             | 75    |
| Squash                  | 76    |
| Stair Climbing          | 77    |
| Stair Climbing Machine  | 78    |
| Stand Up Paddleboarding | 79    |
| Strength Training       | 80    |
| Surfing                 | 81    |
| Swimming                | 82    |
| Swimming In Pool        | 83    |
| Open Water Swimming     | 84    |
| Table Tennis            | 85    |
| Team Sport              | 86    |
| Tennis                  | 87    |
| Treadmill               | 88    |
| Volleyball              | 89    |
| Beach Volleyball        | 90    |
| Indoor Volleyball       | 91    |
| Wakeboarding            | 92    |
| Walking Fitness         | 93    |
| Nording Walking         | 94    |
| Walking Treadmill       | 95    |
| Waterpolo               | 96    |
| Weightlifting           | 97    |
| Wheelchair              | 98    |
| Windsurfing             | 99    |
| Yoga                    | 100   |
| Zumba                   | 101   |
| Diving                  | 102   |
| Ergometer               | 103   |
| Ice Skating             | 104   |
| Indoor Skating          | 105   |
| Curling                 | 106   |
| Other                   | 108   |
| Crossfit                | 113   |
| HIIT                    | 114   |
| Interval Training       | 115   |
| Walkin Stroller         | 116   |
| Elevator                | 117   |
| Escalator               | 118   |
| Archery                 | 119   |
| Softball                | 120   |
| Guided Breathing        | 122   |
| Cardio Training         | 123   |
| Lacrosse                | 124   |
| Stretching              | 125   |
| Triathlon               | 126   |
| INLINE\_SKATING         | 127   |
| SKY\_DIVING             | 128   |
| PADDLING                | 129   |
| MOUNTAINEERING          | 130   |
| FISHING                 | 131   |
| WATER\_SKIING           | 132   |
| INDOOR\_RUNNING         | 133   |
| PADEL\_TENNIS           | 134   |
| DRIVING                 | 135   |
| OFF\_ROAD\_DRIVING      | 136   |
| MOTORBIKING             | 137   |
| MOTOR\_RACING           | 138   |
| ENDURO                  | 139   |
| CANOEING                | 140   |
| ORIENTEERING            | 141   |
| HANG\_GLIDING           | 142   |
| FLYING                  | 143   |
| HOT\_AIR\_BALLOONING    | 144   |
| JET\_SKIING             | 145   |
| POWER\_BOATING          | 146   |
| GAELIC\_FOOTBALL        | 147   |
| HURLING                 | 148   |
| TRAIL\_RUNNING          | 149   |
| GRAVEL\_CYCLING         | 150   |
| MULTISPORT              | 151   |
| E-BIKING                | 152   |
| E MOUNTAIN BIKING       | 153   |
| PHYSICAL\_THERAPY       | 154   |

### ActivityLevel

| Name             | Value |
| ---------------- | ----- |
| Unknown          | 0     |
| Rest             | 1     |
| Inactive         | 2     |
| Low Intensity    | 3     |
| Medium Intensity | 4     |
| High Intensity   | 5     |

### HeartRateZone

| Name                        | Value |
| --------------------------- | ----- |
| Zone 0                      | 0     |
| Zone 1                      | 1     |
| Zone 2                      | 2     |
| Zone 3                      | 3     |
| Zone 4                      | 4     |
| Zone 5                      | 5     |
| Other/custom classification | 6     |

### SleepLevel

| Name       | Value |
| ---------- | ----- |
| Unknown    | 0     |
| Awake      | 1     |
| Sleeping   | 2     |
| Out of Bed | 3     |
| Light      | 4     |
| Deep       | 5     |
| REM        | 6     |

### StrengthSetType

| Value      | Meaning                                                                                                       |
| ---------- | ------------------------------------------------------------------------------------------------------------- |
| `normal`   | A working set                                                                                                 |
| `warmup`   | Warm-up set                                                                                                   |
| `cooldown` | Cool-down set                                                                                                 |
| `dropset`  | Weight reduced mid-exercise to continue past failure                                                          |
| `failure`  | Taken to failure                                                                                              |
| `amrap`    | As many reps as possible                                                                                      |
| `unknown`  | The source reported something Terra could not resolve — distinct from `null`, which means it reported nothing |

### StrengthLoadType

| Value             | `weight_kg` means                                                                                          | Counts as added load       |
| ----------------- | ---------------------------------------------------------------------------------------------------------- | -------------------------- |
| `external`        | Load added to the body (plates, dumbbells, the stack)                                                      | Yes                        |
| `bodyweight`      | No external load; body mass only                                                                           | No                         |
| `bodyweight_plus` | The **extra** load only (e.g. a weighted-pull-up belt) — add `strength_data.body_weight_kg` for total load | Excluded by the rule above |
| `assisted`        | Load **removed** to make the movement easier                                                               | No                         |
| `unknown`         | Unclassified                                                                                               | Treat as no                |

### StrengthSource

| Value             | Meaning                                                                                                                                                                                                                                    |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `user_logged`     | The user recorded the exercise themselves. Reps and load are what they entered.                                                                                                                                                            |
| `device_detected` | A wearable inferred the exercise from motion. Treat reps and the exercise itself as estimates, and expect `weight_kg` to be `null` more often — the device does not measure load, so it is present only when the user added it afterwards. |
| `unknown`         | The source reported something Terra could not resolve — distinct from `null`, which means it reported nothing                                                                                                                              |

{% hint style="info" %}
**Every strength vocabulary is an open enum.** Each publishes `unknown` alongside the members listed below, and new members are added as sources are onboarded. Handle a value you don't recognise as unknown rather than switching exhaustively — a new member is not a breaking change, and rejecting one is a bug in your integration.

`StrengthMuscle` needs one extra thought: a new member there can shift a per-muscle total even though it never breaks parsing. See [StrengthMuscle](#strengthmuscle).

The lists below are the membership as published. The machine-readable version, always current, is in the [OpenAPI spec](/reference/health-and-fitness-api/openapi-spec.md).
{% endhint %}

### Modifier vocabularies

Every axis of `modifiers`. `accommodating_resistance` and `assistance` are also open vocabularies but publish no fixed member list — `assistance` names what makes the movement easier (`machine`, `band`, `partner`, `balance_support`), `accommodating_resistance` names bands or chains added to another implement.

| Axis               | Meaning                                                                                                           | Values                                                                                                                                                                                                                                                                                                      |
| ------------------ | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `implement`        | What provides the load                                                                                            | `band`, `barbell`, `battle_rope`, `belt`, `bodyweight`, `cable`, `dumbbell`, `ez_bar`, `handle_band`, `kettlebell`, `landmine`, `loop_band`, `machine`, `machine_assisted`, `medicine_ball`, `mini_band`, `partner`, `pvc`, `safety_bar`, `sled`, `smith_machine`, `suspension`, `trap_bar`, `weight_plate` |
| `surface`          | What the body is supported on, when it is not the floor                                                           | `bench`, `bosu`, `box`, `floor`, `foam_roller`, `glute_ham_machine`, `preacher_bench`, `swiss_ball`, `treadmill`, `wall`                                                                                                                                                                                    |
| `grip_width`       | How far apart the hands are                                                                                       | `close`, `wide`                                                                                                                                                                                                                                                                                             |
| `grip_orientation` | Which way the hands face                                                                                          | `bottoms_up`, `mixed`, `neutral`, `overhand`, `pinch`, `reverse`, `underhand`                                                                                                                                                                                                                               |
| `laterality`       | Whether both limbs work together, alternately, or one at a time                                                   | `alternating`, `bilateral`, `unilateral`                                                                                                                                                                                                                                                                    |
| `stance`           | Foot arrangement                                                                                                  | `crossover`, `curtsy`, `split`, `sumo`                                                                                                                                                                                                                                                                      |
| `position`         | Orientation of the body or bench                                                                                  | `bent_over`, `decline`, `elevated`, `flat`, `forearm`, `half_kneeling`, `hanging`, `incline`, `inverted`, `kneeling`, `lying`, `pike`, `prone`, `quadruped`, `seated`, `side_lying`, `standing`, `supine`                                                                                                   |
| `bar_position`     | Where the implement is carried                                                                                    | `behind_back`, `behind_neck`, `front_rack`, `goblet`, `overhead`, `zercher`                                                                                                                                                                                                                                 |
| `tempo`            | How the repetition is paced                                                                                       | `eccentric`, `explosive`, `isometric`, `kipping`, `paused`, `pulse`, `tempo_slow`                                                                                                                                                                                                                           |
| `rom`              | How much of the movement is performed, or where it starts                                                         | `deficit`, `from_blocks`, `from_hang`, `full`, `partial`, `to_bench`                                                                                                                                                                                                                                        |
| `programme`        | A programme or population the variant belongs to. Descriptive only — it changes neither the movement nor the load | `pregnancy`                                                                                                                                                                                                                                                                                                 |

### StrengthMuscle

Used by `primary_muscles` and `secondary_muscles`. Members are training groups, not anatomy: a source naming a specific head — pectoralis major sternal, gluteus medius, brachialis, soleus — reports the group it belongs to, so the same exercise groups the same way whichever app recorded it.

`abductors`, `abs`, `adductors`, `back`, `biceps`, `calves`, `chest`, `forearms`, `glutes`, `hamstrings`, `hip_flexor`, `lat`, `lower_back`, `neck`, `obliques`, `quadriceps`, `serratus`, `shoulders`, `tibialis`, `trapezius`, `triceps`, `upper_back`

{% hint style="warning" %}
**Members are added over time, and a new one changes the total of the member it is most closely related to.** If you aggregate per muscle, plan for that.

Some members are parts of a broader one and can be summed with it for a coarse view that stays stable: `lat` + `upper_back` + `back` covers the whole back, and `obliques` + `abs` the whole midsection.

Others are their own group and should not be folded into a neighbour — `serratus` is not part of the chest, `tibialis` is not part of the calves, and `hip_flexor` is not part of the quadriceps.
{% endhint %}

### StrengthTarget

The body part a stretch or mobility drill acts on. Reported separately from the muscles worked because for a stretch the body part *is* the exercise. `null` for ordinary lifts.

`abs`, `adductors`, `ankle`, `back`, `biceps`, `calves`, `chest`, `forearms`, `glutes`, `hamstrings`, `hip`, `hip_abductor`, `hip_adductor`, `hip_flexor`, `lat`, `lower_back`, `neck`, `obliques`, `quadriceps`, `shoulders`, `spine`, `thoracic_spine`, `triceps`, `upper_back`

### StrengthMovement

The joint actions an exercise performs, and the axis to match on. `movements` is an array because one exercise can chain several — a clean and jerk is `["clean", "jerk"]` — so **test membership, not equality**: it belongs in both clean volume and jerk volume.

174 members:

`ab_rollout`, `arm_circle`, `around_the_world`, `back_extension`, `battle_rope_slam`, `battle_rope_wave`, `bear_crawl`, `bicep_curl`, `bicycle_crunch`, `bike`, `bird_dog`, `body_saw`, `bound`, `box_jump`, `broad_jump`, `burpee`, `butt_kick`, `butt_scoot`, `calf_raise`, `carioca`, `carry`, `chest_fly`, `chest_press`, `chin_up`, `clamshell`, `clean`, `clean_pull`, `climb`, `complex`, `cossack_squat`, `crunch`, `dead_bug`, `deadlift`, `depth_jump`, `diaphragmatic_breathing`, `dip`, `duck_walk`, `elliptical`, `face_pull`, `farmers_carry`, `fire_hydrant`, `flutter_kick`, `foam_roll`, `frog_kick`, `front_raise`, `glute_bridge`, `glute_ham_raise`, `good_morning`, `halo`, `hand_walk`, `handstand_hold`, `handstand_push_up`, `handstand_walk`, `heel_slide`, `heel_touch`, `high_knee`, `high_pull`, `hike`, `hip_abduction`, `hip_adduction`, `hip_circle`, `hip_drop`, `hip_extension`, `hip_flexion`, `hip_hinge`, `hip_thrust`, `hold`, `hollow_hold`, `hop`, `i_raise`, `inchworm`, `jerk`, `jump`, `jump_rope`, `jumping_jack`, `kick`, `knee_raise`, `kneel_to_stand`, `l_sit`, `lat_pulldown`, `lateral_raise`, `lateral_walk`, `leg_circle`, `leg_curl`, `leg_cycle`, `leg_extension`, `leg_press`, `leg_raise`, `leg_swing`, `lunge`, `march`, `monster_walk`, `mountain_climber`, `muscle_up`, `neck_extension`, `neck_flexion`, `neck_lateral_flexion`, `oblique_crunch`, `overhead_press`, `pallof_press`, `pike_up`, `plank`, `plate_flip`, `plate_pinch`, `pull_apart`, `pull_through`, `pull_up`, `pullover`, `punch`, `push_press`, `push_up`, `rear_delt_fly`, `reverse_crunch`, `reverse_hyperextension`, `romanian_deadlift`, `rope_climb`, `row`, `row_erg`, `run`, `russian_twist`, `scapular_pull_up`, `scapular_push_up`, `scapular_retraction`, `scissor_kick`, `shoulder_external_rotation`, `shoulder_internal_rotation`, `shrug`, `shuffle`, `sissy_squat`, `sit_up`, `ski_erg`, `skip`, `slam`, `sled_drag`, `sled_push`, `snatch`, `snatch_balance`, `snatch_pull`, `squat`, `stair_climb`, `star_jump`, `step_down`, `step_over`, `step_up`, `stiff_legged_deadlift`, `stomach_vacuum`, `straight_arm_pulldown`, `stretch`, `superman`, `swim`, `swimmer`, `swing`, `t_raise`, `throw`, `thruster`, `tibialis_raise`, `tire_flip`, `toe_tap`, `toe_walk`, `tricep_extension`, `trunk_lateral_flexion`, `trunk_rotation`, `turkish_get_up`, `upright_row`, `v_sit`, `v_up`, `w_raise`, `walk`, `walkout`, `windmill`, `windshield_wiper`, `wood_chop`, `wrist_curl`, `y_raise`

### UploadType

| Name               | Value |
| ------------------ | ----- |
| Unknown            | 0     |
| Automatic          | 1     |
| Manual             | 2     |
| Update             | 3     |
| Delete             | 4     |
| Pending            | 5     |
| Third party upload | 6     |

### SleepUploadType

| Name          | Value |
| ------------- | ----- |
| Unknown       | 0     |
| Manual        | 1     |
| Automatic     | 2     |
| Tentative     | 3     |
| Indeterminate | 4     |

### StrokeType

| Name         | Value        |
| ------------ | ------------ |
| OTHER        | other        |
| FREESTYLE    | freestyle    |
| BACKSTROKE   | backstroke   |
| BREASTSTROKE | breaststroke |
| BUTTERFLY    | butterfly    |

### GlucoseFlag

| Name   | Value |
| ------ | ----- |
| Normal | 0     |
| High   | 1     |
| Low    | 2     |

### NutritionUnits

| Name        | Value |
| ----------- | ----- |
| Unknown     | 0     |
| Gram        | 1     |
| Teaspoon    | 2     |
| Tablespoon  | 3     |
| Cup         | 4     |
| Medium      | 5     |
| Large       | 6     |
| Small       | 7     |
| Milliliter  | 8     |
| Ounce       | 9     |
| Count       | 10    |
| Scoop       | 11    |
| Fluid Ounce | 12    |

### RecoveryLevel

| Name        | Value |
| ----------- | ----- |
| Unknown     | 0     |
| Very Poor   | 1     |
| Poor        | 2     |
| Compromised | 3     |
| Ok          | 4     |
| Good        | 5     |
| Very Good   | 6     |

### TrendArrow

| Name             | Value |
| ---------------- | ----- |
| UNKNOWN          | 0     |
| FALLING\_QUICKLY | 1     |
| FALLING          | 2     |
| FLAT             | 3     |
| RISING           | 4     |
| RISING\_QUICKLY  | 5     |

### Timezone Localization

| Name  | Value |
| ----- | ----- |
| UTC   | 0     |
| LOCAL | 1     |

### MenstruationFlow

| Name    | Value |
| ------- | ----- |
| UNKNOWN | 0     |
| NONE    | 1     |
| LIGHT   | 2     |
| MEDIUM  | 3     |
| HEAVY   | 4     |
| HARD    | 5     |

### MealType

| Name             | Value |
| ---------------- | ----- |
| UNKNOWN          | 0     |
| BREAKFAST        | 1     |
| MORNING\_SNACK   | 2     |
| LUNCH            | 3     |
| AFTERNOON\_SNACK | 4     |
| DINNER           | 5     |
| SNACK            | 6     |

### StressLevel

| Name              | Value |
| ----------------- | ----- |
| NOT\_ENOUGH\_DATA | 0     |
| REST              | 1     |
| LOW               | 2     |
| MEDIUM            | 3     |
| HIGH              | 4     |

### HeartRateContext

| Name        | Value |
| ----------- | ----- |
| NOT\_SET    | 0     |
| ACTIVE      | 1     |
| NOT\_ACTIVE | 2     |

### MenstruationInterval

| Name              | Value |
| ----------------- | ----- |
| UNKNOWN           | 0     |
| PERIOD            | 1     |
| FOLLICULAR        | 2     |
| FERTILE\_WINDOW   | 3     |
| OVULATION         | 4     |
| LUTEAL            | 5     |
| PMS               | 6     |
| FIRST\_TRIMESTER  | 7     |
| SECOND\_TRIMESTER | 8     |
| THIRD\_TRIMESTER  | 9     |

## PlannedWorkout

```
{
      "steps": Array<PlannedWorkoutStep||PlannedWorkoutRepeatStep>,
      "metadata": {
      	"id": String,
        "estimated_if": Number,
        "provider": String,
        "estimated_distance_meters": Number,
        "estimated_elevation_gain_meters": Number,
        "estimated_energy_kj": Number,
        "estimated_speed_meters_per_second": Number,
        "planned_date": ISO-Date-String,
        "created_date": ISO-Date-String,
        "estimated_tss": Number,
        "type": WorkoutTypeNumber,
        "name": String,
        "description": String,
        "pool_length_meters": Number,
        "estimated_calories": Number,
        "estimated_duration_seconds": Number
      }
}
```

The Workout Types follow the same numbering as the Activity Types that can be found in <https://docs.tryterra.co/reference/enums#activitytype>

### PlannedWorkoutStep

```
{
  "description": String,
  "order": Number,
  "intensity": Number,
  "durations": Array<PlannedWorkoutStepDuration>
  "type": 0,
  "targets": Array<PlannedWorkoutStepTarget>,
  "stroke_type": StrokeType, //for Swimming Workouts
  "equipement_type": EquipementType, //for Swimming Workouts
  "exercice_category" : ExerciseType, //for Strength and Cardio workouts
  "exercice_name": String, //for Strength and Cardio workouts
  "weight_kg": Number, //for Strength workouts
}
```

| Step Intensity Name | Step Intensity Number Value |
| ------------------- | --------------------------- |
| REST                | 0                           |
| WARMUP              | 1                           |
| COOLDOWN            | 2                           |
| RECOVERY            | 3                           |
| INTERVAL            | 4                           |
| ACTIVE              | 5                           |

### PlannedWorkoutRepeatStep

```
{
 "description": String,
 "order": Number,
 "intensity": Number,
 "durations": Array<PlannedWorkoutStepDuration>
 "type": 1,
 "targets": Array<PlannedWorkoutStepTarget>,
 "steps" : Array<PlannedWorkoutStep>
}
```

### PlannedWorkoutStepTarget

| Step Target Type                   | Model                                                                                                                                     |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| SPEED                              | `{ "target_type": 0, "speed_meters_per_second": Number, "speed_meters_per_second_low": Number, "speed_meters_per_second_high": Number }`  |
| HEART\_RATE                        | `{ "target_type": 1, "hr_bpm_high": Number, "hr_bpm_low": Number }`                                                                       |
| OPEN                               | `{ "target_type": 2 }`                                                                                                                    |
| CADENCE                            | `{ "target_type": 3, "cadence": Number, "cadence_high": Number, "cadence_low" : Number }`                                                 |
| POWER                              | `{ "target_type": 4, "power_watt_high": Number, "power_watt_low": Number, "power_watt": Number }`                                         |
| SWIM\_STROKE                       | `{ "target_type": 8, "swim_strokes": Number }`                                                                                            |
| PACE                               | `{ "target_type": 11, "speed_meters_per_second": Number, "speed_meters_per_second_low": Number, "speed_meters_per_second_high": Number }` |
| HEART\_RATE\_THRESHOLD\_PERCENTAGE | `{ "target_type": 12, "hr_percentage": Number, "hr_percentage_low": Number, "hr_percentage_high": Number }`                               |
| HEART\_RATE\_MAX\_PERCENTAGE       | `{ "target_type": 13, "hr_percentage": Number, "hr_percentage_low": Number, "hr_percentage_high": Number }`                               |
| SPEED\_PERCENTAGE                  | `{ "target_type": 14, "speed_percentage": Number, "speed_percentage_low": Number, "speed_percentage_high": Number }`                      |
| POWER\_PERCENTAGE                  | `{ "target_type": 15, "power_percentage": Number, "power_percentage_low": Number, "power_percentage_high": Number }`                      |
| REPETITION                         | `{ "target_type": 16, "repetitions": Number }`                                                                                            |

### PlannedWorkoutStepDuration

| Step Duration Type   | Model                                                 |
| -------------------- | ----------------------------------------------------- |
| TIME                 | `{ "duration_type": 0, "seconds": Number }`           |
| DISTANCE\_METERS     | `{ "duration_type": 1, "distance_meters": Number }`   |
| HR\_LESS\_THAN       | `{ "duration_type": 2, "hr_below_bpm": Number }`      |
| HR\_GREATER\_THAN    | `{ "duration_type": 3, "hr_above_bpm": Number }`      |
| CALORIES             | `{ "duration_type": 4, "calories": 2.0 }`             |
| OPEN                 | `{ "duration_type": 5 }`                              |
| POWER\_LESS\_THAN    | `{ "duration_type": 6, "power_below_watts": Number }` |
| POWER\_GREATER\_THAN | `{ "duration_type": 7, "power_above_watts": Number }` |
| REPS                 | `{ "duration_type": 9, "reps": Number }`              |
| FIXED\_REST          | `{ "duration_type": 10, "rest_seconds": Number }`     |
| STEPS                | `{ "duration_type": 12, "steps": Number }`            |

### Enums

| Stroke Type  | Value |
| ------------ | ----- |
| BACKSTROKE   | 0     |
| BREASTSTROKE | 1     |
| DRILL        | 2     |
| BUTTERFLY    | 3     |
| FREESTYLE    | 4     |
| MIXED        | 5     |
| IM           | 6     |

| Equipement Type  | Value |
| ---------------- | ----- |
| NONE             | 0     |
| SWIM\_FINS       | 1     |
| SWIM\_KICKBOARD  | 2     |
| SWIM\_PADDLES    | 3     |
| SWIM\_PULL\_BUOY | 4     |
| SWIM\_SNORKEL    | 5     |

| Exercice Type       | Value |
| ------------------- | ----- |
| UNKNOWN             | 0     |
| BENCH\_PRESS        | 1     |
| CALF\_RAISE         | 2     |
| CARDIO              | 3     |
| CARRY               | 4     |
| CHOP                | 5     |
| CORE                | 6     |
| CRUNCH              | 7     |
| CURL                | 8     |
| DEADLIFT            | 9     |
| FLYE                | 10    |
| HIP\_RAISE          | 11    |
| HIP\_STABILITY      | 12    |
| HIP\_SWING          | 13    |
| HYPEREXTENSION      | 14    |
| LATERAL\_RAISE      | 15    |
| LEG\_CURL           | 16    |
| LEG\_RAISE          | 17    |
| LUNGE               | 18    |
| OLYMPIC\_LIFT       | 19    |
| PLANK               | 20    |
| PLYO                | 21    |
| PULL\_UP            | 22    |
| PUSH\_UP            | 23    |
| ROW                 | 24    |
| SHOULDER\_PRESS     | 25    |
| SHOULDER\_STABILITY | 26    |
| SHRUG               | 27    |
| SIT\_UP             | 28    |
| SQUAT               | 29    |
| TOTAL\_BODY         | 30    |
| TRICEPS\_EXTENSION  | 31    |
| WARM\_UP            | 32    |
| RUN                 | 33    |
| BIKE                | 34    |
| CARDIO\_SENSORS     | 35    |
