# Running

## Create a New Video Processing Session

> This endpoint allows an \*\*admin\*\* (or sub-admin) to upload a \*\*video file\*\* for processing and create a new "session" resource \*\*on behalf of another user\*\*. The server will return a \`session\_id\` that can be used to poll or retrieve the session details/results.\
> \
> \### Request Body (Multipart/Form-Data)\
> \
> You must supply the following fields:\
> \
> \- \*\*user\_id\*\* \*(string, required)\*: The ID of the user on whose behalf this session is created.\
> \- \*\*video\*\* \*(file, required)\*: The raw video file to be processed.\
> \- \*\*session\_name\*\* \*(string, optional)\*: A human-readable name/title for the session.\
> \- \*\*incline\_degree\*\* \*(string or number, optional)\*: Numeric value representing the incline degree.\
> \- \*\*body\_joint\_angles\*\* \*(array\[string], optional)\*: A comma-separated list of joint names (e.g. 'elbow, knee, ankle'). Defaults to \['all'] if not provided.\
> \
> \### Response Structure\
> \
> On success (HTTP 200), the response is a JSON object with:\
> \
> \- \*\*session\_id\*\* \*(string)\*: A unique identifier for the created session.\
> \- \*\*title\*\* \*(string)\*: The session title (defaults to a fallback if \`session\_name\` was not provided).\
> \
> \### Workflow\
> 1\. \*\*POST\*\* a multipart/form-data request containing the required fields \`user\_id\` and \`video\`, plus any optional fields.\
> 2\. Provide A valid API-KEY token in the \`Authorization\` header.\
> 3\. The caller must have admin privileges to successfully create a session for another user.\
> 4\. If successful, the server responds with \`session\_id\` and \`title\`.\
> 5\. If an error occurs (e.g., missing fields, lack of permissions), a JSON object with an \`error\` key is returned.\
> \
> \#### Example cURL:\
> \
> \`\`\`bash\
> curl -X POST \\\
> &#x20;    -H 'Content-Type: multipart/form-data' \\\
> &#x20;    -H 'Authorization: API-KEY \<YOUR\_ADMIN\_TOKEN>' \\\
> &#x20;    -F 'user\_id=someUserId123' \\\
> &#x20;    -F 'video=@/path/to/video.mp4' \\\
> &#x20;    -F 'session\_name=Custom Session' \\\
> &#x20;    -F 'incline\_degree=5' \\\
> &#x20;    -F 'body\_joint\_angles=elbow, knee, ankle' \\\
> &#x20;    https\://\<backend-link>/running/management/sessions/\
> \`\`\`<br>

````json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"},"ApiKeyAuth":{"type":"apiKey","name":"API-KEY","in":"header","description":"Enter your API key in the header: API-KEY: <api_key>"}}},"paths":{"/running/sessions/":{"post":{"operationId":"running_sessions_create","summary":"Create a New Video Processing Session","description":"This endpoint allows an **admin** (or sub-admin) to upload a **video file** for processing and create a new \"session\" resource **on behalf of another user**. The server will return a `session_id` that can be used to poll or retrieve the session details/results.\n\n### Request Body (Multipart/Form-Data)\n\nYou must supply the following fields:\n\n- **user_id** *(string, required)*: The ID of the user on whose behalf this session is created.\n- **video** *(file, required)*: The raw video file to be processed.\n- **session_name** *(string, optional)*: A human-readable name/title for the session.\n- **incline_degree** *(string or number, optional)*: Numeric value representing the incline degree.\n- **body_joint_angles** *(array[string], optional)*: A comma-separated list of joint names (e.g. 'elbow, knee, ankle'). Defaults to ['all'] if not provided.\n\n### Response Structure\n\nOn success (HTTP 200), the response is a JSON object with:\n\n- **session_id** *(string)*: A unique identifier for the created session.\n- **title** *(string)*: The session title (defaults to a fallback if `session_name` was not provided).\n\n### Workflow\n1. **POST** a multipart/form-data request containing the required fields `user_id` and `video`, plus any optional fields.\n2. Provide A valid API-KEY token in the `Authorization` header.\n3. The caller must have admin privileges to successfully create a session for another user.\n4. If successful, the server responds with `session_id` and `title`.\n5. If an error occurs (e.g., missing fields, lack of permissions), a JSON object with an `error` key is returned.\n\n#### Example cURL:\n\n```bash\ncurl -X POST \\\n     -H 'Content-Type: multipart/form-data' \\\n     -H 'Authorization: API-KEY <YOUR_ADMIN_TOKEN>' \\\n     -F 'user_id=someUserId123' \\\n     -F 'video=@/path/to/video.mp4' \\\n     -F 'session_name=Custom Session' \\\n     -F 'incline_degree=5' \\\n     -F 'body_joint_angles=elbow, knee, ankle' \\\n     https://<backend-link>/running/management/sessions/\n```\n","responses":{"200":{"description":"Video processing session created successfully (HTTP 200).","content":{"application/json":{"schema":{"required":["session_id","title"],"type":"object","properties":{"session_id":{"description":"The unique identifier for the created session.","type":"string"},"title":{"description":"The session title (defaults if not provided).","type":"string"}}}}}},"400":{"description":"Bad Request - Possibly due to missing `user_id`, missing `video`, or invalid form data.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Detailed error message.","type":"string"}}}}}},"401":{"description":"Unauthorized - Missing or invalid access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating a missing or invalid token.","type":"string"}}}}}},"403":{"description":"Forbidden - The user does not have admin permission to create sessions for others.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating insufficient privileges.","type":"string"}}}}}},"404":{"description":"Not Found - Indicates business logic issues or resource limitations (e.g., session limit).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message describing the issue.","type":"string"}}}}}},"500":{"description":"Internal Server Error - Unexpected error occurred on the server.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Detailed error message indicating a server-side failure.","type":"string"}}}}}}},"tags":["running"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"user_id":{"type":"string","description":"**Required.** The ID of the user for whom this session is created (form field: text)."},"video":{"type":"string","description":"**Required.** The raw video file to be processed (form field type: file)."},"session_name":{"type":"string","description":"**Optional.** A descriptive name for the session (form field: text)."},"incline_degree":{"type":"string","description":"**Optional.** A numeric string indicating the incline degree (form field: text)."},"body_joint_angles":{"type":"array","description":"**Optional.** A comma-separated list of joint names. Available values: `'ankle'`, `'knee'`, `'elbow'`, `'hip'`, `'shoulder'`. Example: `ankle,knee,hip`"}},"required":["user_id","video"]}}}}}}}}
````

## Retrieve Running Session Details

