Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jaimegayo/KERNDOCUMENTATION/llms.txt
Use this file to discover all available pages before exploring further.
POST /workouts/finish is the single endpoint in the workouts group. It persists a completed training session to the workout_sessions table so that the user’s history and progression data remain available across devices and sessions.
Auth required: Yes
How it fits into the training flow
When a user finishes a workout in the Android app, theWorkoutActiveFragment calls this endpoint with a full snapshot of what was performed. The API stores this snapshot in the data_json column as raw JSON.
Later, when GET /routines/{routine_id} is called, the API finds the most recent WorkoutSession whose routine_name matches the routine and uses data_json to populate the anterior, prev_kilos, and prev_reps fields — giving the user a clear view of their previous performance for each set.
POST /workouts/finish
Request body
The display name of the routine that was performed. Must match the
name field in the routines table exactly (case-insensitive, whitespace-trimmed) so that GET /routines/{id} can correlate sessions with routines for progression display.Total elapsed time of the workout session in seconds, as measured by the Android timer.
Total training volume in kg, calculated as the sum of
kilos × reps for every set completed during the session.Step count recorded by the Android
StepCounterService during the session. Defaults to 0 if the step counter was unavailable or the user denied the permission.Full snapshot of every exercise and set performed. This array is stored verbatim and later read back by the routine detail endpoint to provide historical progression data.
Response — 200
Always
"success" when the session is saved successfully."Entrenamiento guardado en el historial"Errors
| Status | detail | Cause |
|---|---|---|
401 | "No se pudo validar el token de acceso" | Missing or expired Bearer token |
500 | Internal server error message | Database write failure — the transaction is rolled back |