Workouts Update - TrainingPeaks/PartnersAPI GitHub Wiki

Allows a coach or athlete to alter any future workouts that are not completed on an athlete’s calendar.

  • Resource endpoint: /v2/workouts/plan/{id}
  • HTTP Method: PUT
  • OAuth Scope Required: workouts:plan
  • Input:
    • Workout Object
      • The endpoint expects a full workout object; any missing or null fields will be overwritten as null.
      • The workout id: Required.
      • The athlete id: Required.
      • The workout day: Required.
        • The workout day cannot be more than 7 days in the past or more than a year in the future.
        • For updating planned start time, please use StartTimePlanned
      • The workout type: Required.
        • valid types: swim, bike, run, x-train, mtb, strength, xc-ski, rowing, walk, other

Example:

Testing:
https://api.sandbox.trainingpeaks.com/v2/workouts/plan/{id}

Production:
https://api.trainingpeaks.com/v2/workouts/plan/{id}

Example of how to format your data.

{
   "Id": 123456, 
   "AthleteId": "134129",
   "Title": "Example Plan",
   "WorkoutDay": "2017-06-26T00:00:00",
   "TotalTimePlanned": "1",
   "WorkoutType": "run",
   "Structure": "[ { \"IntensityClass\": \"WarmUp\", \"Name\": \"Warm up\", \"Length\": { \"Unit\": \"Second\", \"Value\": 600 }, \"Type\": \"Step\", \"IntensityTarget\": { \"Unit\": \"PercentOfThresholdHr\", \"Value\": 75, \"MinValue\": 70, \"MaxValue\": 80 } }, { \"IntensityClass\": \"Active\", \"Name\": \"Active\", \"Length\": { \"Unit\": \"Second\", \"Value\": 2095 }, \"Type\": \"Step\", \"IntensityTarget\": { \"Unit\": \"PercentOfThresholdHr\", \"Value\": 90, \"MinValue\": 80, \"MaxValue\": 100 } }, { \"Type\": \"Repetition\", \"Length\": { \"Unit\": \"Repetition\", \"Value\": 3 }, \"Steps\": [ { \"IntensityClass\": \"Active\", \"Name\": \"Hard\", \"Length\": { \"Unit\": \"Second\", \"Value\": 60 }, \"Type\": \"Step\", \"IntensityTarget\": { \"Unit\": \"PercentOfThresholdHr\", \"Value\": 115 }, \"CadenceTarget\": { \"Unit\": \"rpm\", \"MinValue\": 70,            \"MaxValue\": 80 } }, { \"IntensityClass\": \"Rest\", \"Name\": \"Easy\", \"Length\": { \"Unit\": \"Second\", \"Value\": 60 }, \"Type\": \"Step\",          \"IntensityTarget\": { \"Unit\": \"PercentOfThresholdHr\", \"Value\": 70 } } ] }, { \"IntensityClass\": \"CoolDown\", \"Name\": \"Cool Down\",      \"Length\": { \"Unit\": \"Second\", \"Value\": 600 }, \"Type\": \"Step\", \"IntensityTarget\": { \"Unit\": \"PercentOfThresholdHr\", \"Value\": 75 },      \"OpenDuration\": true }]"
}