workout-session-id.yaml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. get:
  2. summary: Get a single full session including all performed exercises
  3. operationId: getWorkoutSession
  4. tags:
  5. - Sessions
  6. security:
  7. - cookieAuth: []
  8. parameters:
  9. - name: workout_id
  10. in: path
  11. required: true
  12. description: UUID of the parent workout.
  13. schema:
  14. type: string
  15. format: uuid
  16. example: 0191a23b-dead-7000-beef-000000000002
  17. - name: session_id
  18. in: path
  19. required: true
  20. description: UUID of the session to retrieve.
  21. schema:
  22. type: string
  23. format: uuid
  24. example: 0191a23b-dead-7000-beef-000000000005
  25. responses:
  26. '200':
  27. description: The full session including recorded exercise details.
  28. content:
  29. application/json:
  30. schema:
  31. type: object
  32. required:
  33. - id
  34. - workout
  35. - start_time
  36. - end_time
  37. - exercises
  38. properties:
  39. id:
  40. type: string
  41. format: uuid
  42. example: 0191a23b-dead-7000-beef-000000000005
  43. workout:
  44. type: string
  45. format: uuid
  46. example: 0191a23b-dead-7000-beef-000000000002
  47. start_time:
  48. type: string
  49. format: date-time
  50. example: '2026-01-15T09:00:00Z'
  51. end_time:
  52. type: string
  53. format: date-time
  54. example: '2026-01-15T09:45:00Z'
  55. exercises:
  56. type: array
  57. items:
  58. $ref: '../components/schemas/SessionExercise.yaml'
  59. example:
  60. id: 0191a23b-dead-7000-beef-000000000005
  61. workout: 0191a23b-dead-7000-beef-000000000002
  62. start_time: '2026-01-15T09:00:00Z'
  63. end_time: '2026-01-15T09:45:00Z'
  64. exercises:
  65. - id: 0191a23b-dead-7000-beef-000000000006
  66. exercise: 0191a23b-dead-7000-beef-000000000003
  67. name: Bench Press
  68. notes: null
  69. exercise_type: WeightedReps
  70. position: 1
  71. sets:
  72. - reps: 12
  73. weight: 135.0
  74. - reps: 10
  75. weight: 135.0
  76. - reps: 8
  77. weight: 135.0
  78. - id: 0191a23b-dead-7000-beef-000000000007
  79. exercise: 0191a23b-dead-7000-beef-000000000004
  80. name: Push-ups
  81. notes: null
  82. exercise_type: BodyweightReps
  83. position: 2
  84. sets:
  85. - reps: 15
  86. - reps: 12
  87. '401':
  88. description: Missing or invalid auth token.
  89. content:
  90. application/json:
  91. schema:
  92. $ref: '../components/schemas/ErrorResponse.yaml'
  93. examples:
  94. missing:
  95. summary: No cookie present
  96. value:
  97. error: Missing auth token
  98. invalid:
  99. summary: Token invalid or expired
  100. value:
  101. error: Invalid auth token
  102. '403':
  103. description: Authenticated user does not own this workout/session.
  104. content:
  105. application/json:
  106. schema:
  107. $ref: '../components/schemas/ErrorResponse.yaml'
  108. example:
  109. error: You do not have permission to access this workout
  110. '404':
  111. description: Workout or session not found.
  112. content:
  113. application/json:
  114. schema:
  115. $ref: '../components/schemas/ErrorResponse.yaml'
  116. example:
  117. error: Session not found
  118. '500':
  119. description: Internal server error.
  120. content:
  121. application/json:
  122. schema:
  123. $ref: '../components/schemas/ErrorResponse.yaml'
  124. delete:
  125. summary: Delete a session
  126. operationId: deleteWorkoutSession
  127. tags:
  128. - Sessions
  129. security:
  130. - cookieAuth: []
  131. parameters:
  132. - name: workout_id
  133. in: path
  134. required: true
  135. description: UUID of the parent workout.
  136. schema:
  137. type: string
  138. format: uuid
  139. example: 0191a23b-dead-7000-beef-000000000002
  140. - name: session_id
  141. in: path
  142. required: true
  143. description: UUID of the session to delete.
  144. schema:
  145. type: string
  146. format: uuid
  147. example: 0191a23b-dead-7000-beef-000000000005
  148. responses:
  149. '200':
  150. description: Session deleted successfully (child exercise records also removed via cascade).
  151. content:
  152. application/json:
  153. schema:
  154. $ref: '../components/schemas/SuccessResponse.yaml'
  155. example:
  156. success: true
  157. '401':
  158. description: Missing or invalid auth token.
  159. content:
  160. application/json:
  161. schema:
  162. $ref: '../components/schemas/ErrorResponse.yaml'
  163. examples:
  164. missing:
  165. summary: No cookie present
  166. value:
  167. error: Missing auth token
  168. invalid:
  169. summary: Token invalid or expired
  170. value:
  171. error: Invalid auth token
  172. '403':
  173. description: Authenticated user does not own this workout/session.
  174. content:
  175. application/json:
  176. schema:
  177. $ref: '../components/schemas/ErrorResponse.yaml'
  178. example:
  179. error: You do not have permission to access this workout
  180. '404':
  181. description: Workout or session not found.
  182. content:
  183. application/json:
  184. schema:
  185. $ref: '../components/schemas/ErrorResponse.yaml'
  186. example:
  187. error: Session not found
  188. '500':
  189. description: Internal server error.
  190. content:
  191. application/json:
  192. schema:
  193. $ref: '../components/schemas/ErrorResponse.yaml'