Managing All Sessions

Overall Session Management

Retrieve User Sessions

get

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.

Authorizations
Responses
200

User sessions retrieved successfully.

application/json
get
GET /session-management/sessions/ HTTP/1.1
Host: api.aikynetix.app
Authorization: YOUR_API_KEY
Accept: */*
{
  "sessions": {
    "ANY_ADDITIONAL_PROPERTY": {}
  }
}

Fetch Sessions by IDs

post

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.

Authorizations
Body
session_idsstring[]Required

List of session document IDs to retrieve.

Responses
200

Sessions retrieved successfully.

application/json
post
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"
    }
  }
}

Delete a Session

delete

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.

Authorizations
Path parameters
session_idanyRequired
Responses
200

Session deleted successfully.

application/json
delete
DELETE /session-management/sessions/{session_id} HTTP/1.1
Host: api.aikynetix.app
Authorization: YOUR_API_KEY
Accept: */*
{
  "success": "text"
}

Update Session Data

put

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.

Authorizations
Path parameters
session_idanyRequired
Body
titlestringOptional

New title for the session.

created_atstring · date-timeOptional

Updated session timestamp in YYYY-MM-DD HH:MM:SS format.

Responses
200

Session updated successfully.

application/json
put
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"
}

Fetch Filtered Sessions

get

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.

Authorizations
Query parameters
start_after_idstringOptional

Session ID after which to start pagination (only used if no filters are set).

end_before_idstringOptional

Session ID before which to end pagination (only used if no filters are set).

limitintegerOptional

Maximum number of sessions to fetch (default=10).

activitystring · enumOptional

Activity type filter (e.g., 'Running', 'Weightlifting', 'Vertical Jump', or 'Mobility Assessment').

Possible values:
start_datestringOptional

Filter sessions created on or after this date (dd/mm/yyyy).

end_datestringOptional

Filter sessions created on or before this date (dd/mm/yyyy).

titlestringOptional

Filter by sessions whose title contains this substring (case-insensitive).

user_idstringOptional

Filter by user ID stored in the session document.

uploaded_bystringOptional

ID of the user (admin / sub-admin) who uploaded the video.

video_statusstring · enumOptional

Processing state of the session video.

Possible values:
Responses
200

Filtered sessions retrieved successfully.

application/json
get
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"
}

Retrieve Analyzed Video URL

get

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.

Authorizations
Path parameters
session_idanyRequired
Query parameters
is_jumpbooleanOptional

Indicates whether this session is for jump analysis.

is_weightbooleanOptional

Indicates whether this session is for weightlifting analysis.

downloadbooleanOptional

If true, returns a signed URL that forces download of the video.

Responses
200

Analyzed video URL retrieved successfully.

application/json
get
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"
}

Upload/Generate Analyzed Video

post

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.

Authorizations
Path parameters
session_idanyRequired
Body
is_jumpbooleanOptional

Whether this session is jump-related.

is_weightbooleanOptional

Whether this session is weightlifting-related.

Responses
200

Analyzed video URL generated or updated successfully.

application/json
post
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?