Fetch athlete session data

Session

The Session object represents a recorded session for the given athlete. It is the access point for training activities that were performed during the session.

A session in FYTT is a single bout of training composed of one or more workouts. You might generally think of it as a one or two hour training block where the athlete begins a session with a warm-up, practices some aspect of training, then ends with a cool-down.

ℹ️

Session Completion

Note that a recorded session does not necessarily represent a "completed" session, meaning that the athlete may or may not have completed all the prescribed activities. The presence of a recorded session only indicates that the athlete started the session.

In order to ascertain whether or not the athlete actually completed a given activity, you'll want to check the complete field for each individual set in the session (which are nested under the session workouts):

institutions.athletes.sessions.workouts.sets.complete

Use this information to make your own determination of "completeness" for a session as a whole and/or individual activities according to your needs.

(See our knowledge base section on sessions for more general information about sessions.)

date => ISO 8601 Date String

The date field returns a string formatted as an ISO 8601 date ("YYYY-MM-DD"), which represents the date that the athlete recorded the session.

description => String

The description field returns a text string of the session's description as provided by the coach.

name => String

The name field returns a text string of the session's name. (This field is not required in the UI. If the coach did not assign a session name, FYTT returns a derived name based on the context through which the session was scheduled.)

startedAt => ISO 8601 DateTime String|null

The startedAt field returns a ISO 8601 DateTime formatted string ("YYYY-MM-DDThh:mm:ssZ") of the time that the athlete started session. This field will return a null value if the athlete has not started the session from within the UI.

stoppedAt => ISO 8601 DateTime String|null

The stoppedAt field returns a ISO 8601 DateTime formatted string ("YYYY-MM-DDThh:mm:ssZ") of the time that the athlete stopped session. This field will return a null value if the athlete has not completed the session in the UI.

workouts => [Workout]

The workouts field returns an array of Workout objects that were assigned as part of the given session. (See our knowledge base section on workouts for more general information about workouts.)

Workout

The Workout object represents a recorded workout for the given session. It is the access point for individual sets that were performed as part of the workout.

A workout within FYTT is a single, modular piece of a workout session. For example, within a given session, you might have a workout called "Warmup," then a couple workouts named "Upper Body" and "Lower Body," then a workout called "Cooldown."

date => ISO 8601 String

The date field returns a string formatted as an ISO 8601 date ("YYYY-MM-DD"), which represents the date that the athlete recorded the workout.

description => String

The description field returns a text string of the workout's description as provided by the coach.

name => String

The name field returns a text string of the workout's name as provided by the coach.

sets => [Set]

The sets field returns an array of Set objects that were assigned as part of the given workout.

Set

The Set object is the most granular object of recorded athlete activity. It can be thought of as an assigned exercise and its recorded repetitions and attributes.

complete => Boolean

The complete field returns a boolean value that indicates whether or not the set was marked as completed by the athlete.

exerciseName => String

The exerciseName field returns a text string of the name of the exercise that was recorded.

measurements => JSON

The measurements field returns a JSON object containing all the measurement attributes of the given set. This includes all the possible measurement types, whether or not each type was measured, and the unit of measurement where applicable.

Example:

{
  "caloriesMeasured": false,
  "caloriesMeasurement": 0,
  "customMeasured": false,
  "customMeasurement": 0,
  "distanceMeasured": false,
  "distanceMeasurement": 0,
  "distanceMeasurementUnit": "meters",
  "heartRateMeasured": false,
  "heartRateMeasurement": 0,
  "heightMeasured": false,
  "heightMeasurement": 0,
  "heightMeasurementUnit": "inches",
  "repsMeasured": false,
  "repsMeasurement": 0,
  "restMeasured": false,
  "restMeasurement": 0,
  "speedMeasured": false,
  "speedMeasurement": 0,
  "speedMeasurementUnit": "miles_per_hour",
  "timeMeasured": false,
  "timeMeasurement": 0,
  "wattsMeasured": false,
  "wattsMeasurement": 0,
  "weightMeasured": false,
  "weightMeasurement": 0,
  "weightMeasurementUnit": "pounds"
}

