Vekta API
Training collections

Create a training collection

Adds a workout template to your library. No subscription needed.

The steps can't use zones, because a template isn't tied to an athlete: see Workout structure.

Responds with:

  • 400 bad_request: a field, target or zones type the sport doesn't support, steps on a sport other than cycling, running and swimming, or other invalid parameters or payload.
POST
/training-collections

Authorization

bearer
AuthorizationBearer <token>

Your Vekta API key, sent as Authorization: Bearer vk_..., or an OAuth access token of an app you connected, sent as Authorization: Bearer <access token>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

title*string
sport*string
Value in"cycling" | "running" | "swimming" | "training" | "multisport" | "walking" | "crossCountrySkiing" | "alpineSkiing" | "rowing" | "hiking" | "hiit" | "fitnessEquipment" | "racket" | "tennis" | "golf" | "standUpPaddleboarding" | "snowboarding" | "meditation" | "kayaking" | "soccer" | "rockClimbing" | "iceSkating" | "windsurfing" | "mixedMartialArts" | "sailing" | "mountaineering" | "surfing" | "boating" | "basketball" | "eBiking" | "hockey" | "snowshoeing" | "inlineSkating" | "kitesurfing" | "mobility" | "tactical" | "hunting" | "fishing" | "jumpRope" | "boxing" | "floorClimbing" | "snorkeling" | "motorcycling" | "baseball" | "paddling" | "canoeing" | "rafting" | "rugby" | "discGolf" | "wakeboarding" | "wakesurfing" | "waterTubing" | "waterSkiing" | "waterSport" | "snowmobiling" | "dance" | "flying" | "americanFootball" | "diving" | "cricket" | "volleyball" | "wheelchairPushWalk" | "wheelchairPushRun" | "paraSport" | "hangGliding" | "skyDiving" | "jumpmaster" | "horsebackRiding" | "driving" | "motorSports" | "shooting" | "archery" | "winterSport" | "videoGaming" | "geocaching" | "lacrosse" | "poolApnea" | "teamSport" | "grinding" | "transition" | "generic"
subSport?string | null

Must be a sub sport of sport

Value in"generic" | "treadmill" | "street" | "trail" | "track" | "spin" | "indoorCycling" | "road" | "mountain" | "downhill" | "recumbent" | "cyclocross" | "handCycling" | "trackCycling" | "indoorRowing" | "elliptical" | "stairClimbing" | "lapSwimming" | "openWater" | "flexibilityTraining" | "strengthTraining" | "warmUp" | "match" | "exercise" | "challenge" | "indoorSkiing" | "cardioTraining" | "indoorWalking" | "eBikeFitness" | "bmx" | "casualWalking" | "speedWalking" | "bikeToRunTransition" | "runToBikeTransition" | "swimToBikeTransition" | "atv" | "motocross" | "backcountry" | "resort" | "rcDrone" | "wingsuit" | "whitewater" | "skateSkiing" | "yoga" | "pilates" | "indoorRunning" | "gravelCycling" | "eBikeMountain" | "commuting" | "mixedSurface" | "navigate" | "trackMe" | "map" | "singleGasDiving" | "multiGasDiving" | "gaugeDiving" | "apneaDiving" | "apneaHunting" | "virtualActivity" | "obstacle" | "breathing" | "ccrDiving" | "sailRace" | "expedition" | "ultra" | "indoorClimbing" | "bouldering" | "hiit" | "indoorGrinding" | "huntingWithDogs" | "amrap" | "emom" | "tabata" | "esport" | "triathlon" | "duathlon" | "brick" | "swimRun" | "adventureRace" | "truckerWorkout" | "pickleball" | "padel" | "indoorWheelchairWalk" | "indoorWheelchairRun" | "indoorHandCycling" | "field" | "ice" | "ultimate" | "platform" | "squash" | "badminton" | "racquetball" | "tableTennis" | "overland" | "trollingMotor" | "flyCanopy" | "flyParaglide" | "flyParamotor" | "flyPressurized" | "flyNavigate" | "flyTimer" | "flyAltimeter" | "flyWx" | "flyVfr" | "flyIfr" | "dynamicApnea" | "enduro" | "rucking" | "rally" | "poolTriathlon" | "eBikeEnduro" | "timeTrial"
zonesType?string

