Skip to content

Workouts

workouts


POST /api/v1/workouts/schedule

Create Scheduled Workout

Description

BETA: Workout functionality in SweatStack is experimental and subject to breaking changes. Some functionality may be incomplete or behave unexpectedly. Not recommended for production use.

Input parameters

Parameter In Type Default Nullable Description
HTTPBearer header string N/A No JWT Bearer token
refreshed-token header No
token cookie string No

Request body

{
    "swf": {
        "$schema": null,
        "version": "string",
        "title": null,
        "description": null,
        "sport": "string",
        "content": [
            null
        ]
    },
    "start": "2022-04-13T15:42:05.901Z",
    "parameters": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "swf": {
            "$ref": "#/components/schemas/Workout-Input"
        },
        "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start"
        },
        "parameters": {
            "anyOf": [
                {
                    "additionalProperties": {
                        "type": "number"
                    },
                    "type": "object"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Parameters"
        }
    },
    "type": "object",
    "required": [
        "swf",
        "start"
    ],
    "title": "ScheduledWorkoutCreate"
}

Responses

{
    "id": "string",
    "sport": "cycling",
    "start": "2022-04-13T15:42:05.901Z",
    "swf": {
        "$schema": null,
        "version": "string",
        "title": null,
        "description": null,
        "sport": "string",
        "content": [
            null
        ]
    },
    "parameters": null,
    "application_id": null,
    "application_name": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "title": "Id"
        },
        "sport": {
            "$ref": "#/components/schemas/Sport"
        },
        "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start"
        },
        "swf": {
            "$ref": "#/components/schemas/Workout-Output"
        },
        "parameters": {
            "anyOf": [
                {
                    "additionalProperties": {
                        "type": "number"
                    },
                    "type": "object"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Parameters"
        },
        "application_id": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Application Id"
        },
        "application_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Application Name"
        }
    },
    "type": "object",
    "required": [
        "id",
        "sport",
        "start",
        "swf"
    ],
    "title": "ScheduledWorkoutResponse"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/workouts/schedule/

List Scheduled Workouts

Description

BETA: Workout functionality in SweatStack is experimental and subject to breaking changes.

Input parameters

Parameter In Type Default Nullable Description
HTTPBearer header string N/A No JWT Bearer token
application_id query No Filter to workouts created by a specific application. Pass the application's id to scope the list to that app's workouts only.
limit query integer 50 No
offset query integer 0 No
refreshed-token header No
token cookie string No

Responses

[
    {
        "id": "string",
        "sport": "cycling",
        "start": "2022-04-13T15:42:05.901Z",
        "swf": {
            "$schema": null,
            "version": "string",
            "title": null,
            "description": null,
            "sport": "string",
            "content": [
                null
            ]
        },
        "parameters": null,
        "application_id": null,
        "application_name": null
    }
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "array",
    "items": {
        "$ref": "#/components/schemas/ScheduledWorkoutResponse"
    },
    "title": "Response List Scheduled Workouts Api V1 Workouts Schedule  Get"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/workouts/schedule/{workout_id}

Get Scheduled Workout

Description

BETA: Workout functionality in SweatStack is experimental and subject to breaking changes.

Input parameters

Parameter In Type Default Nullable Description
HTTPBearer header string N/A No JWT Bearer token
refreshed-token header No
token cookie string No
workout_id path string No

Responses

{
    "id": "string",
    "sport": "cycling",
    "start": "2022-04-13T15:42:05.901Z",
    "swf": {
        "$schema": null,
        "version": "string",
        "title": null,
        "description": null,
        "sport": "string",
        "content": [
            null
        ]
    },
    "parameters": null,
    "application_id": null,
    "application_name": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "title": "Id"
        },
        "sport": {
            "$ref": "#/components/schemas/Sport"
        },
        "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start"
        },
        "swf": {
            "$ref": "#/components/schemas/Workout-Output"
        },
        "parameters": {
            "anyOf": [
                {
                    "additionalProperties": {
                        "type": "number"
                    },
                    "type": "object"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Parameters"
        },
        "application_id": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Application Id"
        },
        "application_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Application Name"
        }
    },
    "type": "object",
    "required": [
        "id",
        "sport",
        "start",
        "swf"
    ],
    "title": "ScheduledWorkoutResponse"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

DELETE /api/v1/workouts/schedule/{workout_id}

Delete Scheduled Workout

Description

BETA: Workout functionality in SweatStack is experimental and subject to breaking changes.

Note: deleting a scheduled workout in SweatStack does NOT remove it from connected integrations (e.g. Garmin Connect). The workout remains on the user's Garmin calendar.

Input parameters

Parameter In Type Default Nullable Description
HTTPBearer header string N/A No JWT Bearer token
refreshed-token header No
token cookie string No
workout_id path string No

Responses

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

Schemas

ConstantValue

Name Type Description
quantity
type string
value

Effort

Type: string

HTTPValidationError

Name Type Description
detail Array<ValidationError>

IntensityQuantity

Type: string

Note

Name Type Description
text string
type string

ParameterRef

Name Type Description
of string
percent

RampValue

Name Type Description
end
quantity
start
type string

RangeValue

Name Type Description
max
min
quantity
type string

Repeat-Input

Name Type Description
content Array<>
count
note
type string

Repeat-Output

Name Type Description
content Array<>
count
note
type string

RepeatCount

Name Type Description
max integer
min integer

ScheduledWorkoutCreate

Name Type Description
parameters
start string(date-time)
swf Workout-Input

ScheduledWorkoutResponse

Name Type Description
application_id
application_name
id string
parameters
sport Sport
start string(date-time)
swf Workout-Output

Section-Input

Name Type Description
content Array<>
note
phase SectionPhase
type string

Section-Output

Name Type Description
content Array<>
note
phase SectionPhase
type string

SectionPhase

Type: string

Sport

Type: string

Step-Input

Name Type Description
effort Effort
intensity
note
type string
volume

Step-Output

Name Type Description
effort Effort
intensity
note
type string
volume

TTERef

Name Type Description
tte

ValidationError

Name Type Description
loc Array<>
msg string
type string

VolumeQuantity

Type: string

Workout-Input

Name Type Description
$schema
content Array<>
description
sport string Sport string in OpenSportTaxonomy format (e.g., 'cycling.road+stationary')
title
version string

Workout-Output

Name Type Description
$schema
content Array<>
description
sport string Sport string in OpenSportTaxonomy format (e.g., 'cycling.road+stationary')
title
version string

ZoneValue

Name Type Description
of integer
quantity IntensityQuantity
type string
zone integer

Security schemes

Name Type Scheme Description
HTTPBearer http bearer
HTTPBasic http basic