> Retrieves detailed information for a specific running session identified by the \`session\_id\`.\
> \
> \### Path Parameter\
> \- \*\*session\_id\*\* \*(string, required)\*: The unique identifier of the session to retrieve.\
> \
> \### Query Parameter\
> \- \*\*demo\*\* \*(boolean, optional)\*: Set to \`true\` to retrieve the demo running session data instead of a real one.\
> \
> \### Response Structure\
> On success (HTTP 200), the response is a JSON object containing the following fields:\
> \
> \- \*\*metrics\*\* \*(object)\*: A dictionary of metric arrays (e.g., speed, cadence, distance). Each key maps to an array of numbers.\
> \- \*\*angles\*\* \*(object)\*: A dictionary of angle arrays (e.g., lhip\_angle, rsho\_angle). Each key maps to an array of numbers.\
> \- \*\*all\_timestamps\*\* \*(array\[number])\*: A list of timestamps (in seconds) for the session data.\
> \- \*\*analyzed\_video\_url\*\* \*(string, URI)\*: The URL for the analyzed video (with keypoints overlay).\
> \- \*\*video\_url\*\* \*(string, URI)\*: The URL for the original uploaded video.\
> \- \*\*segments\*\* \*(integer)\*: The number of segments processed.\
> \- \*\*created\_at\*\* \*(object)\*: An object containing:\
> &#x20;   \- \*\*date\*\* \*(string)\*: The creation date in DD/MM/YYYY format.\
> &#x20;   \- \*\*time\*\* \*(string)\*: The creation time in HH:MM AM/PM format.\
> \- \*\*user\_name\*\* \*(string)\*: The name of the user associated with the session.\
> \- \*\*activity\*\* \*(string)\*: The activity type (e.g., 'Running').\
> \- \*\*title\*\* \*(string)\*: The title of the session.\
> \- \*\*calculated\_metrics\*\* \*(object)\*: A dictionary containing computed statistics (such as averages, minima, and maxima) for various metrics.\
> \- \*\*summary\*\* \*(string)\*: An optional textual summary of the session.\
> \
> \### Error Handling\
> \- \*\*400 Bad Request\*\*: The request parameters are invalid (e.g., invalid admin UID).\
> \- \*\*401 Unauthorized\*\*: The access token is missing or invalid.\
> \- \*\*403 Forbidden\*\*: The user does not have sufficient privileges to access the session.\
> \- \*\*404 Not Found\*\*: The session does not exist or is not valid for the specified activity.\
> \- \*\*500 Internal Server Error\*\*: An unexpected server-side error occurred.\
> \
> \### Security\
> A valid API-KEY token must be provided in the \`Authorization\` header.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"},"ApiKeyAuth":{"type":"apiKey","name":"API-KEY","in":"header","description":"Enter your API key in the header: API-KEY: <api_key>"}}},"paths":{"/running/sessions/{session_id}/":{"get":{"operationId":"running_sessions_read","summary":"Retrieve Running Session Details","description":"Retrieves detailed information for a specific running session identified by the `session_id`.\n\n### Path Parameter\n- **session_id** *(string, required)*: The unique identifier of the session to retrieve.\n\n### Query Parameter\n- **demo** *(boolean, optional)*: Set to `true` to retrieve the demo running session data instead of a real one.\n\n### Response Structure\nOn success (HTTP 200), the response is a JSON object containing the following fields:\n\n- **metrics** *(object)*: A dictionary of metric arrays (e.g., speed, cadence, distance). Each key maps to an array of numbers.\n- **angles** *(object)*: A dictionary of angle arrays (e.g., lhip_angle, rsho_angle). Each key maps to an array of numbers.\n- **all_timestamps** *(array[number])*: A list of timestamps (in seconds) for the session data.\n- **analyzed_video_url** *(string, URI)*: The URL for the analyzed video (with keypoints overlay).\n- **video_url** *(string, URI)*: The URL for the original uploaded video.\n- **segments** *(integer)*: The number of segments processed.\n- **created_at** *(object)*: An object containing:\n    - **date** *(string)*: The creation date in DD/MM/YYYY format.\n    - **time** *(string)*: The creation time in HH:MM AM/PM format.\n- **user_name** *(string)*: The name of the user associated with the session.\n- **activity** *(string)*: The activity type (e.g., 'Running').\n- **title** *(string)*: The title of the session.\n- **calculated_metrics** *(object)*: A dictionary containing computed statistics (such as averages, minima, and maxima) for various metrics.\n- **summary** *(string)*: An optional textual summary of the session.\n\n### Error Handling\n- **400 Bad Request**: The request parameters are invalid (e.g., invalid admin UID).\n- **401 Unauthorized**: The access token is missing or invalid.\n- **403 Forbidden**: The user does not have sufficient privileges to access the session.\n- **404 Not Found**: The session does not exist or is not valid for the specified activity.\n- **500 Internal Server Error**: An unexpected server-side error occurred.\n\n### Security\nA valid API-KEY token must be provided in the `Authorization` header.","parameters":[{"schema":{"type":"string"},"name":"session_id","in":"path","description":"The unique session identifier.","required":true},{"schema":{"type":"boolean"},"name":"demo","in":"query","description":"Set to `true` to retrieve the demo running session data instead of a real one.","required":false}],"responses":{"200":{"description":"Session data successfully retrieved.","content":{"application/json":{"schema":{"required":["metrics","angles","all_timestamps","activity"],"type":"object","properties":{"metrics":{"description":"A dictionary of metric arrays.","type":"object","additionalProperties":{"type":"number"}},"angles":{"description":"A dictionary of angle arrays.","type":"object","additionalProperties":{"type":"number"}},"all_timestamps":{"description":"List of timestamps associated with the session.","type":"array","items":{"type":"number"}},"analyzed_video_url":{"description":"The public URL of the analyzed video.","type":"string","format":"uri"},"video_url":{"description":"The public URL of the original video.","type":"string","format":"uri"},"segments":{"description":"The number of segments processed.","type":"integer"},"created_at":{"description":"Timestamp when the session was created.","type":"object","properties":{"date":{"description":"Creation date in DD/MM/YYYY format.","type":"string"},"time":{"description":"Creation time in HH:MM AM/PM format.","type":"string"}}},"user_name":{"description":"The name of the user associated with this session.","type":"string"},"activity":{"description":"The type of activity (e.g., 'Running').","type":"string"},"title":{"description":"The session title.","type":"string"},"calculated_metrics":{"description":"Computed metrics (average, min, max values) for the session.","type":"object","additionalProperties":{"type":"number"}},"summary":{"description":"An optional summary of the session.","type":"string"}}}}}},"400":{"description":"Bad Request - Invalid parameters or admin UID.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message explaining the invalid request.","type":"string"}}}}}},"401":{"description":"Unauthorized - Missing or invalid access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that A valid API-KEY token was not provided.","type":"string"}}}}}},"403":{"description":"Forbidden - The user is not authorized to access this session.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating insufficient permissions to access the session data.","type":"string"}}}}}},"404":{"description":"Not Found - The requested session does not exist or the activity is not 'Running'.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating that the session was not found.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred on the server.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message indicating a server-side failure.","type":"string"}}}}}}},"tags":["running"]}}}}
```

## Get Summary of a Running Session