The main target of the steps. Required when you send structure, and not accepted without it. See Workout structure.

Value in"power" | "speed" | "heartRate"
elevationGain?integer | null

In meters. Only for sports with an elevation gain

description?string | null
comment?string | null
trainingStimulus?string | null
Value in"neuromuscular" | "anaerobic" | "vo2max" | "threshold" | "tempo" | "aerobic" | "recovery" | "lactate clearance" | "durability" | "activation" | "test" | "race" | "heat"
rpe?integer | null
structure?StructureCollectionInput | null

Send null to remove the steps.

Show attributes
One of the following 2 variants
StructureCollectionStepInputtype: "step"
type*"step"
Value in"step"
label*string
Value in"warm up" | "active" | "intra-recovery" | "rest" | "cool down" | "maximum"
length*Free | Duration | Distance
Show attributes
One of the following 3 variants
Freetype: "free"

The athlete decides when to move on

type*"free"
Value in"free"
Durationtype: "duration"
type*"duration"
Value in"duration"
duration*number

In seconds

Range0 < value
Distancetype: "distance"
type*"distance"
Value in"distance"
distance*number

In meters

Range0 < value
intensity?StructureCollectionIntensityInput

All targets are optional, and each sport accepts different ones. See Workout structure.

Show 6 attributes
power?StructureCollectionPowerTargetInput
Show attributes
One of the following 2 variants
Percentage
minPercentage*number

In % of the athlete's critical power

Range0 <= value
maxPercentage*number

In % of the athlete's critical power

Range0 <= value
Absolute
min*number

In watts

Range0 <= value
max*number

In watts

Range0 <= value
heartRate?StructureCollectionHeartRateTargetInput
Show attributes
One of the following 2 variants
Percentage
minPercentage*number

In % of the athlete's max heart rate

Range0 <= value
maxPercentage*number

In % of the athlete's max heart rate

Range0 <= value
Absolute
min*number

In bpm

Range0 <= value
max*number

In bpm

Range0 <= value
speed?StructureCollectionSpeedTargetInput
Show attributes
One of the following 2 variants
Percentage
minPercentage*number

In % of the athlete's critical speed

Range0 <= value
maxPercentage*number

In % of the athlete's critical speed

Range0 <= value
Absolute
min*number

In m/s

Range0 <= value
max*number

In m/s

Range0 <= value
cadence?object
Show 2 attributes
min*number

In rpm (spm for running)

Range0 <= value
max*number

In rpm (spm for running)

Range0 <= value
stroke?string
Value in"freestyle" | "backstroke" | "breaststroke" | "butterfly" | "drill" | "mixed" | "im" | "imByRound" | "rimo"
passive?boolean

Swim rest spent at the wall, with no target

StructureCollectionRepetitionInputtype: "repetition"

A block of steps done nRepetitions times. Repetitions can be nested up to 3 levels deep.

type*"repetition"
Value in"repetition"
nRepetitions*integer
Range1 <= value <= 9007199254740991
steps*array<StructureCollectionStepInput | StructureCollectionNestedRepetitionInput>
Items1 <= items
Show attributes
One of the following 2 variants
StructureCollectionStepInputtype: "step"
type*"step"
Value in"step"
label*string
Value in"warm up" | "active" | "intra-recovery" | "rest" | "cool down" | "maximum"
length*Free | Duration | Distance
Show attributes
One of the following 3 variants
Freetype: "free"

The athlete decides when to move on

type*"free"
Value in"free"
Durationtype: "duration"
type*"duration"
Value in"duration"
duration*number

In seconds

Range0 < value
Distancetype: "distance"
type*"distance"
Value in"distance"
distance*number

In meters

Range0 < value
intensity?StructureCollectionIntensityInput

