Managing All Sessions
Overall Session Management
Retrieves all sessions for the authenticated user, ordered by created_at
in descending order.
Response Structure
On success (HTTP 200), the response is a JSON object containing:
{
"sessions": {
"<session_id>": {
"created_at": {
"date": "DD/MM/YYYY",
"time": "HH:MM AM/PM"
},
"video_url": "...",
"segments": <number>,
"analyzed_video_url": "...",
"activity": "...",
"title": "...",
"user_id": "...",
"user_name": "...",
"report_comments": {...},
"metrics": {...}
// other session fields
},
"...": {...}
}
}
Error Handling
400 Bad Request: Invalid parameters (e.g., missing or malformed token).
401 Unauthorized: The token is missing or invalid.
403 Forbidden: The user lacks admin privileges.
404 Not Found: Unable to retrieve sessions (e.g., no sessions found).
500 Internal Server Error: An unexpected error occurred on the server.
Security
A valid API-KEY token must be provided in the Authorization
header.
User sessions retrieved successfully.
Bad Request - Invalid parameters or missing token.
Unauthorized - The token is missing or invalid.
Forbidden - The user lacks the required privileges.
Not Found - Sessions could not be retrieved (e.g., none found).
Internal Server Error - An unexpected issue occurred on the server.
GET /session-management/sessions/ HTTP/1.1
Host: api.aikynetix.app
Authorization: YOUR_API_KEY
Accept: */*
{
"sessions": {
"ANY_ADDITIONAL_PROPERTY": {}
}
}
Retrieve detailed session data for a list of session IDs. This endpoint is used when the client already has specific session IDs (e.g., from saved reports or analytics) and wants to retrieve their complete data.
Request Body
session_ids (required): A list of session document IDs to fetch.
Security
Requires Bearer Token in the Authorization
header.
Errors
400 Bad Request: Invalid input.
401 Unauthorized: Missing or invalid token.
403 Forbidden: The user is not authorized.
500 Internal Server Error: An unexpected error occurred.
List of session document IDs to retrieve.
Sessions retrieved successfully.
Bad Request - session_ids missing or invalid.
Unauthorized - No token provided.
Forbidden - User is not an admin.
Internal Server Error - Something went wrong on the server.
POST /session-management/sessions/by-ids/ HTTP/1.1
Host: api.aikynetix.app
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 24
{
"session_ids": [
"text"
]
}
{
"sessions": {
"ANY_ADDITIONAL_PROPERTY": {
"session_id": "text",
"activity": "text",
"created_at": "2025-08-24T00:52:11.531Z",
"uploaded_date": "2025-08-24T00:52:11.531Z",
"video_url": "https://example.com",
"thumbnail_url": "https://example.com",
"analyzed_video_url": "https://example.com",
"title": "text",
"user_id": "text",
"user_name": "text",
"uploaded_name": "text",
"uploaded_uid": "text",
"user_status": "text",
"video_status": "Processed",
"exercise": "text"
}
}
}
Deletes a specified session and all associated resources, including session data, video files, subcollections, and reports.
Path Parameter
session_id (string, required): The unique session identifier.
Response Structure
On success, the response contains:
success (string): Confirmation that the session was deleted.
Error Responses
400 Bad Request: Invalid request parameters.
401 Unauthorized: Token is invalid or missing.
403 Forbidden: User does not have admin privileges.
404 Not Found: Session not found.
500 Internal Server Error: An unexpected error occurred.
Session deleted successfully.
Bad Request - Invalid parameters or missing data.
Unauthorized - Token is invalid or expired.
Forbidden - User lacks necessary privileges.
Not Found - The specified session ID does not exist.
Internal Server Error - An unexpected issue occurred on the server.
DELETE /session-management/sessions/{session_id} HTTP/1.1
Host: api.aikynetix.app
Authorization: YOUR_API_KEY
Accept: */*
{
"success": "text"
}
Updates session details (such as title and created_at timestamp) for a specific session. Requires admin privileges and a valid payment plan.
Path Parameter
session_id (string, required): The unique session identifier.
Request Body (JSON)
title (string, optional): The updated title for the session.
created_at (string, optional, format:
YYYY-MM-DD HH:MM:SS
): The updated session timestamp.
Response Structure
On success, the response contains:
success (string): Confirmation that the session was updated.
Error Responses
400 Bad Request: Invalid request parameters or missing required data.
401 Unauthorized: Missing or invalid access token.
403 Forbidden: Insufficient privileges or invalid payment plan.
404 Not Found: Session not found.
500 Internal Server Error: An unexpected error occurred.
New title for the session.
Updated session timestamp in YYYY-MM-DD HH:MM:SS
format.
Session updated successfully.
Bad Request - Invalid parameters or missing data.
Unauthorized - Missing or invalid access token.
Forbidden - The user does not have sufficient privileges to retrieve total metrics.
Not Found - The specified session ID does not exist.
Internal Server Error - An unexpected issue occurred on the server.
PUT /session-management/sessions/{session_id} HTTP/1.1
Host: api.aikynetix.app
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 70
{
"title": "Updated Running Session",
"created_at": "2025-02-06 14:30:00"
}
{
"success": "text"
}
Retrieves user sessions filtered by optional parameters such as date range, activity type, title, or user ID. It also supports pagination via start_after_id
or end_before_id
when no filters are applied.
Query Parameters
start_after_id (string, optional): Session ID after which to start pagination. Used only if no filters are set.
end_before_id (string, optional): Session ID before which to end pagination. Used only if no filters are set.
limit (integer, optional): Maximum number of sessions to fetch (default=10).
activity (string, optional): Filter by activity type (e.g., 'Running', 'Vertical Jump').
start_date (string, optional, format: dd/mm/yyyy): Filter sessions created on or after this date.
end_date (string, optional, format: dd/mm/yyyy): Filter sessions created on or before this date.
title (string, optional): Filter by sessions whose title contains this substring (case-insensitive).
user_id (string, optional): Filter by user ID stored in the session. | uploaded_by | string | NEW UID that uploaded the raw video. | | video_status | string
processed\|failed
| NEW current state. |
Response Structure (HTTP 200)
On success, the response is a JSON object containing:
query_count (integer): The total number of matching sessions.
sessions (object): A dictionary of session documents keyed by their session IDs.
first_doc_id (string or null): The ID of the first document in the returned set.
last_doc_id (string or null): The ID of the last document in the returned set.
Each session object may include fields such as video_url
, activity
, created_at
, title
, etc., plus nested data (e.g. report_comments
, metrics
). Note that created_at
is returned as a nested object with date
and time
.
Error Handling
400 Bad Request: Invalid parameters (e.g., malformed date string) or missing user token.
401 Unauthorized: The token is missing or invalid.
403 Forbidden: The user lacks admin privileges.
404 Not Found: No matching sessions found.
500 Internal Server Error: An unexpected error occurred on the server.
Security
A valid API-KEY token must be provided in the Authorization
header.
Session ID after which to start pagination (only used if no filters are set).
Session ID before which to end pagination (only used if no filters are set).
Maximum number of sessions to fetch (default=10).
Activity type filter (e.g., 'Running', 'Weightlifting', 'Vertical Jump', or 'Mobility Assessment').
Filter sessions created on or after this date (dd/mm/yyyy).
Filter sessions created on or before this date (dd/mm/yyyy).
Filter by sessions whose title contains this substring (case-insensitive).
Filter by user ID stored in the session document.
ID of the user (admin / sub-admin) who uploaded the video.
Processing state of the session video.
Filtered sessions retrieved successfully.
Bad Request - Potentially invalid parameters (malformed date, etc.) or missing user token.
Unauthorized - Missing or invalid access token.
Forbidden - The user lacks admin privileges.
Not Found - No matching sessions found or resource unavailable.
Internal Server Error - An unexpected error occurred on the server.
GET /session-management/sessions/filter/ HTTP/1.1
Host: api.aikynetix.app
Authorization: YOUR_API_KEY
Accept: */*
{
"query_count": 1,
"sessions": {
"ANY_ADDITIONAL_PROPERTY": {}
},
"first_doc_id": "text",
"last_doc_id": "text"
}
Retrieves the analyzed video URL for a specific session, or attempts to create it if it does not exist.
Path Parameter
session_id (string, required): The unique identifier of the session.
Query Parameters
These optional flags determine which kind of analysis to perform if the video doesn't exist:
is_jump (boolean, optional): Indicates whether this session is for jump analysis.
is_weight (boolean, optional): Indicates whether this session is for weightlifting analysis.
download (boolean, optional): If
true
, returns a signed URL that forces the browser to download the video instead of displaying it.
Response (HTTP 200)
Returns a JSON object with an analyzed_video_url
key if successful:
{
"analyzed_video_url": "https://storage.googleapis.com/.../analyzed_video.mp4"
}
Error Handling
400 Bad Request: Invalid parameters (e.g., missing or invalid admin UID).
401 Unauthorized: Token is missing or invalid.
403 Forbidden: The user does not have the right privileges or plan.
404 Not Found: The session data or resources could not be found.
500 Internal Server Error: An unexpected error occurred on the server.
Security
A valid API-KEY token must be provided in the Authorization
header.
Indicates whether this session is for jump analysis.
Indicates whether this session is for weightlifting analysis.
If true, returns a signed URL that forces download of the video.
Analyzed video URL retrieved successfully.
Bad Request - Possibly invalid parameters.
Unauthorized - Token is invalid or missing.
Forbidden - User lacks privileges or plan.
Not Found - Session data or resource not found.
Internal Server Error - A server-side error occurred.
GET /session-management/sessions/{session_id}/analyzed-video/ HTTP/1.1
Host: api.aikynetix.app
Authorization: YOUR_API_KEY
Accept: */*
{
"analyzed_video_url": "https://example.com"
}
Uploads or generates an analyzed video for a specific session, returning its URL.
Path Parameter
session_id (string, required): The unique identifier of the session.
Request Body (JSON)
{
"is_jump": true,
"is_weight": false
}
is_jump (boolean, optional): If true, treat this as a jump session.
is_weight (boolean, optional): If true, treat this as a weightlifting session.
Response Structure (HTTP 200)
On success, returns a JSON object with the analyzed_video_url
:
{
"analyzed_video_url": "https://storage.googleapis.com/.../analyzed_video.mp4"
}
Error Handling
400 Bad Request: Invalid parameters or session already analyzed.
401 Unauthorized: Token is missing or invalid.
403 Forbidden: The user does not have a valid plan.
404 Not Found: Session data not found.
500 Internal Server Error: An unexpected error occurred on the server.
Security
A valid API-KEY token must be provided in the Authorization
header.
Whether this session is jump-related.
Whether this session is weightlifting-related.
Analyzed video URL generated or updated successfully.
Bad Request - Possibly invalid session data or video already analyzed.
Unauthorized - The token is missing or invalid.
Forbidden - The user does not have a valid payment plan.
Not Found - Session not found or creation failed.
Internal Server Error - A server-side error occurred.
POST /session-management/sessions/{session_id}/analyzed-video/ HTTP/1.1
Host: api.aikynetix.app
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 34
{
"is_jump": true,
"is_weight": false
}
{
"analyzed_video_url": "https://example.com"
}
Last updated
Was this helpful?