Sample Query

Putting it all together, a sample query might look like this:

query {
  institution {
    athletes(athleteEmails: ["[email protected]"]) {
      email,
      sessions(startDate: "2023-07-01", endDate: "2023-07-31") {
        date,
        name,
        workouts {
          name,
          sets {
            exerciseName,
            measurements
          }
        }
      }
    }
  }
}

The response would be a JSON hash like the following:

{
  "data": {
    "institution": {
      "athletes": [
        {
          "email": "[email protected]",
          "sessions": [
            {
              "date": "2023-07-25",
              "name": "Team",
              "workouts": [
                {
                  "name": "Warmup",
                  "sets": [
                    {
                      "exerciseName": "Air Squat",
                      "measurements": {
                        "caloriesMeasured": false,
                        "caloriesMeasurement": 0,
                        "customMeasured": false,
                        "customMeasurement": 0,
                        "distanceMeasured": false,
                        "distanceMeasurement": 0,
                        "distanceMeasurementUnit": "meters",
                        "heartRateMeasured": false,
                        "heartRateMeasurement": 0,
                        "heightMeasured": false,
                        "heightMeasurement": 0,
                        "heightMeasurementUnit": "inches",
                        "repsMeasured": true,
                        "repsMeasurement": 25,
                        "restMeasured": false,
                        "restMeasurement": 0,
                        "speedMeasured": false,
                        "speedMeasurement": 0,
                        "speedMeasurementUnit": "miles_per_hour",
                        "timeMeasured": false,
                        "timeMeasurement": 0,
                        "wattsMeasured": false,
                        "wattsMeasurement": 0,
                        "weightMeasured": false,
                        "weightMeasurement": 0,
                        "weightMeasurementUnit": "pounds"
                      }
                    },
                    {
                      "exerciseName": "Air Squat",
                      "measurements": {
                        "caloriesMeasured": false,
                        "caloriesMeasurement": 0,
                        "customMeasured": false,
                        "customMeasurement": 0,
                        "distanceMeasured": false,
                        "distanceMeasurement": 0,
                        "distanceMeasurementUnit": "meters",
                        "heartRateMeasured": false,
                        "heartRateMeasurement": 0,
                        "heightMeasured": false,
                        "heightMeasurement": 0,
                        "heightMeasurementUnit": "inches",
                        "repsMeasured": true,
                        "repsMeasurement": 25,
                        "restMeasured": false,
                        "restMeasurement": 0,
                        "speedMeasured": false,
                        "speedMeasurement": 0,
                        "speedMeasurementUnit": "miles_per_hour",
                        "timeMeasured": false,
                        "timeMeasurement": 0,
                        "wattsMeasured": false,
                        "wattsMeasurement": 0,
                        "weightMeasured": false,
                        "weightMeasurement": 0,
                        "weightMeasurementUnit": "pounds"
                      }
                    },
                    {
                      "exerciseName": "Air Squat",
                      "measurements": {
                        "caloriesMeasured": false,
                        "caloriesMeasurement": 0,
                        "customMeasured": false,
                        "customMeasurement": 0,
                        "distanceMeasured": false,
                        "distanceMeasurement": 0,
                        "distanceMeasurementUnit": "meters",
                        "heartRateMeasured": false,
                        "heartRateMeasurement": 0,
                        "heightMeasured": false,
                        "heightMeasurement": 0,
                        "heightMeasurementUnit": "inches",
                        "repsMeasured": true,
                        "repsMeasurement": 25,
                        "restMeasured": false,
                        "restMeasurement": 0,
                        "speedMeasured": false,
                        "speedMeasurement": 0,
                        "speedMeasurementUnit": "miles_per_hour",
                        "timeMeasured": false,
                        "timeMeasurement": 0,
                        "wattsMeasured": false,
                        "wattsMeasurement": 0,
                        "weightMeasured": false,
                        "weightMeasurement": 0,
                        "weightMeasurementUnit": "pounds"
                      }
                    }
                  ]
                },
                {
                  "name": "Upper Body",
                  "sets": [
                    {
                      "exerciseName": "Bench Press",
                      "measurements": {
                        "caloriesMeasured": false,
                        "caloriesMeasurement": 0,
                        "customMeasured": false,
                        "customMeasurement": 0,
                        "distanceMeasured": false,
                        "distanceMeasurement": 0,
                        "distanceMeasurementUnit": "meters",
                        "heartRateMeasured": false,
                        "heartRateMeasurement": 0,
                        "heightMeasured": false,
                        "heightMeasurement": 0,
                        "heightMeasurementUnit": "inches",
                        "repsMeasured": true,
                        "repsMeasurement": 10,
                        "restMeasured": false,
                        "restMeasurement": 0,
                        "speedMeasured": false,
                        "speedMeasurement": 0,
                        "speedMeasurementUnit": "miles_per_hour",
                        "timeMeasured": false,
                        "timeMeasurement": 0,
                        "wattsMeasured": false,
                        "wattsMeasurement": 0,
                        "weightMeasured": true,
                        "weightMeasurement": 135,
                        "weightMeasurementUnit": "pounds"
                      }
                    },
                    {
                      "exerciseName": "Bench Press",
                      "measurements": {
                        "caloriesMeasured": false,
                        "caloriesMeasurement": 0,
                        "customMeasured": false,
                        "customMeasurement": 0,
                        "distanceMeasured": false,
                        "distanceMeasurement": 0,
                        "distanceMeasurementUnit": "meters",
                        "heartRateMeasured": false,
                        "heartRateMeasurement": 0,
                        "heightMeasured": false,
                        "heightMeasurement": 0,
                        "heightMeasurementUnit": "inches",
                        "repsMeasured": true,
                        "repsMeasurement": 10,
                        "restMeasured": false,
                        "restMeasurement": 0,
                        "speedMeasured": false,
                        "speedMeasurement": 0,
                        "speedMeasurementUnit": "miles_per_hour",
                        "timeMeasured": false,
                        "timeMeasurement": 0,
                        "wattsMeasured": false,
                        "wattsMeasurement": 0,
                        "weightMeasured": true,
                        "weightMeasurement": 135,
                        "weightMeasurementUnit": "pounds"
                      }
                    },
                    {
                      "exerciseName": "Bench Press",
                      "measurements": {
                        "caloriesMeasured": false,
                        "caloriesMeasurement": 0,
                        "customMeasured": false,
                        "customMeasurement": 0,
                        "distanceMeasured": false,
                        "distanceMeasurement": 0,
                        "distanceMeasurementUnit": "meters",
                        "heartRateMeasured": false,
                        "heartRateMeasurement": 0,
                        "heightMeasured": false,
                        "heightMeasurement": 0,
                        "heightMeasurementUnit": "inches",
                        "repsMeasured": true,
                        "repsMeasurement": 10,
                        "restMeasured": false,
                        "restMeasurement": 0,
                        "speedMeasured": false,
                        "speedMeasurement": 0,
                        "speedMeasurementUnit": "miles_per_hour",
                        "timeMeasured": false,
                        "timeMeasurement": 0,
                        "wattsMeasured": false,
                        "wattsMeasurement": 0,
                        "weightMeasured": true,
                        "weightMeasurement": 135,
                        "weightMeasurementUnit": "pounds"
                      }
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  }
}

⚠️

Avoid Request Timeouts

The amount of data requested can easily spiral out of control if you're not careful. To avoid request timeouts for very large amounts of data, we strongly advise that you limit the scope of each request to a subset of athletes and/or a relatively narrow date range (~30 days is probably the upper end of the recommended range depending on the number of athletes and the frequency/size of recorded sessions).