> Retrieve a detailed summary of a running session using its unique \`session\_id\`. This summary includes both quantitative performance metrics and an optional qualitative summary generated by GenAI if available.\
> \
> \*\*Usage Instructions:\*\*\
> 1\. Send a GET request with the \`session\_id\` in the path parameter.\
> 2\. The endpoint will return a JSON object that includes various sections of the session summary.\
> \
> \### Query Parameter\
> \- \*\*demo\*\* \*(boolean, optional)\*: Set to \`true\` to retrieve a pre-generated demo summary for this running session.\
> \
> \*\*Response Structure:\*\*\
> \
> \- \*\*summary\_text\*\* \*(object, optional)\*: Contains GenAI-generated commentary if available. This object may include the following keys:\
> &#x20;   \- \*\*balance\_and\_posture\*\*: Comments on the athlete's balance and posture (e.g. suggestions to improve running balance).\
> &#x20;   \- \*\*performance\_metrics\*\*: Overall performance comments such as changes in speed, cadence, and power output.\
> &#x20;   \- \*\*running\_mechanics\*\*: Observations on running form, including contact time, flight time, stride time, and stride length.\
> &#x20;   \- \*\*final\_summary\*\*: A final overall assessment remark summarizing the session performance.\
> &#x20;   \- \*\*distance\_and\_duration\*\*: Comments on the total distance covered and session duration.\
> \
> \- \*\*performance\_metrics\*\* \*(object)\*: Contains aggregated performance metrics with their minimum, maximum, average values, and the raw data as an array, covering the following:\
> &#x20;   \- \*\*speed\*\* (in m/s)\
> &#x20;   \- \*\*pace\*\* (in min/km)\
> &#x20;   \- \*\*cadence\*\* (steps/min)\
> &#x20;   \- \*\*power\*\* (in Watts)\
> &#x20;   \- \*\*normalized\_power\*\* (in W/kg)\
> \
> \- \*\*running\_mechanics\*\* \*(object)\*: Contains the following running mechanics data:\
> &#x20;   \- \*\*contact\_time\*\* (in seconds)\
> &#x20;   \- \*\*flight\_time\*\* (in seconds)\
> &#x20;   \- \*\*stride\_time\*\* (in seconds)\
> &#x20;   \- \*\*stride\_length\*\* (in meters)\
> &#x20;   \- \*\*footstrike\*\*: A string describing the most common footstrike type (e.g. 'forefoot').\
> \
> \- \*\*balance\_and\_posture\*\* \*(object)\*: Contains metrics related to balance and posture:\
> &#x20;   \- \*\*balance\*\*: Includes minimum, maximum, average, and array of balance scores.\
> &#x20;   \- \*\*contact\_angle\*\*: Includes the minimum, maximum, average, and array of contact angle values (in degrees).\
> \
> \- \*\*distance\_and\_duration\*\* \*(object)\*: Contains raw values for:\
> &#x20;   \- \*\*total\_distance\*\* (in meters)\
> &#x20;   \- \*\*total\_time\*\* (in seconds)\
> \
> \- \*\*user\_information\*\* \*(object)\*: Contains detailed user data, including:\
> &#x20;   \- \*\*ycom\*\*: User's YCOM value\
> &#x20;   \- \*\*weight\*\*: User's weight in kilograms\
> &#x20;   \- \*\*age\*\*: User's age\
> &#x20;   \- \*\*height\*\*: User's height in centimeters\
> &#x20;   \- \*\*leg\_length\*\*: User's leg length\
> &#x20;   \- \*\*shoeSize\*\*: User's shoe size\
> &#x20;   \- \*\*gender\*\*: User's gender\
> &#x20;   \- \*\*user\*\*: The unique user ID\
> &#x20;   \- \*\*brand\*\*: Shoe brand information (if any)\
> &#x20;   \- \*\*shoeModel\*\*: Shoe model information (if any)\
> &#x20;   \- \*\*email\*\*: User's email address\
> &#x20;   \- \*\*display\_name\*\*: User's display name\
> \
> \- \*\*session\_date\*\* \*(string)\*: The date of the session in a formatted string (e.g. 'DD/MM/YYYY').\
> \
> \*\*Note:\*\* The \`summary\_text\` field will only be present if GenAI-generated summary comments have been saved for the session.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"},"ApiKeyAuth":{"type":"apiKey","name":"API-KEY","in":"header","description":"Enter your API key in the header: API-KEY: <api_key>"}}},"paths":{"/running/sessions/{session_id}/summary/":{"get":{"operationId":"running_sessions_summary_list","summary":"Get Summary of a Running Session","description":"Retrieve a detailed summary of a running session using its unique `session_id`. This summary includes both quantitative performance metrics and an optional qualitative summary generated by GenAI if available.\n\n**Usage Instructions:**\n1. Send a GET request with the `session_id` in the path parameter.\n2. The endpoint will return a JSON object that includes various sections of the session summary.\n\n### Query Parameter\n- **demo** *(boolean, optional)*: Set to `true` to retrieve a pre-generated demo summary for this running session.\n\n**Response Structure:**\n\n- **summary_text** *(object, optional)*: Contains GenAI-generated commentary if available. This object may include the following keys:\n    - **balance_and_posture**: Comments on the athlete's balance and posture (e.g. suggestions to improve running balance).\n    - **performance_metrics**: Overall performance comments such as changes in speed, cadence, and power output.\n    - **running_mechanics**: Observations on running form, including contact time, flight time, stride time, and stride length.\n    - **final_summary**: A final overall assessment remark summarizing the session performance.\n    - **distance_and_duration**: Comments on the total distance covered and session duration.\n\n- **performance_metrics** *(object)*: Contains aggregated performance metrics with their minimum, maximum, average values, and the raw data as an array, covering the following:\n    - **speed** (in m/s)\n    - **pace** (in min/km)\n    - **cadence** (steps/min)\n    - **power** (in Watts)\n    - **normalized_power** (in W/kg)\n\n- **running_mechanics** *(object)*: Contains the following running mechanics data:\n    - **contact_time** (in seconds)\n    - **flight_time** (in seconds)\n    - **stride_time** (in seconds)\n    - **stride_length** (in meters)\n    - **footstrike**: A string describing the most common footstrike type (e.g. 'forefoot').\n\n- **balance_and_posture** *(object)*: Contains metrics related to balance and posture:\n    - **balance**: Includes minimum, maximum, average, and array of balance scores.\n    - **contact_angle**: Includes the minimum, maximum, average, and array of contact angle values (in degrees).\n\n- **distance_and_duration** *(object)*: Contains raw values for:\n    - **total_distance** (in meters)\n    - **total_time** (in seconds)\n\n- **user_information** *(object)*: Contains detailed user data, including:\n    - **ycom**: User's YCOM value\n    - **weight**: User's weight in kilograms\n    - **age**: User's age\n    - **height**: User's height in centimeters\n    - **leg_length**: User's leg length\n    - **shoeSize**: User's shoe size\n    - **gender**: User's gender\n    - **user**: The unique user ID\n    - **brand**: Shoe brand information (if any)\n    - **shoeModel**: Shoe model information (if any)\n    - **email**: User's email address\n    - **display_name**: User's display name\n\n- **session_date** *(string)*: The date of the session in a formatted string (e.g. 'DD/MM/YYYY').\n\n**Note:** The `summary_text` field will only be present if GenAI-generated summary comments have been saved for the session.","parameters":[{"schema":{"type":"string"},"name":"session_id","in":"path","description":"The unique identifier of the session","required":true},{"schema":{"type":"boolean"},"name":"demo","in":"query","description":"Set to `true` to retrieve a pre-generated demo summary for this running session.","required":false}],"responses":{"200":{"description":"Successfully retrieved session summary","content":{"application/json":{"schema":{"required":["summary_text","performance_metrics","running_mechanics","balance_and_posture","distance_and_duration","user_information","session_date"],"type":"object","properties":{"summary_text":{"description":"Optional textual summary of the session (only present if GenAI comments are available).","type":"object","properties":{"balance_and_posture":{"description":"Comments regarding the athlete's balance and posture.","type":"string"},"performance_metrics":{"description":"Comments on speed, cadence, power, and overall performance.","type":"string"},"running_mechanics":{"description":"Comments on running mechanics, including contact and flight times, and stride details.","type":"string"},"final_summary":{"description":"Overall concluding summary of the session.","type":"string"},"distance_and_duration":{"description":"Summary commentary on the total distance and duration of the session.","type":"string"}}},"performance_metrics":{"type":"object","properties":{"speed":{"type":"object","properties":{"min":{"description":"Minimum speed (m/s)","type":"number"},"max":{"description":"Maximum speed (m/s)","type":"number"},"avg":{"description":"Average speed (m/s)","type":"number"},"values":{"description":"Array of individual speed values","type":"array","items":{"type":"number"}}}},"pace":{"type":"object","properties":{"min":{"description":"Minimum pace (min/km)","type":"number"},"max":{"description":"Maximum pace (min/km)","type":"number"},"avg":{"description":"Average pace (min/km)","type":"number"},"values":{"description":"Array of individual pace values","type":"array","items":{"type":"number"}}}},"cadence":{"type":"object","properties":{"min":{"description":"Minimum cadence (steps/min)","type":"number"},"max":{"description":"Maximum cadence (steps/min)","type":"number"},"avg":{"description":"Average cadence (steps/min)","type":"number"},"values":{"description":"Array of individual cadence values","type":"array","items":{"type":"number"}}}},"power":{"type":"object","properties":{"min":{"description":"Minimum power (W)","type":"number"},"max":{"description":"Maximum power (W)","type":"number"},"avg":{"description":"Average power (W)","type":"number"},"values":{"description":"Array of individual power values","type":"array","items":{"type":"number"}}}},"normalized_power":{"type":"object","properties":{"min":{"description":"Minimum normalized power (W/kg)","type":"number"},"max":{"description":"Maximum normalized power (W/kg)","type":"number"},"avg":{"description":"Average normalized power (W/kg)","type":"number"},"values":{"description":"Array of individual normalized power values","type":"array","items":{"type":"number"}}}}}},"running_mechanics":{"type":"object","properties":{"contact_time":{"type":"object","properties":{"min":{"description":"Minimum contact time (s)","type":"number"},"max":{"description":"Maximum contact time (s)","type":"number"},"avg":{"description":"Average contact time (s)","type":"number"},"values":{"description":"Array of contact time values","type":"array","items":{"type":"number"}}}},"flight_time":{"type":"object","properties":{"min":{"description":"Minimum flight time (s)","type":"number"},"max":{"description":"Maximum flight time (s)","type":"number"},"avg":{"description":"Average flight time (s)","type":"number"},"values":{"description":"Array of flight time values","type":"array","items":{"type":"number"}}}},"stride_time":{"type":"object","properties":{"min":{"description":"Minimum stride time (s)","type":"number"},"max":{"description":"Maximum stride time (s)","type":"number"},"avg":{"description":"Average stride time (s)","type":"number"},"values":{"description":"Array of stride time measurements","type":"array","items":{"type":"number"}}}},"stride_length":{"type":"object","properties":{"min":{"description":"Minimum stride length (m)","type":"number"},"max":{"description":"Maximum stride length (m)","type":"number"},"avg":{"description":"Average stride length (m)","type":"number"},"values":{"description":"Array of stride length measurements","type":"array","items":{"type":"number"}}}},"footstrike":{"description":"The most common footstrike type (e.g. 'forefoot')","type":"string"}}},"balance_and_posture":{"type":"object","properties":{"balance":{"type":"object","properties":{"min":{"description":"Minimum running balance score","type":"number"},"max":{"description":"Maximum running balance score","type":"number"},"avg":{"description":"Average running balance score","type":"number"},"values":{"description":"Array of running balance values","type":"array","items":{"type":"number"}}}},"contact_angle":{"type":"object","properties":{"min":{"description":"Minimum contact angle (degrees)","type":"number"},"max":{"description":"Maximum contact angle (degrees)","type":"number"},"avg":{"description":"Average contact angle (degrees)","type":"number"},"values":{"description":"Array of contact angle values","type":"array","items":{"type":"number"}}}}}},"distance_and_duration":{"type":"object","properties":{"total_distance":{"description":"Total distance covered (m)","type":"number"},"total_time":{"description":"Total duration of the session (s)","type":"number"}}},"user_information":{"description":"Detailed user information from the session data.","type":"object","properties":{"ycom":{"description":"User's YCOM value","type":"number"},"weight":{"description":"User's weight (kg)","type":"number"},"age":{"description":"User's age","type":"string"},"height":{"description":"User's height (cm)","type":"number"},"leg_length":{"description":"User's leg length (m)","type":"number"},"shoeSize":{"description":"User's shoe size","type":"number"},"gender":{"description":"User's gender","type":"string"},"user":{"description":"Unique user identifier","type":"string"},"brand":{"description":"Preferred shoe brand (if available)","type":"string"},"shoeModel":{"description":"Shoe model (if available)","type":"string"},"email":{"description":"User's email address","type":"string"},"display_name":{"description":"User's display name","type":"string"}}},"session_date":{"description":"Formatted date of the session (e.g., '07/04/2025')","type":"string"}}}}}},"400":{"description":"Bad Request - Invalid token or parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message describing the invalid request.","type":"string"}}}}}},"401":{"description":"Unauthorized - Token is invalid or expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that the token is missing or invalid.","type":"string"}}}}}},"403":{"description":"Forbidden - Admin access is required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that admin privileges are required.","type":"string"}}}}}},"404":{"description":"Not Found - Session not found or user does not have a valid payment plan.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating that the session was not found or payment plan is invalid.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message indicating a server-side failure.","type":"string"}}}}}}},"tags":["running"]}}}}
```

## Generate Summary for a Running Session

