Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Lokhy87/gymApp/llms.txt

Use this file to discover all available pages before exploring further.

The workout endpoints let an authenticated user log, edit, and remove individual workout entries. Every entry records a single exercise performed with a specific number of sets, reps, and optional weight. The server always sets the timestamp to the moment of creation — clients cannot supply a custom date. All three endpoints require a valid JWT. See Authentication for how to obtain a token.

Create a workout

Logs a new workout entry for the authenticated user. POST /api/workouts
exercise_id
integer
required
The ID of the exercise performed. Must match an existing exercise from GET /api/exercises.
sets
integer
required
Number of sets completed.
reps
integer
required
Number of repetitions per set.
weight
float
Weight used in kilograms (or any consistent unit). Defaults to 0 if omitted.
comments
string
Optional free-text notes about the set (e.g. form cues, perceived effort).
Example request
curl -X POST https://api.gymflow.example/api/workouts \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "exercise_id": 1,
    "sets": 4,
    "reps": 8,
    "weight": 80.0,
    "comments": "Felt strong today"
  }'
Example response — 201 Created
{
  "message": "Workout created successfully",
  "workout_id": 317
}
message
string
Confirmation string. Always "Workout created successfully" on success.
workout_id
integer
The auto-generated ID of the new workout entry. Use this to update or delete the entry later.
Error responses
StatusMeaning
400Request body is not valid JSON, or exercise_id, sets, or reps is missing.
401Missing or invalid Bearer token.
404No exercise found with the given exercise_id.

Update a workout

Updates one or more fields of an existing workout entry. Only the entry’s owner may update it. All fields are optional; omitted fields retain their current values. PUT /api/workouts/{id}
id
integer
required
The ID of the workout entry to update, as returned by POST /api/workouts.
sets
integer
Updated number of sets.
reps
integer
Updated number of repetitions.
weight
float
Updated weight value.
comments
string
Updated comments.
Example request
curl -X PUT https://api.gymflow.example/api/workouts/317 \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "reps": 10,
    "weight": 82.5
  }'
Example response — 200 OK
{
  "message": "Workout updated"
}
message
string
Confirmation string. Always "Workout updated" on success.
The API returns 403 Forbidden if you attempt to update a workout entry that belongs to a different user. Only the user who created the entry can modify it.
Error responses
StatusMeaning
401Missing or invalid Bearer token.
403The workout exists but was created by a different user.
404No workout found with the given id.

Delete a workout

Permanently removes a workout entry. Only the entry’s owner may delete it. DELETE /api/workouts/{id}
id
integer
required
The ID of the workout entry to delete.
Example request
curl -X DELETE https://api.gymflow.example/api/workouts/317 \
  -H "Authorization: Bearer <your_token>"
Example response — 200 OK
{
  "message": "Workout deleted"
}
message
string
Confirmation string. Always "Workout deleted" on success.
The API returns 403 Forbidden if you attempt to delete a workout entry that belongs to a different user. Deletion is permanent and cannot be undone.
Error responses
StatusMeaning
401Missing or invalid Bearer token.
403The workout exists but was created by a different user.
404No workout found with the given id.

Build docs developers (and LLMs) love