All targets are optional, and each sport accepts different ones. See Workout structure.

Show 6 attributes
power?StructureCollectionPowerTargetInput
Show attributes
One of the following 2 variants
Percentage
minPercentage*number

In % of the athlete's critical power

Range0 <= value
maxPercentage*number

In % of the athlete's critical power

Range0 <= value
Absolute
min*number

In watts

Range0 <= value
max*number

In watts

Range0 <= value
heartRate?StructureCollectionHeartRateTargetInput
Show attributes
One of the following 2 variants
Percentage
minPercentage*number

In % of the athlete's max heart rate

Range0 <= value
maxPercentage*number

In % of the athlete's max heart rate

Range0 <= value
Absolute
min*number

In bpm

Range0 <= value
max*number

In bpm

Range0 <= value
speed?StructureCollectionSpeedTargetInput
Show attributes
One of the following 2 variants
Percentage
minPercentage*number

In % of the athlete's critical speed

Range0 <= value
maxPercentage*number

In % of the athlete's critical speed

Range0 <= value
Absolute
min*number

In m/s

Range0 <= value
max*number

In m/s

Range0 <= value
cadence?object
Show 2 attributes
min*number

In rpm (spm for running)

Range0 <= value
max*number

In rpm (spm for running)

Range0 <= value
stroke?string
Value in"freestyle" | "backstroke" | "breaststroke" | "butterfly" | "drill" | "mixed" | "im" | "imByRound" | "rimo"
passive?boolean

Swim rest spent at the wall, with no target

StructureCollectionNestedRepetitionInputtype: "repetition"

A repetition inside another repetition

type*"repetition"
Value in"repetition"
nRepetitions*integer
Range1 <= value <= 9007199254740991
steps*array<StructureCollectionStepInput | StructureCollectionInnermostRepetitionInput>
Items1 <= items
Show attributes
One of the following 2 variants
StructureCollectionStepInputtype: "step"
type*"step"
Value in"step"
label*string
Value in"warm up" | "active" | "intra-recovery" | "rest" | "cool down" | "maximum"
length*Free | Duration | Distance
Show attributes
One of the following 3 variants
Freetype: "free"

The athlete decides when to move on

type*"free"
Value in"free"
Durationtype: "duration"
type*"duration"
Value in"duration"
duration*number

In seconds

Range0 < value
Distancetype: "distance"
type*"distance"
Value in"distance"
distance*number

In meters

Range0 < value
intensity?StructureCollectionIntensityInput

All targets are optional, and each sport accepts different ones. See Workout structure.

Show 6 attributes
power?StructureCollectionPowerTargetInput
Show attributes
One of the following 2 variants
Percentage
minPercentage*number

In % of the athlete's critical power

Range0 <= value
maxPercentage*number

In % of the athlete's critical power

Range0 <= value
Absolute
min*number

In watts

Range0 <= value
max*number

In watts

Range0 <= value
heartRate?StructureCollectionHeartRateTargetInput
Show attributes
One of the following 2 variants
Percentage
minPercentage*number

In % of the athlete's max heart rate

Range0 <= value
maxPercentage*number

In % of the athlete's max heart rate

Range0 <= value
Absolute
min*number

In bpm

Range0 <= value
max*number

In bpm

Range0 <= value
speed?StructureCollectionSpeedTargetInput
Show attributes
One of the following 2 variants
Percentage
minPercentage*number

In % of the athlete's critical speed

Range0 <= value
maxPercentage*number

In % of the athlete's critical speed

Range0 <= value
Absolute
min*number

In m/s

Range0 <= value
max*number

In m/s

Range0 <= value
cadence?object
Show 2 attributes
min*number

In rpm (spm for running)

Range0 <= value
max*number

In rpm (spm for running)

Range0 <= value
stroke?string
Value in"freestyle" | "backstroke" | "breaststroke" | "butterfly" | "drill" | "mixed" | "im" | "imByRound" | "rimo"
passive?boolean

Swim rest spent at the wall, with no target