> Trigger the generation of summary threads for a running session. This endpoint creates separate summary threads for each summary block based on session metrics, including performance metrics, running mechanics, balance and posture, and distance/duration, as well as a final overall summary. Returns a JSON object containing thread IDs for each summary block.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"},"ApiKeyAuth":{"type":"apiKey","name":"API-KEY","in":"header","description":"Enter your API key in the header: API-KEY: <api_key>"}}},"paths":{"/running/sessions/{session_id}/summary/":{"post":{"operationId":"running_sessions_summary_create","summary":"Generate Summary for a Running Session","description":"Trigger the generation of summary threads for a running session. This endpoint creates separate summary threads for each summary block based on session metrics, including performance metrics, running mechanics, balance and posture, and distance/duration, as well as a final overall summary. Returns a JSON object containing thread IDs for each summary block.","parameters":[{"schema":{"type":"string"},"name":"session_id","in":"path","description":"The unique identifier of the session","required":true},{"schema":{"type":"string","enum":["metric","imperial"]},"name":"measurement_system","in":"query","description":"Measurement system: 'metric' or 'imperial'","required":false}],"responses":{"201":{"description":"Summary threads generated successfully.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"description":"Thread ID corresponding to a summary block","type":"string"}}}}},"400":{"description":"Bad Request - Invalid token or parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message describing the invalid request.","type":"string"}}}}}},"401":{"description":"Unauthorized - Token is invalid or expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that the token is missing or invalid.","type":"string"}}}}}},"403":{"description":"Forbidden - Admin access is required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that admin privileges are required.","type":"string"}}}}}},"404":{"description":"Not Found - Session not found or user does not have a valid payment plan.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating that the session was not found or payment plan is invalid.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message indicating a server-side failure.","type":"string"}}}}}}},"tags":["running"]}}}}
```

## Export Running Session Data

> Retrieves detailed session data for exporting a specific running session identified by the \`session\_id\`.\
> \
> \### Path Parameter\
> \- \*\*session\_id\*\* \*(string, required)\*: The unique identifier of the session to export.\
> \
> \### Query Parameter\
> \- \*\*demo\*\* \*(boolean, optional)\*: Set to \`true\` to retrieve the pre-generated demo running session instead of a real one.\
> \
> \### Response Structure (HTTP 200)\
> The response is a JSON object that includes:\
> \
> \- \*\*metrics\*\* \*(object)\*: A dictionary where each key represents a metric (e.g., 'speed', 'cadence') and its value is an array of numbers.\
> \- \*\*keypoints\*\* \*(object)\*: A dictionary where each key represents a keypoint (e.g., 'lknev', 'ltoev') and its value is an array of numbers.\
> \- \*\*angles\*\* \*(object)\*: A dictionary where each key represents an angle (e.g., 'lelb\_angle', 'lhip\_angle') and its value is an array of numbers.\
> \- \*\*all\_timestamps\*\* \*(array\[number])\*: An array of timestamps (in seconds) corresponding to the data points.\
> \- \*\*contact\*\* \*(array\[boolean])\*: An array of boolean values indicating contact status.\
> \- \*\*activity\*\* \*(string)\*: The activity type (e.g., 'Running').\
> \
> \### Error Handling\
> \- \*\*400 Bad Request\*\*: The request parameters are invalid (e.g., an invalid admin UID).\
> \- \*\*401 Unauthorized\*\*: The access token is missing or invalid.\
> \- \*\*403 Forbidden\*\*: The user does not have sufficient privileges to access this session data.\
> \- \*\*404 Not Found\*\*: The requested session does not exist or is invalid for the activity.\
> \- \*\*500 Internal Server Error\*\*: An unexpected server error occurred.\
> \
> \### Security\
> A valid API-KEY token must be provided in the \`Authorization\` header.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"},"ApiKeyAuth":{"type":"apiKey","name":"API-KEY","in":"header","description":"Enter your API key in the header: API-KEY: <api_key>"}}},"paths":{"/running/sessions/{session_id}/export/":{"get":{"operationId":"running_sessions_export_list","summary":"Export Running Session Data","description":"Retrieves detailed session data for exporting a specific running session identified by the `session_id`.\n\n### Path Parameter\n- **session_id** *(string, required)*: The unique identifier of the session to export.\n\n### Query Parameter\n- **demo** *(boolean, optional)*: Set to `true` to retrieve the pre-generated demo running session instead of a real one.\n\n### Response Structure (HTTP 200)\nThe response is a JSON object that includes:\n\n- **metrics** *(object)*: A dictionary where each key represents a metric (e.g., 'speed', 'cadence') and its value is an array of numbers.\n- **keypoints** *(object)*: A dictionary where each key represents a keypoint (e.g., 'lknev', 'ltoev') and its value is an array of numbers.\n- **angles** *(object)*: A dictionary where each key represents an angle (e.g., 'lelb_angle', 'lhip_angle') and its value is an array of numbers.\n- **all_timestamps** *(array[number])*: An array of timestamps (in seconds) corresponding to the data points.\n- **contact** *(array[boolean])*: An array of boolean values indicating contact status.\n- **activity** *(string)*: The activity type (e.g., 'Running').\n\n### Error Handling\n- **400 Bad Request**: The request parameters are invalid (e.g., an invalid admin UID).\n- **401 Unauthorized**: The access token is missing or invalid.\n- **403 Forbidden**: The user does not have sufficient privileges to access this session data.\n- **404 Not Found**: The requested session does not exist or is invalid for the activity.\n- **500 Internal Server Error**: An unexpected server error occurred.\n\n### Security\nA valid API-KEY token must be provided in the `Authorization` header.","parameters":[{"schema":{"type":"string"},"name":"session_id","in":"path","description":"The unique session identifier.","required":true},{"schema":{"type":"boolean"},"name":"demo","in":"query","description":"Set to `true` to retrieve the pre-generated demo running session instead of a real one.","required":false}],"responses":{"200":{"description":"Session data successfully exported.","content":{"application/json":{"schema":{"required":["metrics","keypoints","angles","all_timestamps","contact","activity"],"type":"object","properties":{"metrics":{"description":"A dictionary of metric arrays (e.g., speed, cadence, etc.).","type":"object","additionalProperties":{"type":"number"}},"keypoints":{"description":"A dictionary of keypoint arrays.","type":"object","additionalProperties":{"type":"array","items":{"type":"number"}}},"angles":{"description":"A dictionary of angle arrays.","type":"object","additionalProperties":{"type":"array","items":{"type":"number"}}},"all_timestamps":{"description":"List of timestamps (in seconds).","type":"array","items":{"type":"number"}},"contact":{"description":"Array indicating contact status (true/false).","type":"array","items":{"type":"boolean"}},"activity":{"description":"The activity type (e.g., 'Running').","type":"string"}}}}}},"400":{"description":"Bad Request - The request parameters are invalid (e.g., invalid admin UID).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message explaining the invalid request.","type":"string"}}}}}},"401":{"description":"Unauthorized - Missing or invalid access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that the access token is missing or invalid.","type":"string"}}}}}},"403":{"description":"Forbidden - The user does not have sufficient privileges to access this session data.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating insufficient permissions.","type":"string"}}}}}},"404":{"description":"Not Found - The requested session does not exist or the activity is not valid.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating that the session was not found.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred on the server.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message indicating a server-side failure.","type":"string"}}}}}}},"tags":["running"]}}}}
```

## Running-Form Analysis Report

