Skip to content

Create Workout

Request

This endpoint creates a cardio workout

Security
user
Bodyapplication/jsonrequired
uniqueExerciseIdstring, non-emptyrequired

Unique identifier for this exercise. The machine should generate a unique id for each exercise submitted.

startTimestampinteger, (int64)required

The start of the exercise in milliseconds since the epoch time. It can not be older than seven days.

Example:1672531200000
endTimestampinteger, (int64)

The end of the exercise in milliseconds since the epoch time.

timezonestring

The timezone where the workout is taking place.

frequencyinteger, (int32)

The number of times this exercise should be repeated per week.

Example:2
exerciseNamestring, non-emptyrequired

The name that the partner will give to its exercise.

kiloCaloriesnumber, (double)

The kilo calories (kcal) burned during the exercise.

Example:100
averageHeartRateinteger, (int32)

The average heart rate of this workout in beats/min (bpm).

trainingPlanIdinteger, (int64)

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
averagePacenumber, (double)

the average pace of this workout in min/km

trainingPlanExerciseIdinteger, (int64)

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
orderNumberinteger, (int32)

Order number of the exercise in the session of the training plan. This can be used for sorting.

Example:1
metadataobject

The workout's metadata as key-value pairs.

intervalsArray of objects, non-empty(CardioWorkoutIntervalDTO)required

The cardio workout intervals (sets of exercises).

curl -i -X POST \
  https://developer.egym.com/_mock/equipment/partner-api/api/v1/cardio/workouts \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "uniqueExerciseId": "string",
    "startTimestamp": 1672531200000,
    "endTimestamp": 0,
    "timezone": "string",
    "frequency": 2,
    "exerciseName": "string",
    "kiloCalories": 100,
    "averageHeartRate": 0,
    "trainingPlanId": 7189234126347912000,
    "averagePace": 0.1,
    "trainingPlanExerciseId": -767612783462,
    "orderNumber": 1,
    "metadata": {
      "property1": "string",
      "property2": "string"
    },
    "intervals": [
      {
        "rampAngle": 1,
        "resistance": 1,
        "speed": "2.7777",
        "duration": 5000,
        "distance": "13.8",
        "heartRate": 130,
        "kiloCalories": 5,
        "stepsPerMinute": 70,
        "steps": 10,
        "stepHeight": 2,
        "strideLengthZone": 1,
        "rotations": 50,
        "incline": "1.5",
        "floors": 1,
        "watts": 200
      }
    ]
  }'

Responses

No Content

Response
No content