{"openapi":"3.0.0","info":{"title":"Hevy Public API Docs","version":"0.0.1"},"servers":[{"url":"https://api.hevyapp.com"}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"api-key"},"oauth":{"type":"http","scheme":"bearer"}},"schemas":{"PostWorkoutsRequestSet":{"type":"object","properties":{"type":{"type":"string","description":"The type of the set.","enum":["warmup","normal","failure","dropset"],"example":"normal"},"weight_kg":{"type":"number","nullable":true,"description":"The weight in kilograms.","example":100},"reps":{"type":"integer","nullable":true,"description":"The number of repetitions.","example":10},"distance_meters":{"type":"integer","nullable":true,"description":"The distance in meters.","example":null},"duration_seconds":{"type":"integer","nullable":true,"description":"The duration in seconds.","example":null},"custom_metric":{"type":"number","nullable":true,"description":"A custom metric for the set. Currently used for steps and floors.","example":null},"rpe":{"type":"number","nullable":true,"description":"The Rating of Perceived Exertion (RPE).","enum":[6,7,7.5,8,8.5,9,9.5,10],"example":null}}},"PostWorkoutsRequestExercise":{"type":"object","properties":{"exercise_template_id":{"type":"string","description":"The ID of the exercise template.","example":"D04AC939"},"superset_id":{"type":"integer","nullable":true,"description":"The ID of the superset.","example":null},"notes":{"type":"string","nullable":true,"description":"Additional notes for the exercise.","example":"Felt good today. Form was on point."},"sets":{"type":"array","items":{"$ref":"#/components/schemas/PostWorkoutsRequestSet"}}}},"PostWorkoutsRequestBody":{"type":"object","required":["workout"],"properties":{"workout":{"type":"object","required":["title","start_time","end_time","exercises"],"properties":{"title":{"type":"string","description":"The title of the workout.","example":"Friday Leg Day 🔥"},"description":{"type":"string","nullable":true,"description":"A description for the workout workout.","example":"Medium intensity leg day focusing on quads."},"start_time":{"type":"string","description":"The time the workout started.","example":"2024-08-14T12:00:00Z"},"end_time":{"type":"string","description":"The time the workout ended.","example":"2024-08-14T12:30:00Z"},"is_private":{"type":"boolean","description":"A boolean indicating if the workout is private. Optional - defaults to false when omitted.","default":false,"example":false},"exercises":{"type":"array","items":{"$ref":"#/components/schemas/PostWorkoutsRequestExercise"}}}}}},"PostRoutinesRequestSet":{"type":"object","properties":{"type":{"type":"string","description":"The type of the set.","enum":["warmup","normal","failure","dropset"],"example":"normal"},"weight_kg":{"type":"number","nullable":true,"description":"The weight in kilograms.","example":100},"reps":{"type":"integer","nullable":true,"description":"The number of repetitions.","example":10},"distance_meters":{"type":"integer","nullable":true,"description":"The distance in meters.","example":null},"duration_seconds":{"type":"integer","nullable":true,"description":"The duration in seconds.","example":null},"custom_metric":{"type":"number","nullable":true,"description":"A custom metric for the set. Currently used for steps and floors.","example":null},"rep_range":{"type":"object","nullable":true,"description":"Range of reps for the set, if applicable","properties":{"start":{"type":"number","description":"Starting rep count for the range","example":8},"end":{"type":"number","description":"Ending rep count for the range","example":12}}}}},"PostRoutinesRequestExercise":{"type":"object","properties":{"exercise_template_id":{"type":"string","description":"The ID of the exercise template.","example":"D04AC939"},"superset_id":{"type":"integer","nullable":true,"description":"The ID of the superset.","example":null},"rest_seconds":{"type":"integer","nullable":true,"description":"The rest time in seconds.","example":90},"notes":{"type":"string","nullable":true,"description":"Additional notes for the exercise.","example":"Stay slow and controlled."},"sets":{"type":"array","items":{"$ref":"#/components/schemas/PostRoutinesRequestSet"}}}},"PostRoutinesRequestBody":{"type":"object","properties":{"routine":{"type":"object","properties":{"title":{"type":"string","description":"The title of the routine.","example":"April Leg Day 🔥"},"folder_id":{"type":"number","nullable":true,"description":"The folder id the routine should be added to. Pass null to insert the routine into default \"My Routines\" folder","example":null},"notes":{"type":"string","description":"Additional notes for the routine.","example":"Focus on form over weight. Remember to stretch."},"exercises":{"type":"array","items":{"$ref":"#/components/schemas/PostRoutinesRequestExercise"}}}}}},"PutRoutinesRequestSet":{"type":"object","properties":{"type":{"type":"string","description":"The type of the set.","enum":["warmup","normal","failure","dropset"],"example":"normal"},"weight_kg":{"type":"number","nullable":true,"description":"The weight in kilograms.","example":100},"reps":{"type":"integer","nullable":true,"description":"The number of repetitions.","example":10},"distance_meters":{"type":"integer","nullable":true,"description":"The distance in meters.","example":null},"duration_seconds":{"type":"integer","nullable":true,"description":"The duration in seconds.","example":null},"custom_metric":{"type":"number","nullable":true,"description":"A custom metric for the set. Currently used for steps and floors.","example":null},"rep_range":{"type":"object","nullable":true,"description":"Range of reps for the set, if applicable","properties":{"start":{"type":"number","nullable":true,"description":"Starting rep count for the range","example":8},"end":{"type":"number","nullable":true,"description":"Ending rep count for the range","example":12}}}}},"PutRoutinesRequestExercise":{"type":"object","properties":{"exercise_template_id":{"type":"string","description":"The ID of the exercise template.","example":"D04AC939"},"superset_id":{"type":"integer","nullable":true,"description":"The ID of the superset.","example":null},"rest_seconds":{"type":"integer","nullable":true,"description":"The rest time in seconds.","example":90},"notes":{"type":"string","nullable":true,"description":"Additional notes for the exercise.","example":"Stay slow and controlled."},"sets":{"type":"array","items":{"$ref":"#/components/schemas/PutRoutinesRequestSet"}}}},"PutRoutinesRequestBody":{"type":"object","properties":{"routine":{"type":"object","properties":{"title":{"type":"string","description":"The title of the routine.","example":"April Leg Day 🔥"},"folder_id":{"type":"number","nullable":true,"description":"The folder id the routine should be added to. Pass null to insert the routine into default \"My Routines\" folder","example":null},"notes":{"type":"string","nullable":true,"description":"Additional notes for the routine.","example":"Focus on form over weight. Remember to stretch."},"exercises":{"type":"array","items":{"$ref":"#/components/schemas/PutRoutinesRequestExercise"}}}}}},"PostRoutineFolderRequestBody":{"type":"object","properties":{"routine_folder":{"type":"object","properties":{"title":{"type":"string","description":"The title of the routine folder.","example":"Push Pull 🏋️‍♂️"}}}}},"BodyMeasurement":{"type":"object","required":["date"],"properties":{"date":{"type":"string","format":"date","example":"2024-08-14"},"weight_kg":{"type":"number","nullable":true,"example":80.5},"lean_mass_kg":{"type":"number","nullable":true,"example":65},"fat_percent":{"type":"number","nullable":true,"example":18.5},"neck_cm":{"type":"number","nullable":true,"example":38},"shoulder_cm":{"type":"number","nullable":true,"example":115},"chest_cm":{"type":"number","nullable":true,"example":95},"left_bicep_cm":{"type":"number","nullable":true,"example":35},"right_bicep_cm":{"type":"number","nullable":true,"example":35.5},"left_forearm_cm":{"type":"number","nullable":true,"example":28},"right_forearm_cm":{"type":"number","nullable":true,"example":28.5},"abdomen":{"type":"number","nullable":true,"example":85},"waist":{"type":"number","nullable":true,"example":80},"hips":{"type":"number","nullable":true,"example":95},"left_thigh":{"type":"number","nullable":true,"example":55},"right_thigh":{"type":"number","nullable":true,"example":55.5},"left_calf":{"type":"number","nullable":true,"example":37},"right_calf":{"type":"number","nullable":true,"example":37.5},"picture_url":{"type":"string","nullable":true,"readOnly":true,"description":"URL of the progress picture. Upload one with PUT /v1/body_measurements/{date}/image.","example":"https://d2l9nsnmtah87f.cloudfront.net/profile-images/username-0b9f4d6e-6a0f-4c8e-9f5d-2a1b3c4d5e6f.jpg"}}},"PutBodyMeasurement":{"type":"object","properties":{"weight_kg":{"type":"number","nullable":true,"example":80.5},"lean_mass_kg":{"type":"number","nullable":true,"example":65},"fat_percent":{"type":"number","nullable":true,"example":18.5},"neck_cm":{"type":"number","nullable":true,"example":38},"shoulder_cm":{"type":"number","nullable":true,"example":115},"chest_cm":{"type":"number","nullable":true,"example":95},"left_bicep_cm":{"type":"number","nullable":true,"example":35},"right_bicep_cm":{"type":"number","nullable":true,"example":35.5},"left_forearm_cm":{"type":"number","nullable":true,"example":28},"right_forearm_cm":{"type":"number","nullable":true,"example":28.5},"abdomen":{"type":"number","nullable":true,"example":85},"waist":{"type":"number","nullable":true,"example":80},"hips":{"type":"number","nullable":true,"example":95},"left_thigh":{"type":"number","nullable":true,"example":55},"right_thigh":{"type":"number","nullable":true,"example":55.5},"left_calf":{"type":"number","nullable":true,"example":37},"right_calf":{"type":"number","nullable":true,"example":37.5}}},"Set":{"type":"object","properties":{"index":{"type":"number","description":"Index indicating the order of the set in the workout.","example":0},"type":{"type":"string","description":"The type of set. This can be one of 'normal', 'warmup', 'dropset', 'failure'","example":"normal"},"weight_kg":{"type":"number","nullable":true,"description":"Weight lifted in kilograms.","example":100},"reps":{"type":"number","nullable":true,"description":"Number of reps logged for the set","example":10},"distance_meters":{"type":"number","nullable":true,"description":"Number of meters logged for the set","example":null},"duration_seconds":{"type":"number","nullable":true,"description":"Number of seconds logged for the set","example":null},"rpe":{"type":"number","nullable":true,"description":"RPE (Relative perceived exertion) value logged for the set","example":9.5},"custom_metric":{"type":"number","nullable":true,"description":"Custom metric logged for the set (Currently only used to log floors or steps for stair machine exercises)","example":50}}},"Exercise":{"type":"object","properties":{"index":{"type":"number","description":"Index indicating the order of the exercise in the workout.","example":0},"title":{"type":"string","description":"Title of the exercise","example":"Bench Press (Barbell)"},"notes":{"type":"string","description":"Notes on the exercise","example":"Paid closer attention to form today. Felt great!"},"exercise_template_id":{"type":"string","description":"The id of the exercise template. This can be used to fetch the exercise template.","example":"05293BCA"},"superset_id":{"type":"number","nullable":true,"description":"The id of the superset that the exercise belongs to. A value of null indicates the exercise is not part of a superset.","example":0},"sets":{"type":"array","items":{"$ref":"#/components/schemas/Set"}}}},"ExerciseHistoryEntry":{"type":"object","properties":{"workout_id":{"type":"string","description":"The workout ID","example":"b459cba5-cd6d-463c-abd6-54f8eafcadcb"},"workout_title":{"type":"string","description":"The workout title","example":"Morning Workout 💪"},"workout_start_time":{"type":"string","description":"ISO 8601 timestamp of when the workout was recorded to have started.","example":"2024-01-01T12:00:00Z"},"workout_end_time":{"type":"string","description":"ISO 8601 timestamp of when the workout was recorded to have ended.","example":"2024-01-01T13:00:00Z"},"exercise_template_id":{"type":"string","description":"The exercise template ID","example":"D04AC939"},"weight_kg":{"type":"number","nullable":true,"description":"The weight in kilograms","example":100},"reps":{"type":"integer","nullable":true,"description":"The number of repetitions","example":10},"distance_meters":{"type":"integer","nullable":true,"description":"The distance in meters","example":null},"duration_seconds":{"type":"integer","nullable":true,"description":"The duration in seconds","example":null},"rpe":{"type":"number","nullable":true,"description":"The Rating of Perceived Exertion","example":8.5},"custom_metric":{"type":"number","nullable":true,"description":"A custom metric for the set","example":null},"set_type":{"type":"string","description":"The type of set (warmup, normal, failure, dropset)","example":"normal"}}},"CustomExerciseType":{"type":"enum","enum":["weight_reps","reps_only","bodyweight_reps","bodyweight_assisted_reps","duration","weight_duration","distance_duration","short_distance_weight"],"example":"weight_reps"},"MuscleGroup":{"type":"enum","enum":["abdominals","shoulders","biceps","triceps","forearms","quadriceps","hamstrings","calves","glutes","abductors","adductors","lats","upper_back","traps","lower_back","chest","cardio","neck","full_body","other"],"example":"chest"},"EquipmentCategory":{"type":"enum","enum":["none","barbell","dumbbell","kettlebell","machine","plate","resistance_band","suspension","other"],"example":"barbell"},"ExerciseTemplate":{"type":"object","properties":{"id":{"type":"string","description":"The exercise template ID.","example":"b459cba5-cd6d-463c-abd6-54f8eafcadcb"},"title":{"type":"string","description":"The exercise title.","example":"Bench Press (Barbell)"},"type":{"type":"string","description":"The exercise type.","example":"weight_reps"},"primary_muscle_group":{"type":"string","description":"The primary muscle group of the exercise.","example":"chest"},"secondary_muscle_groups":{"type":"array","description":"The secondary muscle groups of the exercise.","items":{"type":"string"}},"equipment":{"$ref":"#/components/schemas/EquipmentCategory"},"is_custom":{"type":"boolean","description":"A boolean indicating whether the exercise is a custom exercise.","example":false},"thumbnail_url":{"type":"string","nullable":true,"description":"URL of the exercise's thumbnail image, or null if the exercise has none.","example":null}}},"CreateCustomExerciseRequestBody":{"type":"object","properties":{"exercise":{"required":true,"type":"object","properties":{"title":{"type":"string","description":"The title of the exercise template.","example":"Bench Press"},"exercise_type":{"$ref":"#/components/schemas/CustomExerciseType"},"equipment_category":{"$ref":"#/components/schemas/EquipmentCategory","description":"The equipment category of the exercise template.","example":"barbell"},"muscle_group":{"$ref":"#/components/schemas/MuscleGroup","description":"The muscle group of the exercise template.","example":"chest"},"other_muscles":{"type":"array","items":{"$ref":"#/components/schemas/MuscleGroup"},"description":"The other muscles of the exercise template.","example":["biceps","triceps"]}}}}},"RoutineFolder":{"type":"object","properties":{"id":{"type":"number","description":"The routine folder ID.","example":42},"index":{"type":"number","description":"The routine folder index. Describes the order of the folder in the list.","example":1},"title":{"type":"string","description":"The routine folder title.","example":"Push Pull 🏋️‍♂️"},"updated_at":{"type":"string","description":"ISO 8601 timestamp of when the folder was last updated.","example":"2021-09-14T12:00:00Z"},"created_at":{"type":"string","description":"ISO 8601 timestamp of when the folder was created.","example":"2021-09-14T12:00:00Z"}}},"Routine":{"type":"object","properties":{"id":{"type":"string","description":"The routine ID.","example":"b459cba5-cd6d-463c-abd6-54f8eafcadcb"},"title":{"type":"string","description":"The routine title.","example":"Upper Body 💪"},"folder_id":{"type":"number","nullable":true,"description":"The routine folder ID.","example":42},"updated_at":{"type":"string","description":"ISO 8601 timestamp of when the routine was last updated.","example":"2021-09-14T12:00:00Z"},"created_at":{"type":"string","description":"ISO 8601 timestamp of when the routine was created.","example":"2021-09-14T12:00:00Z"},"exercises":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number","description":"Index indicating the order of the exercise in the routine.","example":0},"title":{"type":"string","description":"Title of the exercise","example":"Bench Press (Barbell)"},"rest_seconds":{"type":"integer","nullable":true,"description":"The rest time in seconds between sets of the exercise","example":60},"notes":{"type":"string","nullable":true,"description":"Routine notes on the exercise","example":"Focus on form. Go down to 90 degrees."},"exercise_template_id":{"type":"string","description":"The id of the exercise template. This can be used to fetch the exercise template.","example":"05293BCA"},"superset_id":{"type":"number","nullable":true,"description":"The id of the superset that the exercise belongs to. A value of null indicates the exercise is not part of a superset.","example":0},"sets":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number","description":"Index indicating the order of the set in the routine.","example":0},"type":{"type":"string","description":"The type of set. This can be one of 'normal', 'warmup', 'dropset', 'failure'","example":"normal"},"weight_kg":{"type":"number","nullable":true,"description":"Weight lifted in kilograms.","example":100},"reps":{"type":"number","nullable":true,"description":"Number of reps logged for the set","example":10},"rep_range":{"type":"object","nullable":true,"description":"Range of reps for the set, if applicable","properties":{"start":{"type":"number","nullable":true,"description":"Starting rep count for the range","example":8},"end":{"type":"number","nullable":true,"description":"Ending rep count for the range","example":12}}},"distance_meters":{"type":"number","nullable":true,"description":"Number of meters logged for the set","example":null},"duration_seconds":{"type":"number","nullable":true,"description":"Number of seconds logged for the set","example":null},"custom_metric":{"type":"number","nullable":true,"description":"Custom metric logged for the set (Currently only used to log floors or steps for stair machine exercises)","example":50}}}}}}}}},"UserInfo":{"type":"object","properties":{"id":{"type":"string","description":"The user ID.","example":"9c465af3-de7d-42bc-9c7c-f0170396358b"},"username":{"type":"string","description":"The user's username.","example":"jhon"},"name":{"type":"string","description":"The user's display name.","example":"John doe"},"url":{"type":"string","description":"The user's public profile URL.","example":"https://hevy.com/user/jhon"},"weight_unit":{"type":"string","enum":["kg","lbs"],"description":"The user's preferred weight unit. Defaults to kg if unset.","example":"kg"},"distance_unit":{"type":"string","enum":["kilometers","miles"],"description":"The user's preferred distance unit. Defaults to kilometers if unset.","example":"kilometers"},"is_pro":{"type":"boolean","description":"Whether the user has an active Hevy Pro subscription.","example":true}}},"UserInfoResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserInfo"}}},"WorkoutMedia":{"type":"object","required":["type","url"],"properties":{"type":{"type":"string","enum":["image","video"],"example":"image"},"url":{"type":"string","description":"URL of the image or video.","example":"https://d2l9nsnmtah87f.cloudfront.net/profile-images/username-0b9f4d6e-6a0f-4c8e-9f5d-2a1b3c4d5e6f.jpg"},"thumbnail_url":{"type":"string","description":"URL of the video thumbnail. Only present for videos.","example":"https://d2l9nsnmtah87f.cloudfront.net/workout-videos/username-0b9f4d6e-6a0f-4c8e-9f5d-2a1b3c4d5e6f.jpg"}}},"Workout":{"type":"object","properties":{"id":{"type":"string","description":"The workout ID.","example":"b459cba5-cd6d-463c-abd6-54f8eafcadcb"},"title":{"type":"string","description":"The workout title.","example":"Morning Workout 💪"},"routine_id":{"type":"string","nullable":true,"description":"The ID of the routine that this workout belongs to.","example":"b459cba5-cd6d-463c-abd6-54f8eafcadcb"},"description":{"type":"string","nullable":true,"description":"The workout description.","example":"Pushed myself to the limit today!"},"start_time":{"type":"string","description":"ISO 8601 timestamp of when the workout was recorded to have started.","example":"2021-09-14T12:00:00Z"},"end_time":{"type":"string","description":"ISO 8601 timestamp of when the workout was recorded to have ended.","example":"2021-09-14T12:00:00Z"},"updated_at":{"type":"string","description":"ISO 8601 timestamp of when the workout was last updated.","example":"2021-09-14T12:00:00Z"},"created_at":{"type":"string","description":"ISO 8601 timestamp of when the workout was created.","example":"2021-09-14T12:00:00Z"},"media":{"type":"array","description":"Images and videos attached to the workout, in display order.","items":{"$ref":"#/components/schemas/WorkoutMedia"}},"exercises":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number","description":"Index indicating the order of the exercise in the workout.","example":0},"title":{"type":"string","description":"Title of the exercise","example":"Bench Press (Barbell)"},"notes":{"type":"string","nullable":true,"description":"Notes on the exercise","example":"Paid closer attention to form today. Felt great!"},"exercise_template_id":{"type":"string","description":"The id of the exercise template. This can be used to fetch the exercise template.","example":"05293BCA"},"superset_id":{"type":"number","nullable":true,"description":"The id of the superset that the exercise belongs to. A value of null indicates the exercise is not part of a superset.","example":0},"sets":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number","description":"Index indicating the order of the set in the workout.","example":0},"type":{"type":"string","description":"The type of set. This can be one of 'normal', 'warmup', 'dropset', 'failure'","example":"normal"},"weight_kg":{"type":"number","nullable":true,"description":"Weight lifted in kilograms.","example":100},"reps":{"type":"number","nullable":true,"description":"Number of reps logged for the set","example":10},"distance_meters":{"type":"number","nullable":true,"description":"Number of meters logged for the set","example":null},"duration_seconds":{"type":"number","nullable":true,"description":"Number of seconds logged for the set","example":null},"rpe":{"type":"number","nullable":true,"description":"RPE (Relative perceived exertion) value logged for the set","example":9.5},"custom_metric":{"type":"number","nullable":true,"description":"Custom metric logged for the set (Currently only used to log floors or steps for stair machine exercises)","example":50}}}}}}}}},"UpdatedWorkout":{"type":"object","required":["type","workout"],"properties":{"type":{"type":"string","description":"Indicates the type of the event (updated)","example":"updated"},"workout":{"$ref":"#/components/schemas/Workout"}}},"DeletedWorkout":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","description":"Indicates the type of the event (deleted)","example":"deleted"},"id":{"type":"string","description":"The unique identifier of the deleted workout","example":"efe6801c-4aee-4959-bcdd-fca3f272821b"},"deleted_at":{"type":"string","description":"A date string indicating when the workout was deleted","example":"2021-09-13T12:00:00Z"}}},"PaginatedWorkoutEvents":{"type":"object","required":["page","page_count","events"],"properties":{"page":{"type":"integer","description":"The current page number","example":1},"page_count":{"type":"integer","description":"The total number of pages available","example":5},"events":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/UpdatedWorkout"},{"$ref":"#/components/schemas/DeletedWorkout"}]},"description":"An array of workout events (either updated or deleted)"}}}}},"security":[{"apiKey":[]},{"oauth":[]}],"paths":{"/v1/workouts":{"get":{"summary":"Get a paginated list of workouts","tags":["Workouts"],"parameters":[{"in":"query","name":"page","schema":{"type":"integer","default":1},"description":"Page number (Must be 1 or greater)"},{"in":"query","name":"pageSize","schema":{"type":"integer","default":10,"maximum":10},"description":"Number of items on the requested page (Max 10)"}],"responses":{"200":{"description":"A paginated list of workouts","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","example":1,"description":"Current page number"},"page_count":{"type":"integer","example":5,"description":"Total number of pages"},"workouts":{"type":"array","items":{"$ref":"#/components/schemas/Workout"}}}}}}},"400":{"description":"Invalid page size"}}},"post":{"summary":"Create a new workout","tags":["Workouts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostWorkoutsRequestBody"}}}},"responses":{"201":{"description":"The workout was successfully created","content":{"application/json":{"schema":{"type":"object","properties":{"workout":{"type":"array","description":"The created workout, returned as a single-element array.","items":{"$ref":"#/components/schemas/Workout"}}}}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}}}}},"/v1/workouts/count":{"get":{"summary":"Get the total number of workouts on the account","tags":["Workouts"],"responses":{"200":{"description":"The total count of workouts","content":{"application/json":{"schema":{"type":"object","properties":{"workout_count":{"type":"integer","default":42,"description":"The total number of workouts"}}}}}}}}},"/v1/workouts/events":{"get":{"summary":"Retrieve a paged list of workout events (updates or deletes) since a given date. Events are ordered from newest to oldest. The intention is to allow clients to keep their local cache of workouts up to date without having to fetch the entire list of workouts.","tags":["Workouts"],"parameters":[{"in":"query","name":"page","schema":{"type":"integer","default":1},"description":"Page number (Must be 1 or greater)"},{"in":"query","name":"pageSize","schema":{"type":"integer","default":10,"maximum":10},"description":"Number of items on the requested page (Max 10)"},{"in":"query","name":"since","schema":{"type":"string","default":"1970-01-01T00:00:00Z"}}],"description":"Returns a paginated array of workout events, indicating updates or deletions.","responses":{"200":{"description":"A paginated list of workout events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedWorkoutEvents"}}}},"500":{"description":"Internal Server Error"}}}},"/v1/workouts/{workoutId}":{"get":{"tags":["Workouts"],"summary":"Get a single workout’s complete details by the workoutId","parameters":[{"name":"workoutId","in":"path","description":"The id of the workout","required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workout"}}}},"404":{"description":"Workout not found"}}},"put":{"summary":"Update an existing workout","tags":["Workouts"],"parameters":[{"in":"path","name":"workoutId","description":"The id of the workout","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostWorkoutsRequestBody"}}}},"responses":{"200":{"description":"The workout was successfully updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workout"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}}}}},"/v1/user/info":{"get":{"summary":"Get user info","tags":["Users"],"responses":{"200":{"description":"The authenticated user's info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfoResponse"}}}},"404":{"description":"User not found"}}}},"/v1/workouts/{workoutId}/images":{"post":{"summary":"Upload an image to a workout. The image is added after the workout's existing media. A workout can have up to 3 images and videos in total.","tags":["Workouts"],"parameters":[{"in":"path","name":"workoutId","description":"The id of the workout","required":true}],"requestBody":{"required":true,"description":"The image file as the raw request body, up to 10 MB and 50 megapixels. It is converted to JPEG and resized to fit within 800x800 pixels.","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"The image was added to the workout. Returns the updated workout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workout"}}}},"400":{"description":"The body is not a valid image, or the workout already has 3 images and videos","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Workout not found"},"413":{"description":"The image is larger than 10 MB"},"415":{"description":"The Content-Type is not image/jpeg, image/png or image/webp"}}}},"/v1/routines":{"get":{"summary":"Get a paginated list of routines","tags":["Routines"],"parameters":[{"in":"query","name":"page","schema":{"type":"integer","default":1},"description":"Page number (Must be 1 or greater)"},{"in":"query","name":"pageSize","schema":{"type":"integer","default":10,"maximum":10},"description":"Number of items on the requested page (Max 10)"}],"responses":{"200":{"description":"A paginated list of routines","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","example":1,"description":"Current page number"},"page_count":{"type":"integer","example":5,"description":"Total number of pages"},"routines":{"type":"array","items":{"$ref":"#/components/schemas/Routine"}}}}}}},"400":{"description":"Invalid page size"}}},"post":{"summary":"Create a new routine","tags":["Routines"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostRoutinesRequestBody"}}}},"responses":{"201":{"description":"The routine was successfully created","content":{"application/json":{"schema":{"type":"object","properties":{"routine":{"$ref":"#/components/schemas/Routine"}}}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}},"403":{"description":"Routine limit exceeded. Free accounts can have up to 4 routines (routines inside programs don't count). Upgrade to Hevy Pro to create more.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code","example":"routine-limit-exceeded"},"message":{"type":"string","description":"Human-readable explanation","example":"Free accounts are limited to 4 routines. Upgrade to Hevy Pro (https://hevy.com/plans) to create more."}}}}}}}}},"/v1/routines/{routineId}":{"get":{"summary":"Get a routine by its Id","tags":["Routines"],"parameters":[{"in":"path","name":"routineId","description":"The id of the routine","required":true}],"responses":{"200":{"description":"The routine with the provided id","content":{"application/json":{"schema":{"type":"object","properties":{"routine":{"$ref":"#/components/schemas/Routine"}}}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}}}},"put":{"summary":"Update an existing routine","tags":["Routines"],"parameters":[{"in":"path","name":"routineId","description":"The id of the routine","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutRoutinesRequestBody"}}}},"responses":{"200":{"description":"The routine was successfully updated","content":{"application/json":{"schema":{"type":"object","properties":{"routine":{"$ref":"#/components/schemas/Routine"}}}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}},"404":{"description":"Routine doesn't exist or doesn't belong to the user","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}}}}},"/v1/exercise_templates":{"get":{"summary":"Get a paginated list of exercise templates available on the account.","tags":["ExerciseTemplates"],"parameters":[{"in":"query","name":"page","schema":{"type":"integer","default":1},"description":"Page number (Must be 1 or greater)"},{"in":"query","name":"pageSize","schema":{"type":"integer","default":100,"maximum":100},"description":"Number of items on the requested page (Max 100)"}],"responses":{"200":{"description":"A paginated list of exercise templates","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","default":1,"description":"Current page number"},"page_count":{"type":"integer","default":5,"description":"Total number of pages"},"exercise_templates":{"type":"array","items":{"$ref":"#/components/schemas/ExerciseTemplate"}}}}}}},"400":{"description":"Invalid page size"}}},"post":{"summary":"Create a new custom exercise template.","tags":["ExerciseTemplates"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomExerciseRequestBody"}}},"description":"The exercise template to create."},"responses":{"200":{"description":"The exercise template was successfully created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"The ID of the exercise template","example":123}}}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message","example":"Invalid request body"}}}}}},"403":{"description":"Custom exercise limit exceeded. Free accounts can have up to 7 custom exercises. Upgrade to Hevy Pro to create more.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error code","example":"exceeds-custom-exercise-limit"},"message":{"type":"string","description":"Human-readable explanation","example":"Free accounts are limited to 7 custom exercises. Upgrade to Hevy Pro (https://hevy.com/plans) to create more."}}}}}}}}},"/v1/exercise_templates/{exerciseTemplateId}":{"get":{"tags":["ExerciseTemplates"],"summary":"Get a single exercise template by id.","parameters":[{"name":"exerciseTemplateId","in":"path","description":"The id of the exercise template","required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExerciseTemplate"}}}},"404":{"description":"Exercise template not found"}}}},"/v1/routine_folders":{"get":{"summary":"Get a paginated list of routine folders available on the account.","tags":["RoutineFolders"],"parameters":[{"in":"query","name":"page","schema":{"type":"integer","default":1},"description":"Page number (Must be 1 or greater)"},{"in":"query","name":"pageSize","schema":{"type":"integer","default":10,"maximum":10},"description":"Number of items on the requested page (Max 10)"}],"responses":{"200":{"description":"A paginated list of routine folders","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","default":1,"description":"Current page number"},"page_count":{"type":"integer","default":5,"description":"Total number of pages"},"routine_folders":{"type":"array","items":{"$ref":"#/components/schemas/RoutineFolder"}}}}}}},"400":{"description":"Invalid page size"}}},"post":{"summary":"Create a new routine folder. The folder will be created at index 0, and all other folders will have their indexes incremented.","tags":["RoutineFolders"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostRoutineFolderRequestBody"}}}},"responses":{"201":{"description":"The routine folder was successfully created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutineFolder"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}}}}},"/v1/routine_folders/{folderId}":{"get":{"tags":["RoutineFolders"],"summary":"Get a single routine folder by id.","parameters":[{"name":"folderId","in":"path","description":"The id of the routine folder","required":true}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutineFolder"}}}},"404":{"description":"Routine folder not found"}}}},"/v1/exercise_history/{exerciseTemplateId}":{"get":{"summary":"Get exercise history for a specific exercise template","tags":["ExerciseHistory"],"parameters":[{"in":"path","name":"exerciseTemplateId","description":"The id of the exercise template","required":true},{"in":"query","name":"start_date","schema":{"type":"string","format":"date-time"},"description":"Optional start date for filtering exercise history (ISO 8601 format)","example":"2024-01-01T00:00:00Z","required":false},{"in":"query","name":"end_date","schema":{"type":"string","format":"date-time"},"description":"Optional end date for filtering exercise history (ISO 8601 format)","example":"2024-12-31T23:59:59Z","required":false}],"responses":{"200":{"description":"A list of exercise history entries","content":{"application/json":{"schema":{"type":"object","properties":{"exercise_history":{"type":"array","items":{"$ref":"#/components/schemas/ExerciseHistoryEntry"}}}}}}},"400":{"description":"Invalid request parameters or date format"}}}},"/v1/body_measurements":{"get":{"summary":"Get a paginated list of body measurements for the authenticated user","tags":["Measurements"],"parameters":[{"in":"query","name":"page","schema":{"type":"integer","default":1},"description":"Page number (Must be 1 or greater)"},{"in":"query","name":"pageSize","schema":{"type":"integer","default":10,"maximum":10},"description":"Number of items per page (Max 10)"}],"responses":{"200":{"description":"A paginated list of body measurements","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","example":1},"page_count":{"type":"integer","example":5},"body_measurements":{"type":"array","items":{"$ref":"#/components/schemas/BodyMeasurement"}}}}}}},"400":{"description":"Invalid page or pageSize"}}},"post":{"summary":"Create a body measurement entry for a given date. Returns 409 if an entry already exists for that date.","tags":["Measurements"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BodyMeasurement"}}}},"responses":{"201":{"description":"The measurement was successfully created. The response body is empty."},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"A measurement for this date already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/body_measurements/{date}":{"get":{"summary":"Get a single body measurement by date","tags":["Measurements"],"parameters":[{"in":"path","name":"date","required":true,"schema":{"type":"string","format":"date","example":"2024-01-15"},"description":"The date of the body measurement (YYYY-MM-DD)"}],"responses":{"200":{"description":"The body measurement for the given date","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BodyMeasurement"}}}},"404":{"description":"Body measurement not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"put":{"summary":"Update an existing body measurement entry for a given date. All fields are overwritten; omitted fields are set to null.","tags":["Measurements"],"parameters":[{"in":"path","name":"date","required":true,"schema":{"type":"string","format":"date","example":"2024-01-15"},"description":"The date of the measurement to update (YYYY-MM-DD)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutBodyMeasurement"}}}},"responses":{"200":{"description":"The measurement was successfully updated"},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No measurement found for the given date","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/body_measurements/{date}/image":{"put":{"summary":"Upload the progress picture for an existing body measurement entry. Replaces the entry's current picture, if any.","tags":["Measurements"],"parameters":[{"in":"path","name":"date","required":true,"schema":{"type":"string","format":"date","example":"2024-01-15"},"description":"The date of the body measurement (YYYY-MM-DD)"}],"requestBody":{"required":true,"description":"The image file as the raw request body, up to 10 MB and 50 megapixels. It is converted to JPEG and resized to fit within 900x1200 pixels.","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"The picture was saved. Returns the updated body measurement.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BodyMeasurement"}}}},"400":{"description":"Invalid date, or the body is not a valid image","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No body measurement exists for the given date"},"413":{"description":"The image is larger than 10 MB"},"415":{"description":"The Content-Type is not image/jpeg, image/png or image/webp"}}}}},"tags":[]}