> Retrieves a detailed running-form analysis report for a given session. The endpoint requires the user to have a valid admin token and an active subscription plan (Pro, Premium, Enterprise, or Standard).\
> \
> \### Request\
> \- \*\*Path Parameter\*\*:\
> &#x20; \- \*\*session\_id\*\* \*(string, required)\*: The unique identifier of the session for which the running-form analysis report is requested.\
> \
> \- \*\*Query Parameter\*\*:\
> &#x20; \- \*\*demo\*\* \*(boolean, optional)\*: Set to \`true\` to retrieve a pre-generated demo running-form analysis report instead of a real one.\
> \
> \### Response Structure (HTTP 200)\
> The response is a JSON object containing:\
> \
> \- \*\*metrics\*\* \*(object)\*: Stride-averaged values such as \`speed\`, \`balance\`, \`cadence\`, \`contact\_angle\`, \`eversion\_velocity\`, \`knee\_flexion\`, \`posture\_angle\`, \`ankle\_angle\`, \`com\_oscillation\`, \`stride\_angle\`, \`mean\_h\`.\
> \- \*\*images\*\* \*(object)\*: Three representative snapshots keyed \`contact\_angle\`, \`push\_angle\`, \`knee\_ankle\`; each value is a public image URL.\
> \- \*\*user\_info\*\* \*(object)\*: Information about the user who submitted the session, including:\
> &#x20; \- \*\*age\*\* \*(integer)\*\
> &#x20; \- \*\*gender\*\* \*(string)\*\
> &#x20; \- \*\*height\*\* \*(number, cm)\*\
> &#x20; \- \*\*weight\*\* \*(number, kg)\*\
> &#x20; \- \*\*email\*\* \*(string, email)\*\
> &#x20; \- \*\*uid\*\*, \*\*display\_name\*\*, \*\*admin\_name\*\*, \*\*last\_session\*\*, \*\*phone\*\*, \*\*brand\*\*, \*\*shoeModel\*\*, \*\*shoeSize\*\*, \*\*leg\_length\*\*, \*\*ycom\*\* \*(various types)\*\
> \
> \- \*\*form\_comments\*\* \*(object, optional)\*: GenAI recommendations for blocks \`contact\_angle\`, \`hip\_extension\_at\_foot\_takeoff\`, \`foot\_contact\_angle\_and\_torso\_lean\`.\
> \- \*\*date\*\* \*(string)\*: The date the report was generated in DD/MM/YYYY format.\
> \
> \### Error Handling\
> \- \*\*400 Bad Request\*\*: Invalid token or parameters.\
> \- \*\*401 Unauthorized\*\*: Token is missing or invalid.\
> \- \*\*403 Forbidden\*\*: Admin access is required.\
> \- \*\*404 Not Found\*\*: The session was not found or the user does not have a valid payment plan.\
> \- \*\*500 Internal Server Error\*\*: An unexpected error occurred on the server.\
> \
> \### Security\
> A valid API-KEY token must be provided in the \`Authorization\` header.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"},"ApiKeyAuth":{"type":"apiKey","name":"API-KEY","in":"header","description":"Enter your API key in the header: API-KEY: <api_key>"}}},"paths":{"/running/sessions/{session_id}/form-analysis/":{"post":{"operationId":"running_sessions_form-analysis_create","summary":"Running-Form Analysis Report","description":"Retrieves a detailed running-form analysis report for a given session. The endpoint requires the user to have a valid admin token and an active subscription plan (Pro, Premium, Enterprise, or Standard).\n\n### Request\n- **Path Parameter**:\n  - **session_id** *(string, required)*: The unique identifier of the session for which the running-form analysis report is requested.\n\n- **Query Parameter**:\n  - **demo** *(boolean, optional)*: Set to `true` to retrieve a pre-generated demo running-form analysis report instead of a real one.\n\n### Response Structure (HTTP 200)\nThe response is a JSON object containing:\n\n- **metrics** *(object)*: Stride-averaged values such as `speed`, `balance`, `cadence`, `contact_angle`, `eversion_velocity`, `knee_flexion`, `posture_angle`, `ankle_angle`, `com_oscillation`, `stride_angle`, `mean_h`.\n- **images** *(object)*: Three representative snapshots keyed `contact_angle`, `push_angle`, `knee_ankle`; each value is a public image URL.\n- **user_info** *(object)*: Information about the user who submitted the session, including:\n  - **age** *(integer)*\n  - **gender** *(string)*\n  - **height** *(number, cm)*\n  - **weight** *(number, kg)*\n  - **email** *(string, email)*\n  - **uid**, **display_name**, **admin_name**, **last_session**, **phone**, **brand**, **shoeModel**, **shoeSize**, **leg_length**, **ycom** *(various types)*\n\n- **form_comments** *(object, optional)*: GenAI recommendations for blocks `contact_angle`, `hip_extension_at_foot_takeoff`, `foot_contact_angle_and_torso_lean`.\n- **date** *(string)*: The date the report was generated in DD/MM/YYYY format.\n\n### Error Handling\n- **400 Bad Request**: Invalid token or parameters.\n- **401 Unauthorized**: Token is missing or invalid.\n- **403 Forbidden**: Admin access is required.\n- **404 Not Found**: The session was not found or the user does not have a valid payment plan.\n- **500 Internal Server Error**: An unexpected error occurred on the server.\n\n### Security\nA valid API-KEY token must be provided in the `Authorization` header.","parameters":[{"schema":{"type":"string"},"name":"session_id","in":"path","description":"The unique identifier of the session for which the running-form analysis report is requested.","required":true},{"schema":{"type":"boolean"},"name":"demo","in":"query","description":"Set to `true` to retrieve a pre-generated demo running-form analysis report instead of a real one.","required":false}],"responses":{"200":{"description":"Running-Form Analysis Report retrieved successfully.","content":{"application/json":{"schema":{"required":["metrics","images","user_info","date"],"type":"object","properties":{"metrics":{"description":"Stride-averaged metrics.","required":["speed","balance","cadence","contact_angle","eversion_velocity","knee_flexion","posture_angle","ankle_angle","com_oscillation","stride_angle","mean_h"],"type":"object","properties":{"speed":{"type":"number"},"balance":{"type":"number"},"cadence":{"type":"number"},"contact_angle":{"type":"number"},"eversion_velocity":{"type":"number"},"knee_flexion":{"type":"number"},"posture_angle":{"type":"number"},"ankle_angle":{"type":"number"},"com_oscillation":{"type":"number"},"stride_angle":{"type":"number"},"mean_h":{"type":"number"}}},"images":{"description":"Three representative frame URLs.","type":"object","additionalProperties":{"type":"string","format":"uri"}},"user_info":{"description":"User information associated with the session.","required":["age","height","weight","email","uid"],"type":"object","properties":{"age":{"type":"integer"},"gender":{"type":"string"},"height":{"type":"number"},"weight":{"type":"number"},"email":{"type":"string","format":"email"},"uid":{"type":"string"},"display_name":{"type":"string"},"admin_name":{"type":"string"},"last_session":{"type":"string"},"phone":{"type":"string"},"brand":{"type":"string"},"shoeModel":{"type":"string"},"shoeSize":{"type":"integer"},"leg_length":{"type":"number"},"ycom":{"type":"number"}}},"form_comments":{"description":"(Optional) Block-level recommendations.","type":"object","additionalProperties":{"type":"string"}},"date":{"description":"Report date in DD/MM/YYYY format.","type":"string"}}}}}},"400":{"description":"Bad Request - Invalid token or parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message describing the invalid request.","type":"string"}}}}}},"401":{"description":"Unauthorized - Token is invalid or expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that the token is missing or invalid.","type":"string"}}}}}},"403":{"description":"Forbidden - Admin access is required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that admin privileges are required.","type":"string"}}}}}},"404":{"description":"Not Found - Session not found or user does not have a valid payment plan.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating that the session was not found or payment plan is invalid.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message indicating a server-side failure.","type":"string"}}}}}}},"tags":["running"]}}}}
```

## Retrieve Total Metrics

