Loki Docs
Tools › Workouts › End the active workout

End the active workout

end_workoutAdds
What it does
Adds a new record and leaves what you had alone. Safe to retry: the same call twice changes nothing more.
Permission
Workouts, change workouts:write

What your assistant is told

End the user's in-progress workout. By default it ends now; pass endedAt when the user finished earlier and forgot to end it ("I left the gym at 7") so the duration is honest. Fails if there is no workout in progress. To change the end time of a workout that is ALREADY ended, use update_workout with endedAt instead. Returns the ended session.

Parameters

  • endedAtdate and time, optionalWhen the workout actually finished, as an absolute date/time. Resolve relative phrases ("an hour ago") yourself. Omit (null) to end it now; cannot be in the future or before the workout started.
  • 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.