Vekta API
Training prescriptions

Update a training prescription

Changes a prescription. Fields you don't send stay the same.

New steps are converted with the user's current zones and metrics. Some fields can't be changed while the steps decide them: see Workout structure.

Changes are sent to the workout on the user's devices. deviceSyncs tells you what happened on each one.

Responds with:

  • 404 not_found: the prescription doesn't exist, or isn't yours or one of your athletes'.
  • 403 subscription_required: that user doesn't have an active Vekta subscription.
  • 403 forbidden: the prescription was created in a workspace where you aren't a coach or admin, or someone other than its creator changes hidden.
  • 400 bad_request: an empty payload, a field, target or zones type the sport doesn't support, a duration, distance or work that can't be changed, a sport change without a new structure, a target that needs a zone or metric the user doesn't have, or other invalid parameters or payload.
PATCH
/training-prescriptions/{trainingPrescriptionId}

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

trainingPrescriptionId*string

Id of a training prescription, from GET /users/{userId}/training-prescriptions

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Properties1 <= properties
date?string

Local date (YYYY-MM-DD)

Formatdate
sport?string

Fields the new sport doesn't have are reset, unless you send them. If the prescription has 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 the prescription's creator can change this. Unhiding sends the workout to the athlete's devices, and hiding removes it.

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 PATCH "https://example.com/training-prescriptions/tpr_01JK4W2N9XQ3F5H7B8C6D2E9GT" \  -H "Content-Type: application/json" \  -d '{}'
{  "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."    }  ]}