get: summary: Get a workout operationId: getWorkout tags: - Workouts security: - cookieAuth: [] parameters: - name: id in: path required: true description: UUID of the workout to retrieve. schema: type: string format: uuid example: 0191a23b-dead-7000-beef-000000000002 responses: '200': description: Workout with all exercises. content: application/json: schema: type: object required: - id - name - exercises properties: id: type: string format: uuid example: 0191a23b-dead-7000-beef-000000000002 name: type: string example: Push Day exercises: type: array items: type: object required: - id - name - exercise_type - position properties: id: type: string format: uuid example: 0191a23b-dead-7000-beef-000000000003 name: type: string example: Bench Press notes: type: string nullable: true example: Keep elbows tucked exercise_type: $ref: '../components/schemas/ExerciseType.yaml' position: type: integer description: 1-based position of the exercise within its workout. example: 1 example: id: 0191a23b-dead-7000-beef-000000000002 name: Push Day exercises: - id: 0191a23b-dead-7000-beef-000000000003 name: Bench Press notes: null exercise_type: WeightedReps position: 1 - id: 0191a23b-dead-7000-beef-000000000004 name: Push-ups notes: null exercise_type: BodyweightReps position: 2 '401': description: Missing or invalid auth token. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml' examples: missing: summary: No cookie present value: error: Missing auth token invalid: summary: Token invalid or expired value: error: Invalid auth token '404': description: Workout not found. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml' example: error: Workout not found '500': description: Internal server error. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml' put: summary: Update a workout operationId: updateWorkout tags: - Workouts security: - cookieAuth: [] parameters: - name: id in: path required: true description: UUID of the workout to update. schema: type: string format: uuid example: 0191a23b-dead-7000-beef-000000000002 requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: New name for the workout. example: Push Day (Heavy) exercises: type: array description: Complete replacement list of exercises. Omit to leave exercises unchanged. items: type: object required: - name - exercise_type - position properties: name: type: string example: Incline Bench Press exercise_type: $ref: '../components/schemas/ExerciseType.yaml' position: type: integer description: 1-based position of the exercise within the workout. Must be unique. example: 1 example: name: Push Day (Heavy) exercises: - name: Incline Bench Press exercise_type: WeightedReps position: 1 - name: Dips exercise_type: BodyweightReps position: 2 responses: '200': description: Workout updated successfully. Returns the full updated workout. content: application/json: schema: type: object required: - id - name - exercises properties: id: type: string format: uuid example: 0191a23b-dead-7000-beef-000000000002 name: type: string example: Push Day (Heavy) exercises: type: array items: type: object required: - id - name - exercise_type - position properties: id: type: string format: uuid example: 0191a23b-dead-7000-beef-000000000003 name: type: string example: Incline Bench Press notes: type: string nullable: true example: null exercise_type: $ref: '../components/schemas/ExerciseType.yaml' position: type: integer example: 1 example: id: 0191a23b-dead-7000-beef-000000000002 name: Push Day (Heavy) exercises: - id: 0191a23b-dead-7000-beef-000000000005 name: Incline Bench Press notes: null exercise_type: WeightedReps position: 1 - id: 0191a23b-dead-7000-beef-000000000006 name: Dips notes: null exercise_type: BodyweightReps position: 2 '401': description: Missing or invalid auth token. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml' examples: missing: summary: No cookie present value: error: Missing auth token invalid: summary: Token invalid or expired value: error: Invalid auth token '403': description: Authenticated user does not own this workout. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml' example: error: You do not have permission to update this workout '404': description: Workout or exercise not found. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml' example: error: Workout not found '422': description: Two or more exercises share the same position. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml' example: error: Two or more exercises share the same position. Each exercise must have a unique position within the workout. '500': description: Internal server error. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml' delete: summary: Delete a workout operationId: deleteWorkout tags: - Workouts security: - cookieAuth: [] parameters: - name: id in: path required: true description: UUID of the workout to delete. schema: type: string format: uuid example: 0191a23b-dead-7000-beef-000000000002 responses: '200': description: Workout and all its exercises deleted successfully. content: application/json: schema: $ref: '../components/schemas/SuccessResponse.yaml' example: success: true '401': description: Missing or invalid auth token. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml' examples: missing: summary: No cookie present value: error: Missing auth token invalid: summary: Token invalid or expired value: error: Invalid auth token '403': description: Authenticated user does not own this workout. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml' example: error: You do not have permission to delete this workout '404': description: Workout not found. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml' example: error: Workout not found '500': description: Internal server error. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml'