Skip to main content
POST
/
users
/
{user_id}
/
activities
Create activity
curl --request POST \
  --url https://production.api.onvy.health/users/{user_id}/activities \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "type": "workout",
  "start_datetime": "2023-11-07T05:31:56Z",
  "end_datetime": "2023-11-07T05:31:56Z",
  "data_source": "<string>",
  "duration_seconds": 1,
  "type_name": "<string>",
  "tss": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "used_ftp": 123,
  "guessed_ftp": 123,
  "is_breakthrough_ftp": true,
  "zone_power": "<string>",
  "normalized_power": 123,
  "variability_index": 123,
  "intensity_factor": 123,
  "tss_power": 123,
  "average_hr": 123,
  "average_power": 123,
  "zone_hr": "<string>",
  "used_lthr": 123,
  "guessed_lthr": 123,
  "guessed_mhr": 123,
  "is_breakthrough_lthr": true,
  "tss_hr": 123,
  "peak_duration_hr": 123,
  "cardio_duration_hr": 123,
  "fatburn_duration_hr": 123,
  "light_duration_hr": 123,
  "hr_series": "<string>",
  "hr_series_sampling_rate": "<string>",
  "peak_threshold_hr": 123,
  "cardio_threshold_hr": 123,
  "fatburn_threshold_hr": 123,
  "calories": 123,
  "max_hr": 123,
  "hr_zone_durations_seconds": [
    123
  ],
  "hr_zone_thresholds": [
    123
  ],
  "power_zone_durations_seconds": [
    123
  ],
  "power_zone_thresholds": [
    123
  ],
  "activity_score_before": 123,
  "activity_score_after": 123,
  "group_id": 123,
  "selected": true
}
'
{
  "project_id": "<string>",
  "user_id": "<string>",
  "type": "workout",
  "start_datetime": "2023-11-07T05:31:56Z",
  "end_datetime": "2023-11-07T05:31:56Z",
  "data_source": "<string>",
  "duration_seconds": 1,
  "type_name": "<string>",
  "tss": 123,
  "id": "<string>",
  "used_ftp": 123,
  "guessed_ftp": 123,
  "is_breakthrough_ftp": true,
  "zone_power": "<string>",
  "normalized_power": 123,
  "variability_index": 123,
  "intensity_factor": 123,
  "tss_power": 123,
  "average_hr": 123,
  "average_power": 123,
  "zone_hr": "<string>",
  "used_lthr": 123,
  "guessed_lthr": 123,
  "guessed_mhr": 123,
  "is_breakthrough_lthr": true,
  "tss_hr": 123,
  "peak_duration_hr": 123,
  "cardio_duration_hr": 123,
  "fatburn_duration_hr": 123,
  "light_duration_hr": 123,
  "hr_series": "<string>",
  "hr_series_sampling_rate": "<string>",
  "peak_threshold_hr": 123,
  "cardio_threshold_hr": 123,
  "fatburn_threshold_hr": 123,
  "calories": 123,
  "max_hr": 123,
  "hr_zone_durations_seconds": [
    123
  ],
  "hr_zone_thresholds": [
    123
  ],
  "power_zone_durations_seconds": [
    123
  ],
  "power_zone_thresholds": [
    123
  ],
  "activity_score_before": 123,
  "activity_score_after": 123,
  "group_id": 123,
  "selected": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Path Parameters

user_id
string
required

User ID (e.g., google_104940819145861640201)

Body

application/json

Activity creation data

type
enum<string>
required

Type of activity

Available options:
workout
start_datetime
string<date-time>
required

Start time of the workout in ISO 8601 format

end_datetime
string<date-time>
required

End time of the workout in ISO 8601 format

data_source
string
required

Source of the workout data

duration_seconds
integer
required

Duration of the workout in seconds

Required range: x >= 0
type_name
string
required

Name/type of the workout

tss
number<float>
required

Training Stress Score

created_at
string<date-time>
required

When the mindfulness activity was created

updated_at
string<date-time>
required

When the mindfulness activity was last updated

used_ftp
number<float>

Used Functional Threshold Power

guessed_ftp
number<float>

Estimated Functional Threshold Power

is_breakthrough_ftp
boolean

Whether this workout represents an FTP breakthrough

zone_power
string

Power zone distribution

normalized_power
number<float>

Normalized power for the workout

variability_index
number<float>

Variability index of power

intensity_factor
number<float>

Intensity factor

tss_power
number<float>

TSS calculated from power

average_hr
number<float>

Average heart rate

average_power
number<float>

Average power

zone_hr
string

Heart rate zone distribution

used_lthr
number<float>

Used Lactate Threshold Heart Rate

guessed_lthr
number<float>

Estimated Lactate Threshold Heart Rate

guessed_mhr
number<float>

Estimated Maximum Heart Rate

is_breakthrough_lthr
boolean

Whether this workout represents an LTHR breakthrough

tss_hr
number<float>

TSS calculated from heart rate

peak_duration_hr
number<float>

Time spent in peak heart rate zone

cardio_duration_hr
number<float>

Time spent in cardio heart rate zone

fatburn_duration_hr
number<float>

Time spent in fat burn heart rate zone

light_duration_hr
number<float>

Time spent in light heart rate zone

hr_series
string

Heart rate series data

hr_series_sampling_rate
string

Sampling rate for heart rate series

peak_threshold_hr
number<float>

Peak heart rate threshold

cardio_threshold_hr
number<float>

Cardio heart rate threshold

fatburn_threshold_hr
number<float>

Fat burn heart rate threshold

calories
number<float>

Calories burned during workout

max_hr
number<float>

Maximum heart rate during workout

hr_zone_durations_seconds
integer[]

Time spent in each heart rate zone (seconds)

hr_zone_thresholds
integer[]

Heart rate zone thresholds

power_zone_durations_seconds
integer[]

Time spent in each power zone (seconds)

power_zone_thresholds
integer[]

Power zone thresholds

activity_score_before
integer

Activity score before workout

activity_score_after
integer

Activity score after workout

group_id
integer

Group identifier for related workouts

selected
boolean

Whether this workout is selected for analysis

Response

Activity created successfully

project_id
string
required

Project identifier

user_id
string
required

User identifier

type
enum<string>
required

Type of activity

Available options:
workout
start_datetime
string<date-time>
required

Start time of the workout in ISO 8601 format

end_datetime
string<date-time>
required

End time of the workout in ISO 8601 format

data_source
string
required

Source of the workout data

duration_seconds
integer
required

Duration of the workout in seconds

Required range: x >= 0
type_name
string
required

Name/type of the workout

tss
number<float>
required

Training Stress Score

id
string

Unique identifier for the workout

used_ftp
number<float>

Used Functional Threshold Power

guessed_ftp
number<float>

Estimated Functional Threshold Power

is_breakthrough_ftp
boolean

Whether this workout represents an FTP breakthrough

zone_power
string

Power zone distribution

normalized_power
number<float>

Normalized power for the workout

variability_index
number<float>

Variability index of power

intensity_factor
number<float>

Intensity factor

tss_power
number<float>

TSS calculated from power

average_hr
number<float>

Average heart rate

average_power
number<float>

Average power

zone_hr
string

Heart rate zone distribution

used_lthr
number<float>

Used Lactate Threshold Heart Rate

guessed_lthr
number<float>

Estimated Lactate Threshold Heart Rate

guessed_mhr
number<float>

Estimated Maximum Heart Rate

is_breakthrough_lthr
boolean

Whether this workout represents an LTHR breakthrough

tss_hr
number<float>

TSS calculated from heart rate

peak_duration_hr
number<float>

Time spent in peak heart rate zone

cardio_duration_hr
number<float>

Time spent in cardio heart rate zone

fatburn_duration_hr
number<float>

Time spent in fat burn heart rate zone

light_duration_hr
number<float>

Time spent in light heart rate zone

hr_series
string

Heart rate series data

hr_series_sampling_rate
string

Sampling rate for heart rate series

peak_threshold_hr
number<float>

Peak heart rate threshold

cardio_threshold_hr
number<float>

Cardio heart rate threshold

fatburn_threshold_hr
number<float>

Fat burn heart rate threshold

calories
number<float>

Calories burned during workout

max_hr
number<float>

Maximum heart rate during workout

hr_zone_durations_seconds
integer[]

Time spent in each heart rate zone (seconds)

hr_zone_thresholds
integer[]

Heart rate zone thresholds

power_zone_durations_seconds
integer[]

Time spent in each power zone (seconds)

power_zone_thresholds
integer[]

Power zone thresholds

activity_score_before
integer

Activity score before workout

activity_score_after
integer

Activity score after workout

group_id
integer

Group identifier for related workouts

selected
boolean

Whether this workout is selected for analysis

created_at
string<date-time>

When the workout was created

updated_at
string<date-time>

When the workout was last updated