> Calculates and returns the average metrics for all running sessions of the admin user, along with the detailed metrics and creation timestamp of the most recent session.\
> \
> \### Response Structure (HTTP 200)\
> \
> The response is a JSON object with the following structure:\
> \
> \- \*\*avg\_metrics\*\* \*(object)\*: Contains the average values calculated across all sessions.\
> &#x20; \- \*\*avg\_speed\*\* \*(number)\*: Average speed.\
> &#x20; \- \*\*avg\_power\*\* \*(number)\*: Average power.\
> &#x20; \- \*\*avg\_cadence\*\* \*(number)\*: Average cadence.\
> &#x20; \- \*\*avg\_flight\_time\*\* \*(number)\*: Average flight time.\
> \
> \- \*\*last\_session\_metrics\*\* \*(object)\*: Contains detailed metrics for the most recent session.\
> &#x20; \- \*\*speed\*\* \*(object)\*: Speed metrics with:\
> &#x20;     \- \*\*avg\*\* \*(number)\*: Average speed.\
> &#x20;     \- \*\*min\*\* \*(number)\*: Minimum speed.\
> &#x20;     \- \*\*max\*\* \*(number)\*: Maximum speed.\
> &#x20; \- \*\*normalized\_power\*\* \*(object)\*: Normalized power metrics with keys \`avg\`, \`min\`, \`max\`.\
> &#x20; \- \*\*cadence\*\* \*(object)\*: Cadence metrics with keys \`avg\`, \`min\`, \`max\`.\
> &#x20; \- \*\*total\_distance\*\* \*(number)\*: Total distance.\
> &#x20; \- \*\*power\*\* \*(object)\*: Power metrics with keys \`avg\`, \`min\`, \`max\`.\
> &#x20; \- \*\*stride\_time\*\* \*(object)\*: Stride time metrics with keys \`avg\`, \`min\`, \`max\`.\
> &#x20; \- \*\*total\_time\*\* \*(number)\*: Total session time.\
> &#x20; \- \*\*contact\_time\*\* \*(object)\*: Contact time metrics with keys \`avg\`, \`min\`, \`max\`.\
> &#x20; \- \*\*contact\_angle\*\* \*(object)\*: Contact angle metrics with keys \`avg\`, \`min\`, \`max\`.\
> &#x20; \- \*\*incline\*\* \*(object)\*: Incline metrics with keys \`avg\`, \`min\`, \`max\`.\
> &#x20; \- \*\*pace\*\* \*(object)\*: Pace metrics with keys \`avg\`, \`min\`, \`max\`.\
> &#x20; \- \*\*stride\_length\*\* \*(object)\*: Stride length metrics with keys \`avg\`, \`min\`, \`max\`.\
> &#x20; \- \*\*rbalance\*\* \*(object)\*: Balance metrics with keys \`avg\`, \`min\`, \`max\`.\
> &#x20; \- \*\*flight\_time\*\* \*(object)\*: Flight time metrics with keys \`avg\`, \`min\`, \`max\`.\
> &#x20; \- \*\*footstrike\*\* \*(string)\*: The footstrike type (e.g., 'midfoot').\
> \
> \- \*\*last\_session\_created\_at\*\* \*(object)\*: The creation timestamp of the most recent session, containing:\
> &#x20; \- \*\*date\*\* \*(string)\*: Date in DD/MM/YYYY format.\
> &#x20; \- \*\*time\*\* \*(string)\*: Time in HH:MM AM/PM format.\
> \
> \### Error Handling\
> \
> \- \*\*400 Bad Request\*\*: Invalid request parameters (e.g., invalid admin UID).\
> \- \*\*401 Unauthorized\*\*: Missing or invalid access token.\
> \- \*\*403 Forbidden\*\*: Insufficient privileges to retrieve total metrics.\
> \- \*\*404 Not Found\*\*: No sessions found or metrics unavailable.\
> \- \*\*500 Internal Server Error\*\*: An unexpected error occurred on the server.\
> \
> \### Security\
> \
> A valid API-KEY token must be provided in the \`Authorization\` header.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"},"ApiKeyAuth":{"type":"apiKey","name":"API-KEY","in":"header","description":"Enter your API key in the header: API-KEY: <api_key>"}}},"paths":{"/running/sessions/metrics/total/":{"get":{"operationId":"running_sessions_metrics_total_list","summary":"Retrieve Total Metrics","description":"Calculates and returns the average metrics for all running sessions of the admin user, along with the detailed metrics and creation timestamp of the most recent session.\n\n### Response Structure (HTTP 200)\n\nThe response is a JSON object with the following structure:\n\n- **avg_metrics** *(object)*: Contains the average values calculated across all sessions.\n  - **avg_speed** *(number)*: Average speed.\n  - **avg_power** *(number)*: Average power.\n  - **avg_cadence** *(number)*: Average cadence.\n  - **avg_flight_time** *(number)*: Average flight time.\n\n- **last_session_metrics** *(object)*: Contains detailed metrics for the most recent session.\n  - **speed** *(object)*: Speed metrics with:\n      - **avg** *(number)*: Average speed.\n      - **min** *(number)*: Minimum speed.\n      - **max** *(number)*: Maximum speed.\n  - **normalized_power** *(object)*: Normalized power metrics with keys `avg`, `min`, `max`.\n  - **cadence** *(object)*: Cadence metrics with keys `avg`, `min`, `max`.\n  - **total_distance** *(number)*: Total distance.\n  - **power** *(object)*: Power metrics with keys `avg`, `min`, `max`.\n  - **stride_time** *(object)*: Stride time metrics with keys `avg`, `min`, `max`.\n  - **total_time** *(number)*: Total session time.\n  - **contact_time** *(object)*: Contact time metrics with keys `avg`, `min`, `max`.\n  - **contact_angle** *(object)*: Contact angle metrics with keys `avg`, `min`, `max`.\n  - **incline** *(object)*: Incline metrics with keys `avg`, `min`, `max`.\n  - **pace** *(object)*: Pace metrics with keys `avg`, `min`, `max`.\n  - **stride_length** *(object)*: Stride length metrics with keys `avg`, `min`, `max`.\n  - **rbalance** *(object)*: Balance metrics with keys `avg`, `min`, `max`.\n  - **flight_time** *(object)*: Flight time metrics with keys `avg`, `min`, `max`.\n  - **footstrike** *(string)*: The footstrike type (e.g., 'midfoot').\n\n- **last_session_created_at** *(object)*: The creation timestamp of the most recent session, containing:\n  - **date** *(string)*: Date in DD/MM/YYYY format.\n  - **time** *(string)*: Time in HH:MM AM/PM format.\n\n### Error Handling\n\n- **400 Bad Request**: Invalid request parameters (e.g., invalid admin UID).\n- **401 Unauthorized**: Missing or invalid access token.\n- **403 Forbidden**: Insufficient privileges to retrieve total metrics.\n- **404 Not Found**: No sessions found or metrics unavailable.\n- **500 Internal Server Error**: An unexpected error occurred on the server.\n\n### Security\n\nA valid API-KEY token must be provided in the `Authorization` header.","responses":{"200":{"description":"Total metrics successfully retrieved.","content":{"application/json":{"schema":{"required":["avg_metrics","last_session_metrics","last_session_created_at"],"type":"object","properties":{"avg_metrics":{"description":"Average metrics across all sessions.","required":["avg_speed","avg_power","avg_cadence","avg_flight_time"],"type":"object","properties":{"avg_speed":{"description":"Average speed.","type":"number"},"avg_power":{"description":"Average power.","type":"number"},"avg_cadence":{"description":"Average cadence.","type":"number"},"avg_flight_time":{"description":"Average flight time.","type":"number"}}},"last_session_metrics":{"description":"Detailed metrics for the most recent session.","required":["speed","normalized_power","cadence","total_distance","power","stride_time","total_time","contact_time","contact_angle","incline","pace","stride_length","rbalance","flight_time","footstrike"],"type":"object","properties":{"speed":{"description":"Speed metrics.","required":["avg","min","max"],"type":"object","properties":{"avg":{"description":"Average speed.","type":"number"},"min":{"description":"Minimum speed.","type":"number"},"max":{"description":"Maximum speed.","type":"number"}}},"normalized_power":{"description":"Normalized power metrics.","required":["avg","min","max"],"type":"object","properties":{"avg":{"description":"Average normalized power.","type":"number"},"min":{"description":"Minimum normalized power.","type":"number"},"max":{"description":"Maximum normalized power.","type":"number"}}},"cadence":{"description":"Cadence metrics.","required":["avg","min","max"],"type":"object","properties":{"avg":{"description":"Average cadence.","type":"number"},"min":{"description":"Minimum cadence.","type":"number"},"max":{"description":"Maximum cadence.","type":"number"}}},"total_distance":{"description":"Total distance covered in the session.","type":"number"},"power":{"description":"Power metrics.","required":["avg","min","max"],"type":"object","properties":{"avg":{"description":"Average power.","type":"number"},"min":{"description":"Minimum power.","type":"number"},"max":{"description":"Maximum power.","type":"number"}}},"stride_time":{"description":"Stride time metrics.","required":["avg","min","max"],"type":"object","properties":{"avg":{"description":"Average stride time.","type":"number"},"min":{"description":"Minimum stride time.","type":"number"},"max":{"description":"Maximum stride time.","type":"number"}}},"total_time":{"description":"Total time of the session.","type":"number"},"contact_time":{"description":"Contact time metrics.","required":["avg","min","max"],"type":"object","properties":{"avg":{"description":"Average contact time.","type":"number"},"min":{"description":"Minimum contact time.","type":"number"},"max":{"description":"Maximum contact time.","type":"number"}}},"contact_angle":{"description":"Contact angle metrics.","required":["avg","min","max"],"type":"object","properties":{"avg":{"description":"Average contact angle.","type":"number"},"min":{"description":"Minimum contact angle.","type":"number"},"max":{"description":"Maximum contact angle.","type":"number"}}},"incline":{"description":"Incline metrics.","required":["avg","min","max"],"type":"object","properties":{"avg":{"description":"Average incline.","type":"number"},"min":{"description":"Minimum incline.","type":"number"},"max":{"description":"Maximum incline.","type":"number"}}},"pace":{"description":"Pace metrics.","required":["avg","min","max"],"type":"object","properties":{"avg":{"description":"Average pace.","type":"number"},"min":{"description":"Minimum pace.","type":"number"},"max":{"description":"Maximum pace.","type":"number"}}},"stride_length":{"description":"Stride length metrics.","required":["avg","min","max"],"type":"object","properties":{"avg":{"description":"Average stride length.","type":"number"},"min":{"description":"Minimum stride length.","type":"number"},"max":{"description":"Maximum stride length.","type":"number"}}},"rbalance":{"description":"Balance metrics.","required":["avg","min","max"],"type":"object","properties":{"avg":{"description":"Average balance.","type":"number"},"min":{"description":"Minimum balance.","type":"number"},"max":{"description":"Maximum balance.","type":"number"}}},"flight_time":{"description":"Flight time metrics.","required":["avg","min","max"],"type":"object","properties":{"avg":{"description":"Average flight time.","type":"number"},"min":{"description":"Minimum flight time.","type":"number"},"max":{"description":"Maximum flight time.","type":"number"}}},"footstrike":{"description":"The footstrike type (e.g., 'midfoot').","type":"string"}}},"last_session_created_at":{"description":"Creation timestamp of the most recent session.","required":["date","time"],"type":"object","properties":{"date":{"description":"Creation date in DD/MM/YYYY format.","type":"string"},"time":{"description":"Creation time in HH:MM AM/PM format.","type":"string"}}}}}}}},"400":{"description":"Bad Request - Invalid parameters (e.g., invalid admin UID).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message explaining the invalid request.","type":"string"}}}}}},"401":{"description":"Unauthorized - Missing or invalid access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that A valid API-KEY token was not provided.","type":"string"}}}}}},"403":{"description":"Forbidden - The user does not have sufficient privileges to retrieve total metrics.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating insufficient permissions.","type":"string"}}}}}},"404":{"description":"Not Found - No sessions found or metrics unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating that no sessions or metrics were found.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred on the server.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message indicating a server-side failure.","type":"string"}}}}}}},"tags":["running"]}}}}
```

## Create Form-Analysis Comment Threads

