FYTT API API Reference
The FYTT API employs a GraphQL endpoint to facilitate programmatic integrations with the platform. In order to use the API, you must first generate an integration auth token within your FYTT account. In order to make an API request, the auth token must be included as the Authorization header with the Bearer scheme declaration.
API Endpoints
Production:
https://app.fytt.io/api
Metrics
Add measurement data for athlete metrics
addKpiData
Add measurement data for athlete KPIs.
This mutation works by supplying an array of KpiInput
data. Each object in the array represents a KPI (identified by a UUID) along with an array of measurement data (KpiMeasurementInput
).
The measurement data is an array of objects containing an athlete email, the measurement date, and the measurement value. For each measurement object, an athlete measurement will be recorded for the KPI.
UUIDs for KPIs can be obtained by querying the API, or by viewing the KPI from within the web interface.
Attributes for adding KPI measurement data
Example
Request Content-Types:
application/json
Query
mutation addKpiData($kpis: [KpiInput!]!){
addKpiData(kpis: $kpis){
errors
status
}
}
Variables
{
"kpis": [
{
"uuid": "string",
"measurements": [
{
"athleteEmail": "string",
"date": "string",
"value": "number"
}
]
}
]
}
Try it now
mutation addKpiData($kpis: [KpiInput!]!){
addKpiData(kpis: $kpis){
errors
status
}
}
{
"kpis": [
{
"uuid": "string",
"measurements": [
{
"athleteEmail": "string",
"date": "string",
"value": "number"
}
]
}
]
}
Successful operation
Response Content-Types: application/json
Response Example (200 OK)
{
"data": {
"addKpiData": {
"errors": [
"string"
],
"status": "string"
}
}
}
addKpvData
Add measurement data for athlete KPVs.
This mutation works by supplying an array of KpvInput
data. Each object in the array represents a KPV (identified by a UUID) along with an array of measurement data (KpvMeasurementInput
).
The measurement data is an array of objects containing an athlete email, the measurement date, and the measurement value. For each measurement object, an athlete measurement will be recorded for the KPV.
UUIDs for KPVs can be obtained by querying the API, or by viewing the KPV from within the web interface.
In addition to adding measurements for exisiting KPVs, this operation allows you to create new KPVs along with the measurements for those KPVs.
To create a new KPV, simply supply the name
attribute instead of a uuid
. This performs a "find or create by name" operation. If the account already has a KPV by that name, it will select that one and save the measurements to it. Otherwise, it will create a new KPV with the name you provided, then add the measurements to the newly created KPV.
You can continue to reference the newly created KPV through the API by the original name you supplied, even if it gets changed by someone through the web interface.
Attributes of the KPV
Example
Request Content-Types:
application/json
Query
mutation addKpvData($kpvs: [KpvInput!]!){
addKpvData(kpvs: $kpvs){
errors
status
}
}
Variables
{
"kpvs": [
{
"uuid": "string",
"name": "string",
"unit": "string",
"measurements": [
{
"athleteEmail": "string",
"date": "string",
"value": "number"
}
]
}
]
}
Try it now
mutation addKpvData($kpvs: [KpvInput!]!){
addKpvData(kpvs: $kpvs){
errors
status
}
}
{
"kpvs": [
{
"uuid": "string",
"name": "string",
"unit": "string",
"measurements": [
{
"athleteEmail": "string",
"date": "string",
"value": "number"
}
]
}
]
}
Successful operation
Response Content-Types: application/json
Response Example (200 OK)
{
"data": {
"addKpvData": {
"errors": [
"string"
],
"status": "string"
}
}
}
Institution
Query basic information about the institution
institution
The institution object is the entry point for all objects you might want to query. For example, if you want to get a list of KPIs and their names and UUIDs, you would do the following:
query {
institution {
kpis {
name
uuid
}
}
}
The response would look something like this:
{
"data": {
"institution": {
"kpis": [
{
"name": "Bench Press 1RM",
"uuid": "0de0daeb-4011-4d3b-b368-03e46032014c"
},
{
"name": "Back Squat 1RM",
"uuid": "f43feed5-106b-4ffc-8889-84e35a576159"
},
]
}
}
}
Example
Request Content-Types:
application/json
Query
query institution{
institution{
name
}
}
Try it now
query institution{
institution{
name
}
}
Successful operation
Response Content-Types: application/json
Response Example (200 OK)
{
"data": {
"institution": {
"name": "string"
}
}
}
Schema Definitions
AddKpiDataPayload: object
Autogenerated return type of AddKpiData
-
errors:
object
-
- return:
-
arguments:
object
-
-
kpis:
object
-
- return:
-
arguments:
object
-
-
status:
object
-
- return:
-
arguments:
object
-
Example
{
"errors": {
"return": [
"string"
],
"arguments": {}
},
"kpis": {
"return": [
{
"description": {
"return": "string",
"arguments": {}
},
"name": {
"return": "string",
"arguments": {}
},
"unit": {
"return": "string",
"arguments": {}
},
"uuid": {
"return": "string",
"arguments": {}
}
}
],
"arguments": {}
},
"status": {
"return": "string",
"arguments": {}
}
}
AddKpvDataPayload: object
Autogenerated return type of AddKpvData
-
errors:
object
-
- return:
-
arguments:
object
-
-
kpvs:
object
-
- return:
-
arguments:
object
-
-
status:
object
-
- return:
-
arguments:
object
-
Example
{
"errors": {
"return": [
"string"
],
"arguments": {}
},
"kpvs": {
"return": [
{
"description": {
"return": "string",
"arguments": {}
},
"name": {
"return": "string",
"arguments": {}
},
"unit": {
"return": "string",
"arguments": {}
},
"uuid": {
"return": "string",
"arguments": {}
}
}
],
"arguments": {}
},
"status": {
"return": "string",
"arguments": {}
}
}
Float: number
Represents signed double-precision fractional values as specified by IEEE 754.
Example
number
Institution: object
The institution is the entry point for retrieving all objects.
-
kpis:
object
-
Get all institution KPIs
-
- return:
-
arguments:
object
-
-
kpvs:
object
-
Get all institution KPVs
-
- return:
-
arguments:
object
-
-
name:
object
-
- return:
-
arguments:
object
-
-
teams:
object
-
Get all institution teams
-
- return:
-
arguments:
object
-
Example
{
"kpis": {
"return": [
{
"description": {
"return": "string",
"arguments": {}
},
"name": {
"return": "string",
"arguments": {}
},
"unit": {
"return": "string",
"arguments": {}
},
"uuid": {
"return": "string",
"arguments": {}
}
}
],
"arguments": {}
},
"kpvs": {
"return": [
{
"description": {
"return": "string",
"arguments": {}
},
"name": {
"return": "string",
"arguments": {}
},
"unit": {
"return": "string",
"arguments": {}
},
"uuid": {
"return": "string",
"arguments": {}
}
}
],
"arguments": {}
},
"name": {
"return": "string",
"arguments": {}
},
"teams": {
"return": [
{
"athletes": {
"return": [
{
"email": {
"return": "string",
"arguments": {}
},
"name": {
"return": "string",
"arguments": {}
}
}
],
"arguments": {}
},
"name": {
"return": "string",
"arguments": {}
}
}
],
"arguments": {}
}
}
Kpi: object
Key Performance Indicator
-
description:
object
-
- return:
-
arguments:
object
-
-
name:
object
-
- return:
-
arguments:
object
-
-
unit:
object
-
- return:
-
arguments:
object
-
-
uuid:
object
-
- return:
-
arguments:
object
-
Example
{
"description": {
"return": "string",
"arguments": {}
},
"name": {
"return": "string",
"arguments": {}
},
"unit": {
"return": "string",
"arguments": {}
},
"uuid": {
"return": "string",
"arguments": {}
}
}
KpiInput: object
Attributes used to find a KPI and add athlete measurements
- uuid:
-
The UUID of the KPI
- measurements:
-
Array of KPI measurement inputs
Example
{
"uuid": "string",
"measurements": [
{
"athleteEmail": "string",
"date": "string",
"value": "number"
}
]
}
Kpv: object
Key Performance Variable
-
description:
object
-
- return:
-
arguments:
object
-
-
name:
object
-
- return:
-
arguments:
object
-
-
unit:
object
-
- return:
-
arguments:
object
-
-
uuid:
object
-
- return:
-
arguments:
object
-
Example
{
"description": {
"return": "string",
"arguments": {}
},
"name": {
"return": "string",
"arguments": {}
},
"unit": {
"return": "string",
"arguments": {}
},
"uuid": {
"return": "string",
"arguments": {}
}
}
KpvInput: object
Attributes used to find or create a KPV and add athlete measurements
- uuid:
-
The UUID of the KPV (optional if name provied)
- name:
-
An immutable, human-readable name for the KPV (optional if ID provided)
- unit:
-
Unit of measurement for the variable (optional)
- measurements:
-
Array of KPV measurement inputs
Example
{
"uuid": "string",
"name": "string",
"unit": "string",
"measurements": [
{
"athleteEmail": "string",
"date": "string",
"value": "number"
}
]
}
String: string
Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text.
Team: object
-
athletes:
object
-
get all athlete athletes
-
- return:
-
arguments:
object
-
-
name:
object
-
- return:
-
arguments:
object
-
Example
{
"athletes": {
"return": [
{
"email": {
"return": "string",
"arguments": {}
},
"name": {
"return": "string",
"arguments": {}
}
}
],
"arguments": {}
},
"name": {
"return": "string",
"arguments": {}
}
}