StructureCollectionInnermostRepetitionInputtype: "repetition"

A repetition at the third level. Can only contain steps.

type*"repetition"
Value in"repetition"
nRepetitions*integer
Range1 <= value <= 9007199254740991
steps*array<StructureCollectionStepInput>
Items1 <= items
Show 4 attributes
type*"step"
Value in"step"
label*string
Value in"warm up" | "active" | "intra-recovery" | "rest" | "cool down" | "maximum"
length*Free | Duration | Distance
Show attributes
One of the following 3 variants
Freetype: "free"

The athlete decides when to move on

type*"free"
Value in"free"
Durationtype: "duration"
type*"duration"
Value in"duration"
duration*number

In seconds

Range0 < value
Distancetype: "distance"
type*"distance"
Value in"distance"
distance*number

In meters

Range0 < value
intensity?StructureCollectionIntensityInput

All targets are optional, and each sport accepts different ones. See Workout structure.

Show 6 attributes
power?StructureCollectionPowerTargetInput
Show attributes
One of the following 2 variants
Percentage
minPercentage*number

In % of the athlete's critical power

Range0 <= value
maxPercentage*number

In % of the athlete's critical power

Range0 <= value
Absolute
min*number

In watts

Range0 <= value
max*number

In watts

Range0 <= value
heartRate?StructureCollectionHeartRateTargetInput
Show attributes
One of the following 2 variants
Percentage
minPercentage*number

In % of the athlete's max heart rate

Range0 <= value
maxPercentage*number

In % of the athlete's max heart rate

Range0 <= value
Absolute
min*number

In bpm

Range0 <= value
max*number

In bpm

Range0 <= value
speed?StructureCollectionSpeedTargetInput
Show attributes
One of the following 2 variants
Percentage
minPercentage*number

In % of the athlete's critical speed

Range0 <= value
maxPercentage*number

In % of the athlete's critical speed

Range0 <= value
Absolute
min*number

In m/s

Range0 <= value
max*number

In m/s

Range0 <= value
cadence?object
Show 2 attributes
min*number

In rpm (spm for running)

Range0 <= value
max*number

In rpm (spm for running)

Range0 <= value
stroke?string
Value in"freestyle" | "backstroke" | "breaststroke" | "butterfly" | "drill" | "mixed" | "im" | "imByRound" | "rimo"
passive?boolean

Swim rest spent at the wall, with no target

duration?integer | null

In seconds. With a structure, Vekta computes it from the steps when it can. See Workout structure.

distance?integer | null

In meters. Only for sports with a distance. With a structure, Vekta computes it from the steps when it can. See Workout structure.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/training-collections" \  -H "Content-Type: application/json" \  -d '{    "title": "3 x 12 min threshold",    "sport": "cycling"  }'
{  "id": "tcl_01JK4W2N9XQ3F5H7B8C6D2E9GT",  "title": "3 x 12 min threshold",  "description": null,  "comment": null,  "sport": "cycling",  "subSport": null,  "trainingStimulus": "threshold",  "structure": [    {      "type": "step",      "label": "active",      "intensity": {        "vektaIntensity": "threshold",        "zone": "Z4",        "stroke": "freestyle",        "passive": true,        "fromPower": "zone",        "fromHeartRate": "zone",        "minPower": 250,        "maxPower": 280,        "minPowerThresholdPercentage": 95,        "maxPowerThresholdPercentage": 106,        "minHeartRate": 160,        "maxHeartRate": 172,        "minMaxHeartRatePercentage": 85,        "maxMaxHeartRatePercentage": 91,        "minCadence": 85,        "maxCadence": 95,        "fromSpeed": "zone",        "minSpeed": 3.6,        "maxSpeed": 4.2,        "minSpeedThresholdPercentage": 92,        "maxSpeedThresholdPercentage": 104      },      "length": {        "type": "free"      }    }  ],  "zonesType": "power",  "duration": 4500,  "freeDuration": 600,  "distance": null,  "elevationGain": null,  "rpe": 7}