API Documentation for Workout Creation, Update, and Deletion

Overview

The Workout JSON API allows clients to define a workout structure, outlining a series of workout flows. Depending on the workflow type, different fields are required. This document specifies the accepted JSON format and fields for creating, updating, and deleting workouts.

Table of Contents

Authorization

All API requests require authorization. Include the following header with your request:

Authorization: Bearer SECRET_TOKEN

Replace SECRET_TOKEN with your actual secret token.

Base Fields

Every workout JSON should contain the following base fields:

Field Type Required Description
name string Yes Name of the workout.
durationInSeconds int No Total workout duration. If omitted, will sum durations of workoutFlow items.
displaySummaryScreen bool No Display a summary screen post-workout? Default: False.
imageCover string No URL of workout cover image. Defaults to FittyAI logo if omitted.
useSound bool No Should sound be used? Default: False.
repetitionAudio string No URL to repetition audio. Defaults to FittyAI sound if omitted.
visibilityInstructionsAudio string No URL for visibility instruction audio. Defaults to FittyAI instructions if omitted.
workoutFlow list Yes List of workout flow items.

Workout Flow Items

Depending on the workflow type, different fields are required:

Note: Mov files are not necessary to be provided, they are only necessary when transparent videos are being provided.

  1. Setup Tutorial:
    • type: Must be “setupTutorial”.
    • videoUrl: URL of the tutorial video.
    • videoUrlMov: URL in MOV format of the tutorial video.
  2. Camera Setup Validation:
    • type: Must be “cameraSetupValidation”.
    • duration: Time (in seconds) for the camera setup validation.
    • audioUrl: URL of the audio for this validation.
    • showCameraSetupValidation: Should the camera setup validation be shown? (set this to True)
  3. Tutorial:
    • type: Must be “tutorial”.
    • audioUrl: URL of tutorial audio.
    • apiName: Corresponding API name for the tutorial.
    • reps: Number of repetitions for the tutorial.
    • videoUrl: URL of the tutorial video.
    • videoUrlMov: URL in MOV format of the tutorial video.
  4. Tips:
    • type: Must be “tips”.
    • duration: Duration (in seconds) for the tips.
    • apiName: API name corresponding to the tips (e.g., “jumping_jack”).
    • name: Display name of the exercise (e.g., “Jumping Jack”).
    • videoUrl: URL of the tips video.
    • videoUrlMov: URL in MOV format of the tips video.
  5. Break:
    • type: Must be “break”.
    • duration: Duration (in seconds) for the break.
    • apiName: API name corresponding to the break.
    • name: Display name of the exercise.
    • videoUrl: URL of the break video.
    • videoUrlMov: URL in MOV format of the break video.
  6. Exercise:
    • type: Must be “exercise”.
    • duration: Duration (in seconds) for the exercise.
    • apiName: API name corresponding to the exercise.
    • name: Display name of the exercise.
    • reps: Number of repetitions for the exercise.
    • videoUrl: URL of the exercise video.
    • videoUrlMov: URL in MOV format of the exercise video.

Updating Workouts

To update an existing workout:

  • Make a PUT request with the updated workout details in the above format.
  • Add workoutId to the path parameters.

Deleting Workouts

To delete an existing workout:

  • Make a DELETE request.
  • Add workoutId to the path parameters.

API Endpoints

  • Create a Workout:
    • https://38en04sov6.execute-api.us-west-2.amazonaws.com/v1/{companyName}/workouts
    • Method: POST
  • Update or Delete Workout:
    • https://38en04sov6.execute-api.us-west-2.amazonaws.com/v1/{companyName}/workouts/{workoutId}
    • Methods: PUT, DELETE