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",
        "pool_length": null,
        "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",
            "description": "Naive local datetime (ISO 8601 without an offset, e.g. `2026-05-25T07:00:00`). A scheduled workout is a plan in the athlete's local wall-clock, so this carries no timezone."
        },
        "parameters": {
            "anyOf": [
                {
                    "additionalProperties": {
                        "type": "number"
                    },
                    "type": "object"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Parameters"
        }
    },
    "type": "object",
    "required": [
        "swf",
        "start"
    ],
    "title": "ScheduledWorkoutCreate"
}

Responses

{
    "id": "string",
    "sport": "string",
    "start": "2022-04-13T15:42:05.901Z",
    "swf": {
        "$schema": null,
        "version": "string",
        "title": null,
        "description": null,
        "sport": "string",
        "pool_length": null,
        "content": [
            null
        ]
    },
    "parameters": null,
    "application_id": null,
    "application_name": null,
    "deliveries": [
        {
            "integration": "string",
            "status": "string",
            "reason": null,
            "detail": null,
            "updated_at": null
        }
    ],
    "warnings": [
        {
            "integration": "string",
            "issues": [
                {}
            ],
            "adjustments": [
                {}
            ]
        }
    ]
}
⚠️ 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": {
            "type": "string",
            "description": "Sport string in OpenSportTaxonomy format (e.g., 'cycling.road+stationary')"
        },
        "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start",
            "description": "Naive local datetime (ISO 8601 without an offset, e.g. `2026-05-25T07:00:00`). A scheduled workout is a plan in the athlete's local wall-clock, so this carries no timezone."
        },
        "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"
        },
        "deliveries": {
            "items": {
                "$ref": "#/components/schemas/DeliveryView"
            },
            "type": "array",
            "title": "Deliveries"
        },
        "warnings": {
            "items": {
                "$ref": "#/components/schemas/WorkoutWarning"
            },
            "type": "array",
            "title": "Warnings"
        }
    },
    "type": "object",
    "required": [
        "id",
        "sport",
        "start",
        "swf"
    ],
    "title": "ScheduledWorkoutCreateResponse",
    "description": "Create/update response. Adds `warnings`: a create-time, per-integration compatibility\nheads-up that a plain read (`GET`) cannot recompute, so it lives only here. Empty when every\nconnected integration will consume the workout as-is."
}

{
    "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": "string",
        "start": "2022-04-13T15:42:05.901Z",
        "swf": {
            "$schema": null,
            "version": "string",
            "title": null,
            "description": null,
            "sport": "string",
            "pool_length": null,
            "content": [
                null
            ]
        },
        "parameters": null,
        "application_id": null,
        "application_name": null,
        "deliveries": [
            {
                "integration": "string",
                "status": "string",
                "reason": null,
                "detail": null,
                "updated_at": 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"
}

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

Update Scheduled Workout

Description

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

Replaces the workout's plan (swf/start/parameters) and re-delivers to connected integrations in place, preserving the integration-side identity (e.g. the Garmin workout is updated, not recreated). Best-effort and asynchronous, like create; read deliveries for the outcome.

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

Request body

{
    "swf": {
        "$schema": null,
        "version": "string",
        "title": null,
        "description": null,
        "sport": "string",
        "pool_length": null,
        "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",
            "description": "Naive local datetime (ISO 8601 without an offset, e.g. `2026-05-25T07:00:00`). A scheduled workout is a plan in the athlete's local wall-clock, so this carries no timezone."
        },
        "parameters": {
            "anyOf": [
                {
                    "additionalProperties": {
                        "type": "number"
                    },
                    "type": "object"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Parameters"
        }
    },
    "type": "object",
    "required": [
        "swf",
        "start"
    ],
    "title": "ScheduledWorkoutCreate"
}

Responses

{
    "id": "string",
    "sport": "string",
    "start": "2022-04-13T15:42:05.901Z",
    "swf": {
        "$schema": null,
        "version": "string",
        "title": null,
        "description": null,
        "sport": "string",
        "pool_length": null,
        "content": [
            null
        ]
    },
    "parameters": null,
    "application_id": null,
    "application_name": null,
    "deliveries": [
        {
            "integration": "string",
            "status": "string",
            "reason": null,
            "detail": null,
            "updated_at": null
        }
    ],
    "warnings": [
        {
            "integration": "string",
            "issues": [
                {}
            ],
            "adjustments": [
                {}
            ]
        }
    ]
}
⚠️ 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": {
            "type": "string",
            "description": "Sport string in OpenSportTaxonomy format (e.g., 'cycling.road+stationary')"
        },
        "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start",
            "description": "Naive local datetime (ISO 8601 without an offset, e.g. `2026-05-25T07:00:00`). A scheduled workout is a plan in the athlete's local wall-clock, so this carries no timezone."
        },
        "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"
        },
        "deliveries": {
            "items": {
                "$ref": "#/components/schemas/DeliveryView"
            },
            "type": "array",
            "title": "Deliveries"
        },
        "warnings": {
            "items": {
                "$ref": "#/components/schemas/WorkoutWarning"
            },
            "type": "array",
            "title": "Warnings"
        }
    },
    "type": "object",
    "required": [
        "id",
        "sport",
        "start",
        "swf"
    ],
    "title": "ScheduledWorkoutCreateResponse",
    "description": "Create/update response. Adds `warnings`: a create-time, per-integration compatibility\nheads-up that a plain read (`GET`) cannot recompute, so it lives only here. Empty when every\nconnected integration will consume the workout as-is."
}

