get: summary: List all workouts for the current user operationId: listWorkouts tags: - Workouts security: - cookieAuth: [] responses: '200': description: Array of workouts belonging to the authenticated user. content: application/json: schema: type: array items: type: object required: - id - name properties: id: type: string format: uuid example: 0191a23b-dead-7000-beef-000000000002 name: type: string example: Push Day example: - id: 0191a23b-dead-7000-beef-000000000002 name: Push Day - id: 0191a23b-dead-7000-beef-000000000005 name: Pull Day '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 '500': description: Internal server error. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml' post: summary: Create a new workout operationId: createWorkout tags: - Workouts security: - cookieAuth: [] requestBody: required: true content: application/json: schema: type: object required: - name - exercises properties: name: type: string example: Push Day exercises: type: array items: type: object required: - name - exercise_type - position properties: name: type: string example: Bench Press exercise_type: $ref: '../components/schemas/ExerciseType.yaml' position: type: integer description: 1-based position of the exercise within the workout. example: 1 example: name: Push Day exercises: - name: Bench Press exercise_type: WeightedReps position: 1 - name: Push-ups exercise_type: BodyweightReps position: 2 - name: Treadmill exercise_type: Cardio position: 3 responses: '201': description: Workout created successfully. Returns the full created workout, including generated IDs for the 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 - id: 0191a23b-dead-7000-beef-000000000005 name: Treadmill notes: null exercise_type: Cardio position: 3 '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. '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 '500': description: Internal server error. content: application/json: schema: $ref: '../components/schemas/ErrorResponse.yaml'