Vekta API
Training prescriptions

Prescribe a workout

Plans a workout for the user on a given date, from scratch or from one of your training collections.

Vekta converts the steps for the user and estimates the workout from them: see Workout structure.

Unless it's hidden, a workout with steps is sent to the user's connected devices (Garmin, Wahoo, COROS, Zwift, Hammerhead). deviceSyncs tells you what happened on each one.

When you create it for one of your athletes, it's added to the workspace where you coach them. If you coach them in several workspaces, send workspaceId.

Responds with:

  • 404 not_found: the collection isn't yours, workspaceId isn't a workspace where you coach this athlete, or the user doesn't exist or isn't one of your athletes.
  • 403 subscription_required: the user (or you, for me) doesn't have an active Vekta subscription.
  • 400 bad_request: title or sport is missing (without a collection), a field, target or zones type the sport doesn't support, steps on a sport other than cycling, running and swimming, a target that needs a zone or metric the user doesn't have, workspaceId is sent for me or missing while you coach the athlete in several workspaces, or other invalid parameters or payload.
POST
/users/{userId}/training-prescriptions

Authorization

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

Path Parameters

userId*string

Id of a user you have access to (see GET /users), or me for yourself

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

trainingCollectionId?string

Id of one of your training collections (see GET /training-collections) to start from. The fields you send replace the collection's values.

date*string

Local date (YYYY-MM-DD)

Formatdate
sport?string

Required without trainingCollectionId. To change the sport of a collection with steps, also send a new structure (or structure: null).

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"
hidden?boolean

Only you can see it, and it isn't sent to the athlete's devices while it's hidden. Defaults to false.

workspaceId?string

The workspace to create it in, when the user is one of your athletes. Only needed if you coach them in several workspaces. Not accepted for me.

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"
structure?StructurePrescriptionInput | null

Send null to remove the steps.

Show attributes
One of the following 2 variants
StructurePrescriptionStepInputtype: "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?StructurePrescriptionIntensityInput

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

Show 6 attributes
power?StructurePrescriptionPowerTargetInput
Show attributes
One of the following 3 variants
Zone
zone*string

Name of one of the athlete's power zones

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?StructurePrescriptionHeartRateTargetInput
Show attributes
One of the following 3 variants
Zone
zone*string

Name of one of the athlete's heart rate zones

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?StructurePrescriptionSpeedTargetInput
Show attributes
One of the following 3 variants
Zone
zone*string

Name of one of the athlete's speed zones

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

StructurePrescriptionRepetitionInputtype: "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<StructurePrescriptionStepInput | StructurePrescriptionNestedRepetitionInput>
Items1 <= items
Show attributes
One of the following 2 variants
StructurePrescriptionStepInputtype: "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?StructurePrescriptionIntensityInput

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

Show 6 attributes
power?StructurePrescriptionPowerTargetInput
Show attributes
One of the following 3 variants
Zone
zone*string

Name of one of the athlete's power zones

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?StructurePrescriptionHeartRateTargetInput
Show attributes
One of the following 3 variants
Zone
zone*string

Name of one of the athlete's heart rate zones

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?StructurePrescriptionSpeedTargetInput
Show attributes
One of the following 3 variants
Zone
zone*string

Name of one of the athlete's speed zones

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

StructurePrescriptionNestedRepetitionInputtype: "repetition"

A repetition inside another repetition

type*"repetition"
Value in"repetition"
nRepetitions*integer
Range1 <= value <= 9007199254740991
steps*array<StructurePrescriptionStepInput | StructurePrescriptionInnermostRepetitionInput>
Items1 <= items
Show attributes
One of the following 2 variants
StructurePrescriptionStepInputtype: "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?StructurePrescriptionIntensityInput

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

Show 6 attributes
power?StructurePrescriptionPowerTargetInput
Show attributes
One of the following 3 variants
Zone
zone*string

Name of one of the athlete's power zones

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?StructurePrescriptionHeartRateTargetInput
Show attributes
One of the following 3 variants
Zone
zone*string

Name of one of the athlete's heart rate zones

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?StructurePrescriptionSpeedTargetInput
Show attributes
One of the following 3 variants
Zone
zone*string

Name of one of the athlete's speed zones

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

StructurePrescriptionInnermostRepetitionInputtype: "repetition"

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

type*"repetition"
Value in"repetition"
nRepetitions*integer
Range1 <= value <= 9007199254740991
steps*array<StructurePrescriptionStepInput>
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?StructurePrescriptionIntensityInput

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

Show 6 attributes
power?StructurePrescriptionPowerTargetInput
Show attributes
One of the following 3 variants
Zone
zone*string

Name of one of the athlete's power zones

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?StructurePrescriptionHeartRateTargetInput
Show attributes
One of the following 3 variants
Zone
zone*string

Name of one of the athlete's heart rate zones

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?StructurePrescriptionSpeedTargetInput
Show attributes
One of the following 3 variants
Zone
zone*string

Name of one of the athlete's speed zones

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

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"
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.

elevationGain?integer | null

In meters. Only for sports with an elevation gain

work?integer | null

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

time?string | null
title?string
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
carbIntake?number | null

In g/h. Only for endurance sports. If you don't send it, Vekta can estimate it from the steps. See Workout structure.

Value in10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 110 | 120

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/users/me/training-prescriptions" \  -H "Content-Type: application/json" \  -d '{    "date": "2026-08-12"  }'
{  "trainingPrescription": {    "id": "tpr_01JK4W2N9XQ3F5H7B8C6D2E9GT",    "prescribedBy": "usr_01JGXW3KQ2B8C4D5E6F7G8H9J0",    "workspaceId": "wke_01JGXW3KQ2B8C4D5E6F7G8H9J0",    "hidden": false,    "date": "2026-08-12",    "time": "06:30:00",    "title": "3 x 12 min threshold",    "description": null,    "sport": "cycling",    "subSport": "road",    "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",    "distance": null,    "duration": 4500,    "freeDuration": 600,    "elevationGain": null,    "averagePower": 210,    "work": 950,    "calories": 980,    "rpe": 7,    "carbIntake": 60,    "comment": null,    "activityId": null  },  "deviceSyncs": [    {      "provider": "garmin",      "action": "created",      "succeeded": true,      "message": "Pushed to the device."    }  ]}