# Create Workout

This endpoint creates a cardio workout

Endpoint: POST /api/v1/cardio/workouts
Version: 1.2.0
Security: user

## Security:

  - `user` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `uniqueExerciseId` (string, required)
    Unique identifier for this exercise. The machine should generate a unique id for each exercise submitted.

  - `startTimestamp` (integer, required)
    The start of the exercise in milliseconds since the epoch time. It can not be older than seven days.
    Example: 1672531200000

  - `endTimestamp` (integer)
    The end of the exercise in milliseconds since the epoch time.

  - `timezone` (string)
    The timezone where the workout is taking place.

  - `frequency` (integer)
    The number of times this exercise should be repeated per week.
    Example: 2

  - `exerciseName` (string, required)
    The name that the partner will give to its exercise.

  - `kiloCalories` (number)
    The kilo calories (kcal) burned during the exercise.
    Example: 100

  - `averageHeartRate` (integer)
    The average heart rate of this workout in beats/min (bpm).

  - `trainingPlanId` (integer)
    Training Plan ID. When the user selects an exercise from the training plan, this field should contain the training plan id from that exercise when submitting the workout.
    Example: 7189234126347912000

  - `averagePace` (number)
    the average pace of this workout in min/km

  - `trainingPlanExerciseId` (integer)
    Training Plan Exercise ID. When the user selects an exercise from the training plan, this field should contain the training plan exercise id from that exercise when submitting the workout.
    Example: -767612783462

  - `orderNumber` (integer)
    Order number of the exercise in the session of the training plan. This can be used for sorting.
    Example: 1

  - `metadata` (object)
    The workout's metadata as key-value pairs.

  - `intervals` (array, required)
    The cardio workout intervals (sets of exercises).

  - `intervals.rampAngle` (integer)
    The angle of the ramp.
    Example: 1

  - `intervals.resistance` (number)
    The resistance.
    Example: 1

  - `intervals.speed` (number)
    The speed in m/s.
    Example: 2.7777

  - `intervals.duration` (integer)
    The duration in milliseconds.
    Example: 5000

  - `intervals.distance` (number)
    The distance in meters.
    Example: 13.8

  - `intervals.heartRate` (integer)
    The average heart rate of this Interval in beats/min (bpm).
    Example: 130

  - `intervals.kiloCalories` (number)
    The kilo calories (kcal) burned during the interval.
    Example: 5

  - `intervals.stepsPerMinute` (integer)
    The steps per minutes.
    Example: 70

  - `intervals.steps` (integer)
    The number of steps during the interval.
    Example: 10

  - `intervals.stepHeight` (integer)
    The step height.
    Example: 2

  - `intervals.strideLengthZone` (integer)
    The stride length zone.
    Example: 1

  - `intervals.rotations` (integer)
    The rotations, in rotations per minute (rpm).
    Example: 50

  - `intervals.incline` (number)
    The incline.
    Example: 1.5

  - `intervals.floors` (integer)
    The floors.
    Example: 1

  - `intervals.watts` (number)
    Power/Resistance in watts.
    Example: 200

## Response 204:

  - `204` (unknown)
    No Content

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `timestamp` (integer)
    Unix epoch milliseconds when the error occurred.
    Example: 1775122463109

  - `path` (string)
    The request path that triggered the error.
    Example: /api/v1/measurements/body/history

  - `status` (integer)
    HTTP status code.
    Example: 400

  - `error` (string)
    Short textual description of the HTTP status.
    Example: Bad Request

  - `requestId` (string)
    Unique identifier for the request, useful for correlating logs and support tickets.
    Example: d0c0fd9e-236

  - `message` (string)
    Human-readable description of the error.
    Example: Invalid request parameters: value must be greater than or equal to 1 and less than or equal to 1000

  - `fieldErrors` (array)
    List of field-level validation errors. Only present when the error was caused by request-body binding failures or custom form validation.

  - `fieldErrors.name` (string)
    The field name.

  - `fieldErrors.message` (string)
    The error message.
    Example: Must not be null.

  - `fieldErrors.rejectedValue` (any)
    The rejected value.
    Example: Must not be null.

  - `errorCode` (string)
    Machine-readable error code for domain-specific errors. Only present for exceptions that carry a custom error code.
    Example: USER_NOT_FOUND

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `timestamp` (integer)
    Unix epoch milliseconds when the error occurred.
    Example: 1775122463109

  - `path` (string)
    The request path that triggered the error.
    Example: /api/v1/measurements/body/history

  - `status` (integer)
    HTTP status code.
    Example: 400

  - `error` (string)
    Short textual description of the HTTP status.
    Example: Bad Request

  - `requestId` (string)
    Unique identifier for the request, useful for correlating logs and support tickets.
    Example: d0c0fd9e-236

  - `message` (string)
    Human-readable description of the error.
    Example: Invalid request parameters: value must be greater than or equal to 1 and less than or equal to 1000

  - `fieldErrors` (array)
    List of field-level validation errors. Only present when the error was caused by request-body binding failures or custom form validation.

  - `fieldErrors.name` (string)
    The field name.

  - `fieldErrors.message` (string)
    The error message.
    Example: Must not be null.

  - `fieldErrors.rejectedValue` (any)
    The rejected value.
    Example: Must not be null.

  - `errorCode` (string)
    Machine-readable error code for domain-specific errors. Only present for exceptions that carry a custom error code.
    Example: USER_NOT_FOUND

## Response 500:

  - `500` (unknown)
    Internal Server Error

## Response 500 fields (application/json):

  - `timestamp` (integer)
    Unix epoch milliseconds when the error occurred.
    Example: 1775122463109

  - `path` (string)
    The request path that triggered the error.
    Example: /api/v1/measurements/body/history

  - `status` (integer)
    HTTP status code.
    Example: 400

  - `error` (string)
    Short textual description of the HTTP status.
    Example: Bad Request

  - `requestId` (string)
    Unique identifier for the request, useful for correlating logs and support tickets.
    Example: d0c0fd9e-236

  - `message` (string)
    Human-readable description of the error.
    Example: Invalid request parameters: value must be greater than or equal to 1 and less than or equal to 1000

  - `fieldErrors` (array)
    List of field-level validation errors. Only present when the error was caused by request-body binding failures or custom form validation.

  - `fieldErrors.name` (string)
    The field name.

  - `fieldErrors.message` (string)
    The error message.
    Example: Must not be null.

  - `fieldErrors.rejectedValue` (any)
    The rejected value.
    Example: Must not be null.

  - `errorCode` (string)
    Machine-readable error code for domain-specific errors. Only present for exceptions that carry a custom error code.
    Example: USER_NOT_FOUND