> Generate GenAI threads that produce personalised commentary for each running-form block (contact-angle, hip-extension at foot take-off, foot-contact angle & torso lean) \*\*plus\*\* an overall recommendation. Returns a mapping from block keys to thread IDs.\
> \
> \### Request\
> \- \*\*session\_id\*\* (path parameter, required): The ID of the running session for which to generate comment threads.\
> \
> \### Response (201)\
> A JSON object mapping each form block key to its corresponding GenAI thread ID:\
> \- \*\*contact\_angle\*\*: Thread ID for the contact angle block.\
> \- \*\*push\_angle\*\*: Thread ID for the push angle block.\
> \- \*\*knee\_ankle\*\*: Thread ID for the knee-ankle block.\
> \- \*\*general\_form\_recommendation\*\*: Thread ID for the overall form recommendation.\
> \
> \### Error Handling\
> \- \*\*403 Forbidden\*\*: User lacks a valid payment plan.\
> \- \*\*404 Not Found\*\*: Session not found or retrieval error.\
> \- \*\*500 Internal Server Error\*\*: Unexpected server error.\
> \
> \### Security\
> Requires A valid API-KEY token or API key in the request headers.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"},"ApiKeyAuth":{"type":"apiKey","name":"API-KEY","in":"header","description":"Enter your API key in the header: API-KEY: <api_key>"}}},"paths":{"/running/sessions/{session_id}/form-recommendations/":{"post":{"operationId":"running_sessions_form-recommendations_create","summary":"Create Form-Analysis Comment Threads","description":"Generate GenAI threads that produce personalised commentary for each running-form block (contact-angle, hip-extension at foot take-off, foot-contact angle & torso lean) **plus** an overall recommendation. Returns a mapping from block keys to thread IDs.\n\n### Request\n- **session_id** (path parameter, required): The ID of the running session for which to generate comment threads.\n\n### Response (201)\nA JSON object mapping each form block key to its corresponding GenAI thread ID:\n- **contact_angle**: Thread ID for the contact angle block.\n- **push_angle**: Thread ID for the push angle block.\n- **knee_ankle**: Thread ID for the knee-ankle block.\n- **general_form_recommendation**: Thread ID for the overall form recommendation.\n\n### Error Handling\n- **403 Forbidden**: User lacks a valid payment plan.\n- **404 Not Found**: Session not found or retrieval error.\n- **500 Internal Server Error**: Unexpected server error.\n\n### Security\nRequires A valid API-KEY token or API key in the request headers.","parameters":[{"schema":{"type":"string"},"name":"session_id","in":"path","description":"Target session ID","required":true}],"responses":{"201":{"description":"Threads created successfully","content":{"application/json":{"schema":{"description":"Mapping from form block keys to GenAI thread IDs.","required":["contact_angle","push_angle","knee_ankle","general_form_recommendation"],"type":"object","properties":{"contact_angle":{"description":"Thread ID for contact angle block.","type":"string"},"push_angle":{"description":"Thread ID for push angle block.","type":"string"},"knee_ankle":{"description":"Thread ID for knee-ankle block.","type":"string"},"general_form_recommendation":{"description":"Thread ID for overall form recommendation.","type":"string"}}}}}},"403":{"description":"User lacks a valid payment plan","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Session not found or other retrieval error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Unexpected server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}},"tags":["running"]}}}}
```

## Gait Analysis Report

> Retrieves a detailed gait analysis report for a given session. The endpoint requires the user to have a valid admin token and an active subscription plan (Pro, Premium, Enterprise, or Standard).\
> \
> \### Request\
> \- \*\*Path Parameter\*\*:\
> &#x20; \- \*\*session\_id\*\* \*(string, required)\*: The unique identifier of the session for which the gait analysis report is requested.\
> \
> \- \*\*Query Parameter\*\*:\
> &#x20; \- \*\*demo\*\* \*(boolean, optional)\*: Set to \`true\` to retrieve a pre-generated demo gait analysis report instead of a real one.\
> \
> \### Response Structure (HTTP 200)\
> The response is a JSON object containing:\
> \
> \- \*\*left\*\* \*(object)\* and \*\*right\*\* \*(object)\*: Each side contains gait analysis data with the following fields:\
> &#x20; \- \*\*peak\_time\*\* \*(number)\*: The peak time value identified in the gait analysis.\
> &#x20; \- \*\*initiator\*\* \*(string)\*: Indicates which side initiated the gait cycle.\
> &#x20; \- \*\*phases\*\* \*(object)\*: An object with named phases (e.g., \`flight\`, \`takeoff\`, \`mid\_stance\`, \`strike\`, \`new\_strike\`), where each phase contains:\
> &#x20;   \- \*\*video\_frame\*\* \*(integer)\*: The corresponding video frame.\
> &#x20;   \- \*\*graph\_phase\*\* \*(integer)\*: The phase value used in graphs.\
> &#x20;   \- \*\*video\_phase\*\* \*(integer)\*: The phase value in video timeline.\
> &#x20;   \- \*\*image\_url\*\* \*(string, URI)\*: Public image URL for the phase snapshot.\
> &#x20; \- \*\*angles\*\* \*(object)\*: Angle measurements for joints like \`posture\_angle\`, \`lhip\_angle\`, etc. Each includes:\
> &#x20;   \- \*\*current\*\* \*(array\[number])\*: Current frame angle values.\
> &#x20;   \- \*\*next\*\* \*(array\[number])\*: Next predicted values.\
> &#x20;   \- \*\*std\_dev\*\* \*(array\[number])\*: Standard deviation values.\
> &#x20; \- \*\*graph\_timestamps\*\* \*(array\[number])\*: Timestamps (ms) aligned with graph data.\
> \
> \- \*\*user\_info\*\* \*(object)\*: Information about the user who submitted the session, including:\
> &#x20; \- \*\*age\*\* \*(integer)\*\
> &#x20; \- \*\*gender\*\* \*(string)\*\
> &#x20; \- \*\*height\*\* \*(number, cm)\*\
> &#x20; \- \*\*weight\*\* \*(number, kg)\*\
> &#x20; \- \*\*email\*\* \*(string, email)\*\
> &#x20; \- \*\*uid\*\*, \*\*display\_name\*\*, \*\*admin\_name\*\*, \*\*last\_session\*\*, \*\*session\_count\*\*, \*\*phone\*\*, \*\*brand\*\*, \*\*shoeModel\*\*, \*\*shoeSize\*\*, \*\*leg\_length\*\*, \*\*ycom\*\* \*(various types)\*\
> \
> \- \*\*report\_comments\*\* \*(object, optional)\*: Suggestions or notes for angles such as \`right\_posture\_angle\`, \`left\_knee\_angle\`, etc.\
> \- \*\*date\*\* \*(string)\*: The date the report was generated in DD/MM/YYYY format.\
> \
> \### Error Handling\
> \- \*\*400 Bad Request\*\*: Invalid token or parameters.\
> \- \*\*401 Unauthorized\*\*: Token is missing or invalid.\
> \- \*\*403 Forbidden\*\*: Admin access is required.\
> \- \*\*404 Not Found\*\*: The session was not found or the user does not have a valid payment plan.\
> \- \*\*500 Internal Server Error\*\*: An unexpected error occurred on the server.\
> \
> \### Security\
> A valid API-KEY token must be provided in the \`Authorization\` header.

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"},"ApiKeyAuth":{"type":"apiKey","name":"API-KEY","in":"header","description":"Enter your API key in the header: API-KEY: <api_key>"}}},"paths":{"/running/sessions/{session_id}/gait-analysis/":{"post":{"operationId":"running_sessions_gait-analysis_create","summary":"Gait Analysis Report","description":"Retrieves a detailed gait analysis report for a given session. The endpoint requires the user to have a valid admin token and an active subscription plan (Pro, Premium, Enterprise, or Standard).\n\n### Request\n- **Path Parameter**:\n  - **session_id** *(string, required)*: The unique identifier of the session for which the gait analysis report is requested.\n\n- **Query Parameter**:\n  - **demo** *(boolean, optional)*: Set to `true` to retrieve a pre-generated demo gait analysis report instead of a real one.\n\n### Response Structure (HTTP 200)\nThe response is a JSON object containing:\n\n- **left** *(object)* and **right** *(object)*: Each side contains gait analysis data with the following fields:\n  - **peak_time** *(number)*: The peak time value identified in the gait analysis.\n  - **initiator** *(string)*: Indicates which side initiated the gait cycle.\n  - **phases** *(object)*: An object with named phases (e.g., `flight`, `takeoff`, `mid_stance`, `strike`, `new_strike`), where each phase contains:\n    - **video_frame** *(integer)*: The corresponding video frame.\n    - **graph_phase** *(integer)*: The phase value used in graphs.\n    - **video_phase** *(integer)*: The phase value in video timeline.\n    - **image_url** *(string, URI)*: Public image URL for the phase snapshot.\n  - **angles** *(object)*: Angle measurements for joints like `posture_angle`, `lhip_angle`, etc. Each includes:\n    - **current** *(array[number])*: Current frame angle values.\n    - **next** *(array[number])*: Next predicted values.\n    - **std_dev** *(array[number])*: Standard deviation values.\n  - **graph_timestamps** *(array[number])*: Timestamps (ms) aligned with graph data.\n\n- **user_info** *(object)*: Information about the user who submitted the session, including:\n  - **age** *(integer)*\n  - **gender** *(string)*\n  - **height** *(number, cm)*\n  - **weight** *(number, kg)*\n  - **email** *(string, email)*\n  - **uid**, **display_name**, **admin_name**, **last_session**, **session_count**, **phone**, **brand**, **shoeModel**, **shoeSize**, **leg_length**, **ycom** *(various types)*\n\n- **report_comments** *(object, optional)*: Suggestions or notes for angles such as `right_posture_angle`, `left_knee_angle`, etc.\n- **date** *(string)*: The date the report was generated in DD/MM/YYYY format.\n\n### Error Handling\n- **400 Bad Request**: Invalid token or parameters.\n- **401 Unauthorized**: Token is missing or invalid.\n- **403 Forbidden**: Admin access is required.\n- **404 Not Found**: The session was not found or the user does not have a valid payment plan.\n- **500 Internal Server Error**: An unexpected error occurred on the server.\n\n### Security\nA valid API-KEY token must be provided in the `Authorization` header.","parameters":[{"schema":{"type":"string"},"name":"session_id","in":"path","description":"The unique identifier of the session for which the gait analysis report is requested.","required":true},{"schema":{"type":"boolean"},"name":"demo","in":"query","description":"Set to `true` to retrieve a pre-generated demo gait analysis report instead of a real one.","required":false}],"responses":{"200":{"description":"Gait Analysis Report retrieved successfully.","content":{"application/json":{"schema":{"required":["left","right","user_info","date"],"type":"object","properties":{"left":{"description":"Gait analysis data for the left side.","required":["peak_time","phases","initiator","angles","graph_timestamps"],"type":"object","properties":{"peak_time":{"type":"number"},"phases":{"description":"Phases of the gait cycle with video and graph data.","type":"object","properties":{"flight":{"required":["video_frame","graph_phase","video_phase","image_url"],"type":"object","properties":{"video_frame":{"type":"integer"},"graph_phase":{"type":"integer"},"video_phase":{"type":"integer"},"image_url":{"type":"string","format":"uri"}}},"takeoff":{"required":["video_frame","graph_phase","video_phase","image_url"],"type":"object","properties":{"video_frame":{"type":"integer"},"graph_phase":{"type":"integer"},"video_phase":{"type":"integer"},"image_url":{"type":"string","format":"uri"}}},"mid_stance":{"required":["video_frame","graph_phase","video_phase","image_url"],"type":"object","properties":{"video_frame":{"type":"integer"},"graph_phase":{"type":"integer"},"video_phase":{"type":"integer"},"image_url":{"type":"string","format":"uri"}}},"new_strike":{"required":["video_frame","graph_phase","video_phase","image_url"],"type":"object","properties":{"video_frame":{"type":"integer"},"graph_phase":{"type":"integer"},"video_phase":{"type":"integer"},"image_url":{"type":"string","format":"uri"}}},"strike":{"required":["video_frame","graph_phase","video_phase","image_url"],"type":"object","properties":{"video_frame":{"type":"integer"},"graph_phase":{"type":"integer"},"video_phase":{"type":"integer"},"image_url":{"type":"string","format":"uri"}}}}},"initiator":{"type":"string"},"angles":{"type":"object"},"graph_timestamps":{"type":"array","items":{"type":"number"}}}},"right":{"description":"Gait analysis data for the right side.","required":["peak_time","phases","initiator","angles","graph_timestamps"],"type":"object","properties":{"peak_time":{"type":"number"},"phases":{"description":"Phases of the gait cycle with video and graph data.","type":"object","properties":{"flight":{"required":["video_frame","graph_phase","video_phase","image_url"],"type":"object","properties":{"video_frame":{"type":"integer"},"graph_phase":{"type":"integer"},"video_phase":{"type":"integer"},"image_url":{"type":"string","format":"uri"}}},"takeoff":{"required":["video_frame","graph_phase","video_phase","image_url"],"type":"object","properties":{"video_frame":{"type":"integer"},"graph_phase":{"type":"integer"},"video_phase":{"type":"integer"},"image_url":{"type":"string","format":"uri"}}},"mid_stance":{"required":["video_frame","graph_phase","video_phase","image_url"],"type":"object","properties":{"video_frame":{"type":"integer"},"graph_phase":{"type":"integer"},"video_phase":{"type":"integer"},"image_url":{"type":"string","format":"uri"}}},"new_strike":{"required":["video_frame","graph_phase","video_phase","image_url"],"type":"object","properties":{"video_frame":{"type":"integer"},"graph_phase":{"type":"integer"},"video_phase":{"type":"integer"},"image_url":{"type":"string","format":"uri"}}},"strike":{"required":["video_frame","graph_phase","video_phase","image_url"],"type":"object","properties":{"video_frame":{"type":"integer"},"graph_phase":{"type":"integer"},"video_phase":{"type":"integer"},"image_url":{"type":"string","format":"uri"}}}}},"initiator":{"type":"string"},"angles":{"type":"object"},"graph_timestamps":{"type":"array","items":{"type":"number"}}}},"user_info":{"description":"User information associated with the session.","required":["age","height","weight","email","uid"],"type":"object","properties":{"age":{"type":"integer"},"gender":{"type":"string"},"height":{"type":"number"},"weight":{"type":"number"},"email":{"type":"string","format":"email"},"uid":{"type":"string"},"display_name":{"type":"string"},"admin_name":{"type":"string"},"last_session":{"type":"string"},"session_count":{"type":"number"},"phone":{"type":"string"},"brand":{"type":"string"},"shoeModel":{"type":"string"},"shoeSize":{"type":"integer"},"leg_length":{"type":"number"},"ycom":{"type":"number"}}},"report_comments":{"description":"(Optional) Recommendations for joint angles.","type":"object"},"date":{"description":"The date of the gait analysis report in DD/MM/YYYY format.","type":"string"}}}}}},"400":{"description":"Bad Request - Invalid token or parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message describing the invalid request.","type":"string"}}}}}},"401":{"description":"Unauthorized - Token is invalid or expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that the token is missing or invalid.","type":"string"}}}}}},"403":{"description":"Forbidden - Admin access is required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that admin privileges are required.","type":"string"}}}}}},"404":{"description":"Not Found - Session not found or user does not have a valid payment plan.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating that the session was not found or payment plan is invalid.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message indicating a server-side failure.","type":"string"}}}}}}},"tags":["running"]}}}}
```

