| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- get:
- summary: Get a single full session including all performed exercises
- operationId: getWorkoutSession
- tags:
- - Sessions
- security:
- - cookieAuth: []
- parameters:
- - name: workout_id
- in: path
- required: true
- description: UUID of the parent workout.
- schema:
- type: string
- format: uuid
- example: 0191a23b-dead-7000-beef-000000000002
- - name: session_id
- in: path
- required: true
- description: UUID of the session to retrieve.
- schema:
- type: string
- format: uuid
- example: 0191a23b-dead-7000-beef-000000000005
- responses:
- '200':
- description: The full session including recorded exercise details.
- content:
- application/json:
- schema:
- type: object
- required:
- - id
- - workout
- - start_time
- - end_time
- - exercises
- properties:
- id:
- type: string
- format: uuid
- example: 0191a23b-dead-7000-beef-000000000005
- workout:
- type: string
- format: uuid
- example: 0191a23b-dead-7000-beef-000000000002
- start_time:
- type: string
- format: date-time
- example: '2026-01-15T09:00:00Z'
- end_time:
- type: string
- format: date-time
- example: '2026-01-15T09:45:00Z'
- exercises:
- type: array
- items:
- $ref: '../components/schemas/SessionExercise.yaml'
- example:
- id: 0191a23b-dead-7000-beef-000000000005
- workout: 0191a23b-dead-7000-beef-000000000002
- start_time: '2026-01-15T09:00:00Z'
- end_time: '2026-01-15T09:45:00Z'
- exercises:
- - id: 0191a23b-dead-7000-beef-000000000006
- exercise: 0191a23b-dead-7000-beef-000000000003
- name: Bench Press
- notes: null
- exercise_type: WeightedReps
- position: 1
- sets:
- - reps: 12
- weight: 135.0
- - reps: 10
- weight: 135.0
- - reps: 8
- weight: 135.0
- - id: 0191a23b-dead-7000-beef-000000000007
- exercise: 0191a23b-dead-7000-beef-000000000004
- name: Push-ups
- notes: null
- exercise_type: BodyweightReps
- position: 2
- sets:
- - reps: 15
- - reps: 12
- '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/session.
- content:
- application/json:
- schema:
- $ref: '../components/schemas/ErrorResponse.yaml'
- example:
- error: You do not have permission to access this workout
- '404':
- description: Workout or session not found.
- content:
- application/json:
- schema:
- $ref: '../components/schemas/ErrorResponse.yaml'
- example:
- error: Session not found
- '500':
- description: Internal server error.
- content:
- application/json:
- schema:
- $ref: '../components/schemas/ErrorResponse.yaml'
- delete:
- summary: Delete a session
- operationId: deleteWorkoutSession
- tags:
- - Sessions
- security:
- - cookieAuth: []
- parameters:
- - name: workout_id
- in: path
- required: true
- description: UUID of the parent workout.
- schema:
- type: string
- format: uuid
- example: 0191a23b-dead-7000-beef-000000000002
- - name: session_id
- in: path
- required: true
- description: UUID of the session to delete.
- schema:
- type: string
- format: uuid
- example: 0191a23b-dead-7000-beef-000000000005
- responses:
- '200':
- description: Session deleted successfully (child exercise records also removed via cascade).
- 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/session.
- content:
- application/json:
- schema:
- $ref: '../components/schemas/ErrorResponse.yaml'
- example:
- error: You do not have permission to access this workout
- '404':
- description: Workout or session not found.
- content:
- application/json:
- schema:
- $ref: '../components/schemas/ErrorResponse.yaml'
- example:
- error: Session not found
- '500':
- description: Internal server error.
- content:
- application/json:
- schema:
- $ref: '../components/schemas/ErrorResponse.yaml'
|