{
    "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": "string",
    "start": "2022-04-13T15:42:05.901Z",
    "swf": {
        "$schema": null,
        "version": "string",
        "title": null,
        "description": null,
        "sport": "string",
        "pool_length": null,
        "content": [
            null
        ]
    },
    "parameters": null,
    "application_id": null,
    "application_name": null,
    "deliveries": [
        {
            "integration": "string",
            "status": "string",
            "reason": null,
            "detail": null,
            "updated_at": 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": {
            "type": "string",
            "description": "Sport string in OpenSportTaxonomy format (e.g., 'cycling.road+stationary')"
        },
        "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start",
            "description": "Naive local datetime (ISO 8601 without an offset, e.g. `2026-05-25T07:00:00`). A scheduled workout is a plan in the athlete's local wall-clock, so this carries no timezone."
        },
        "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"
        },
        "deliveries": {
            "items": {
                "$ref": "#/components/schemas/DeliveryView"
            },
            "type": "array",
            "title": "Deliveries"
        }
    },
    "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.

Deleting a scheduled workout also removes it from connected integrations (e.g. it is unscheduled from the user's Garmin calendar). That cleanup is best-effort and asynchronous: the delete succeeds immediately, and a device-side failure leaves at most a stale entry.

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

DeliveryView

Name Type Description
detail
integration string
reason
status string
updated_at

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) Naive local datetime (ISO 8601 without an offset, e.g. `2026-05-25T07:00:00`). A scheduled workout is a plan in the athlete's local wall-clock, so this carries no timezone.
swf Workout-Input

ScheduledWorkoutCreateResponse

Name Type Description
application_id
application_name
deliveries Array<DeliveryView>
id string
parameters
sport string Sport string in OpenSportTaxonomy format (e.g., 'cycling.road+stationary')
start string(date-time) Naive local datetime (ISO 8601 without an offset, e.g. `2026-05-25T07:00:00`). A scheduled workout is a plan in the athlete's local wall-clock, so this carries no timezone.
swf Workout-Output
warnings Array<WorkoutWarning>

ScheduledWorkoutResponse

Name Type Description
application_id
application_name
deliveries Array<DeliveryView>
id string
parameters
sport string Sport string in OpenSportTaxonomy format (e.g., 'cycling.road+stationary')
start string(date-time) Naive local datetime (ISO 8601 without an offset, e.g. `2026-05-25T07:00:00`). A scheduled workout is a plan in the athlete's local wall-clock, so this carries no timezone.
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

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
pool_length
sport string Sport string in OpenSportTaxonomy format (e.g., 'cycling.road+stationary')
title
version string

Workout-Output

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

WorkoutWarning

Name Type Description
adjustments Array<>
integration string
issues Array<>

ZoneValue

Name Type Description
of integer
quantity IntensityQuantity
type string
zone integer

Security schemes

Name Type Scheme Description
HTTPBearer http bearer
HTTPBasic http basic