## Create Gait Analysis Recommendations Threads

> \### Create Gait Analysis Recommendations Threads\
> \
> This endpoint generates personalized recommendation threads for a specific session based on the user's running gait analysis. Each thread offers biomechanical insights, posture tips, and training guidance for different joint angles.\
> \
> \*\*Usage Example:\*\*\
> Send a \`POST\` request to \`/running/sessions/{session\_id}/recommendation/\` where \`{session\_id}\` is the session’s unique identifier.\
> \
> \*\*Parameters:\*\*\
> \- \`session\_id\` \*(string, required)\*: The unique ID of the session to generate threads for.\
> \
> \*\*Response Structure (HTTP 201):\*\*\
> Returns a JSON object mapping each gait angle metric to a thread ID, including both left and right sides:\
> \- \*\*left\_posture\_angle\*\*, \*\*left\_hip\_angle\*\*, \*\*left\_knee\_angle\*\*, \*\*left\_ankle\_angle\*\*\
> \- \*\*right\_posture\_angle\*\*, \*\*right\_hip\_angle\*\*, \*\*right\_knee\_angle\*\*, \*\*right\_ankle\_angle\*\*\
> \
> \*\*Notes:\*\*\
> \- The session must be valid and correspond to a gait analysis report.\
> \- Requires an active payment plan (Pro, Premium, Enterprise, or Standard).

```json
{"openapi":"3.1.1","info":{"title":"AIKYNETIX WEB API","version":"v2"},"servers":[{"url":"https://api.aikynetix.app"}],"security":[{"Bearer":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter your bearer token (Firebase auth) in the format: Bearer <token>"},"ApiKeyAuth":{"type":"apiKey","name":"API-KEY","in":"header","description":"Enter your API key in the header: API-KEY: <api_key>"}}},"paths":{"/running/sessions/{session_id}/recommendation/":{"post":{"operationId":"running_sessions_recommendation_create","summary":"Create Gait Analysis Recommendations Threads","description":"### Create Gait Analysis Recommendations Threads\n\nThis endpoint generates personalized recommendation threads for a specific session based on the user's running gait analysis. Each thread offers biomechanical insights, posture tips, and training guidance for different joint angles.\n\n**Usage Example:**\nSend a `POST` request to `/running/sessions/{session_id}/recommendation/` where `{session_id}` is the session’s unique identifier.\n\n**Parameters:**\n- `session_id` *(string, required)*: The unique ID of the session to generate threads for.\n\n**Response Structure (HTTP 201):**\nReturns a JSON object mapping each gait angle metric to a thread ID, including both left and right sides:\n- **left_posture_angle**, **left_hip_angle**, **left_knee_angle**, **left_ankle_angle**\n- **right_posture_angle**, **right_hip_angle**, **right_knee_angle**, **right_ankle_angle**\n\n**Notes:**\n- The session must be valid and correspond to a gait analysis report.\n- Requires an active payment plan (Pro, Premium, Enterprise, or Standard).","parameters":[{"schema":{"type":"string"},"name":"session_id","in":"path","description":"The unique identifier of the session.","required":true}],"responses":{"201":{"description":"Threads created successfully.","content":{"application/json":{"schema":{"description":"A dictionary mapping gait analysis metrics to thread IDs.","required":["left_hip_angle","left_posture_angle","left_ankle_angle","left_knee_angle","right_posture_angle","right_knee_angle","right_hip_angle","right_ankle_angle"],"type":"object","properties":{"left_hip_angle":{"description":"Thread ID for the left hip angle recommendations.","type":"string"},"left_posture_angle":{"description":"Thread ID for the left posture angle recommendations.","type":"string"},"left_ankle_angle":{"description":"Thread ID for the left ankle angle recommendations.","type":"string"},"left_knee_angle":{"description":"Thread ID for the left knee angle recommendations.","type":"string"},"right_posture_angle":{"description":"Thread ID for the right posture angle recommendations.","type":"string"},"right_knee_angle":{"description":"Thread ID for the right knee angle recommendations.","type":"string"},"right_hip_angle":{"description":"Thread ID for the right hip angle recommendations.","type":"string"},"right_ankle_angle":{"description":"Thread ID for the right ankle angle recommendations.","type":"string"}}}}}},"400":{"description":"Bad Request - Invalid token or parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message describing the invalid request.","type":"string"}}}}}},"401":{"description":"Unauthorized - Token is invalid or expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that the token is missing or invalid.","type":"string"}}}}}},"403":{"description":"Forbidden - Admin access is required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error indicating that admin privileges are required.","type":"string"}}}}}},"404":{"description":"Not Found - Session not found or user does not have a valid payment plan.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Error message indicating that the session was not found or payment plan is invalid.","type":"string"}}}}}},"500":{"description":"Internal Server Error - An unexpected error occurred.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"A detailed error message indicating a server-side failure.","type":"string"}}}}}}},"tags":["running"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aikynetix.app/api-documentation/developer-resources-and-api-reference/api-reference/running.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
