Loki Docs
Tools › Workouts › Update a logged set

Update a logged set

update_setChanges
What it does
Changes or deletes something you had. Your assistant can ask you to confirm first. Safe to retry: the same call twice changes nothing more.
Permission
Workouts, change workouts:write

What your assistant is told

Correct one already-logged set — fix a fat-fingered weight, reps, hold, distance, RPE, side or set type. This is a FULL replacement of the set's mutable fields: pass the complete corrected set exactly as you would to log_set, including type (defaults to Normal). Anything you omit is CLEARED, not preserved. Identify the set by its setId — the id on a set inside get_workout. Works on BOTH the in-progress workout and past COMPLETED workouts: fixing a mislogged set on a finished workout is correcting the user's own data, not falsifying it. To add a brand-new set use log_set; to remove a set use delete_set. Returns the updated session. THE SET FOLLOWS THE EXERCISE. get_exercise tells you how, and a set that disagrees is refused rather than stored wrong. - trackingMode says WHICH NUMBER the set carries, and only that one: "reps" → reps; "seconds" → durationSeconds (a plank is a 60-SECOND hold, never 60 reps); "distance" → distanceM, in metres. - loadMode says HOW THE ONE WEIGHT READS: "weight" — the weight entered is the load. "bodyweight_plus" — the load is the user's bodyweight PLUS what you pass, so pass only what was ADDED (a push-up in a 10 kg vest is weightKg: 10), and omit it for a plain set. "bodyweight_signed" — the same, and it also takes ASSISTANCE as a NEGATIVE: one exercise from an assist machine to a weight belt, so a pull-up with a 20 kg belt is weightKg: 20, the same pull-up on a machine set to 20 kg is weightKg: -20, and a strict one omits it. "band" — the weight is an ESTIMATE of the band's tension, not a load: pass the kilograms the band is worth if the user names them and omit it otherwise. "bodyweight" and "none" take no weight at all and refuse one. ("assisted" is retired: a few old rows still read it as bodyweight MINUS a positive counterweight.) - unilateral: true means one limb at a time, so each side is its own set with its own side. Anything else refuses a side. Volume, e1RM and the user's records are all computed from the load read this way, against their bodyweight at the time; with no weigh-in on record a bodyweight-based set counts as a set and adds no kilograms. A "band" set counts as a set and ranks that exercise's own records, and its estimate is never summed into volume, tonnage or a muscle total (D21).

Parameters

  • sessionIdid, requiredSession UUID from list_workouts / get_workout.
  • setIdid, requiredSet UUID — the id on a set inside get_workout.
  • weightKgnumber, optionalThe set's one weight, in kilograms, read through the exercise's loadMode: the load itself for "weight", what was ADDED for "bodyweight_plus" and "bodyweight_signed". On "bodyweight_signed" pass a NEGATIVE weightKg for assistance — -20 is an assist machine set to 20 kg, 20 is a 20 kg belt, and a strict rep omits it. On "band" it is an ESTIMATE of the band's tension (≈ kg), optional, and never added to volume. A negative is REFUSED on every loadMode but "bodyweight_signed", and "bodyweight" / "none" refuse a weight at all. Omitting CLEARS any previous weight.
  • repswhole number, optionalRepetitions performed — the measure of a reps exercise. Omitting CLEARS any previous value.
  • typetext, optionalSet type: Normal | Warmup | Drop | Failure (case-insensitive). Default Normal — pass the set's real type; this overwrites it.
  • rpenumber, optionalRate of Perceived Exertion, 0-10. Omitting CLEARS any previous value.
  • durationSecondswhole number, optionalThe hold in seconds — the measure of a seconds exercise. Omitting CLEARS it, so restate it when correcting something else about the set.
  • distanceMnumber, optionalThe distance in METRES — the measure of a distance exercise. Omitting CLEARS it.
  • sidetext, optional"left" or "right" on a unilateral exercise; refused on any other. Omitting CLEARS it.
  • clientHandletext, optionalOptional client_handle from list_clients to run this tool against a coached client's data instead of your own. Omit (or pass null) for your own data — the legacy default.