Skip to main content

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.

All routine endpoints require a valid JWT Bearer token. The API enforces ownership — users can only read, update, or delete their own routines.

POST /routines/create

Creates a new routine with its exercises and series in a single atomic transaction. Auth required: Yes

Request body

user_id
integer
required
The ID of the authenticated user. Must match the token’s owner.
nombre
string
required
Display name for the routine (e.g., "Día A — Empuje").
ejercicios
object[]
required
Array of exercises to include in the routine.

Response — 200

status
string
required
Always "success" on a successful creation.
message
string
required
Human-readable confirmation message.
routine_id
integer
required
The auto-incremented ID of the newly created routine. Store this to retrieve or update the routine later.

Example

curl --request POST \
  --url https://kern-api.vercel.app/routines/create \
  --header "Authorization: Bearer <accessToken>" \
  --header "Content-Type: application/json" \
  --data '{
    "user_id": 42,
    "nombre": "Día A — Empuje",
    "ejercicios": [
      {
        "nombre": "Press de Banca",
        "series": [
          {"numSerie": 1, "kilos": 0, "reps": 10},
          {"numSerie": 2, "kilos": 0, "reps": 10},
          {"numSerie": 3, "kilos": 0, "reps": 10}
        ]
      },
      {
        "nombre": "Press Militar",
        "series": [
          {"numSerie": 1, "kilos": 0, "reps": 12},
          {"numSerie": 2, "kilos": 0, "reps": 12}
        ]
      }
    ]
  }'

GET /routines/

Returns a detailed view of a routine including exercise instructions, coaching tips, and historical progression data from the user’s most recent completed session. Auth required: Yes

Path parameters

routine_id
integer
required
The ID of the routine to retrieve.

Response — 200

id
integer
required
Routine ID.
name
string
required
Routine display name.
created_at
string
required
ISO 8601 creation timestamp.
total_exercises
integer
required
Number of exercises in this routine.
total_series
integer
required
Total number of sets across all exercises.
total_volume
number
required
Always 0.0 — the session starts fresh and volume is calculated client-side as the user logs sets.
exercises
object[]
required
kilos and reps in each serie are always returned as 0. The Android client should use prev_kilos and prev_reps to pre-fill input fields, showing the user their starting suggestion based on the previous session.

Example

curl --request GET \
  --url https://kern-api.vercel.app/routines/7 \
  --header "Authorization: Bearer <accessToken>"

PUT /routines/

Updates the routine’s name and completely replaces all its exercises. All existing exercises for this routine are deleted and re-created in a single transaction. Auth required: Yes

Path parameters

routine_id
integer
required
The ID of the routine to update.

Request body

Same shape as POST /routines/create: user_id, nombre, and ejercicios[].

Response — 200

status
string
required
Always "success" on success.
message
string
required
"Rutina actualizada correctamente"

Example

curl --request PUT \
  --url https://kern-api.vercel.app/routines/7 \
  --header "Authorization: Bearer <accessToken>" \
  --header "Content-Type: application/json" \
  --data '{
    "user_id": 42,
    "nombre": "Día A — Empuje (revisado)",
    "ejercicios": [
      {
        "nombre": "Press de Banca",
        "series": [
          {"numSerie": 1, "kilos": 0, "reps": 10},
          {"numSerie": 2, "kilos": 0, "reps": 10},
          {"numSerie": 3, "kilos": 0, "reps": 10},
          {"numSerie": 4, "kilos": 0, "reps": 10}
        ]
      }
    ]
  }'

DELETE /routines/

Permanently deletes a routine and all of its associated exercises. This action cannot be undone. SQLAlchemy cascade rules ensure all routine_exercises rows are removed automatically. Auth required: Yes

Path parameters

routine_id
integer
required
The ID of the routine to delete.

Response — 200

status
string
required
Always "success" on success.
message
string
required
"Rutina eliminada correctamente"

Errors

StatusdetailCause
404"Rutina no encontrada o no tienes permiso para eliminarla"No routine with this ID exists for the authenticated user

Example

curl --request DELETE \
  --url https://kern-api.vercel.app/routines/7 \
  --header "Authorization: Bearer <accessToken>"

Build docs developers (and LLMs) love