Build the plan. Leave the workout to SwollStep.
Create structured workouts and training Programs from your tools, scripts, or AI agent. SwollStep takes care of the step-by-step session on iPhone.
Anyone can read these docs. API requests require an account-scoped token created in the app.
- Read the owner’s catalog
- Create workouts or a Program
- Verify the saved definitions
- Open SwollStep and sync
Creation returns 201 after the records are saved. No import or approval step is needed in the app.
Your first workout
- In SwollStep, open Settings → Agent API and create a token. Copy it once and keep it in your tool’s secret store.
- Set
SWOLLSTEP_TOKENin your environment. Read your catalog before choosing exercise definitions. - Save the example as workout.json. Its weights are illustrative; choose targets that fit the owner and reuse catalog IDs when available.
- Set
SWOLLSTEP_REQUEST_KEYto a new unique key. Save that key and exact file for retries, then POST the request. - Read the returned workout IDs to verify creation. Open and sync the app to see them in the library.
Use a new key for a new creation. Retry an uncertain request with its original key and unchanged body.
curl --request GET \
'https://fvgemdcvjuknvzdqkurt.supabase.co/functions/v1/agent-api/v1/catalog' \
--header "Authorization: Bearer $SWOLLSTEP_TOKEN"{
"exercises": [
{
"key": "bench",
"name": "Bench press",
"fields": [
"load",
"reps",
"rest"
]
},
{
"key": "walk",
"name": "Brisk walk",
"fields": [
"duration"
]
}
],
"workouts": [
{
"key": "strength",
"title": "Strength day",
"color": "blue",
"blocks": [
{
"title": "Warm-up",
"items": [
{
"exercise": "walk",
"targets": {
"duration_seconds": 300
}
}
]
},
{
"title": "Bench press",
"items": [
{
"title": "Ramp-up",
"exercises": [
{
"exercise": "bench",
"targets": {
"load_type": "externalWeight",
"weight_lb": 45,
"reps": 10,
"rest_seconds": 60
}
},
{
"exercise": "bench",
"targets": {
"load_type": "externalWeight",
"weight_lb": 95,
"reps": 5,
"rest_seconds": 60
}
}
]
},
{
"title": "Working sets",
"fields": {
"rounds": 3
},
"exercises": [
{
"exercise": "bench",
"targets": {
"load_type": "externalWeight",
"weight_lb": 140,
"reps": 8,
"rest_seconds": 90
}
}
]
}
]
}
]
}
]
}curl --request POST \
'https://fvgemdcvjuknvzdqkurt.supabase.co/functions/v1/agent-api/v1/workouts' \
--header "Authorization: Bearer $SWOLLSTEP_TOKEN" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: $SWOLLSTEP_REQUEST_KEY" \
--data-binary @workout.jsonTokens & permissions
Send Authorization: Bearer swollstep_… on every API request. Tokens belong to one account, expire after 90 days by default, and can be revoked in the app. Their secret is shown only once.
What a token can do
Read owned definitions and creation receipts. Create new workouts and Programs.
Keep the owner in control
Tokens cannot update or delete existing records, access performed results, or start or finish a workout. Give a token only to tools you trust. Revoke it if exposed.
Authorization: Bearer $SWOLLSTEP_TOKEN
Content-Type: application/json
Idempotency-Key: $SWOLLSTEP_REQUEST_KEYConnect your agent
Give your agent the guide URL and your training request. Supply the token through its secret mechanism. These public files contain no account data.
Agents should ask for essential targets they do not know. The catalog does not expose workout history.
Use https://swollstep.app/docs/agent-guide.md and https://swollstep.app/docs/openapi.json to create my requested workouts or Program. Read my catalog first and reuse suitable owned IDs. Ask me for missing essential targets. Keep drafts unscheduled unless I request dates. Keep my API token secret and use it only with https://fvgemdcvjuknvzdqkurt.supabase.co/functions/v1/agent-api. Save the exact payload and a unique idempotency key before creation. Verify the returned IDs and report what was created. Do not claim access to my workout history.Model a workout
Workout → Block → Group → Step. A step references an exercise definition and carries its own targets. A block can contain direct steps or explicit groups.
- Put warm-up first, then mobility, ramp-up immediately before working sets, core, and cool-down.
- Use group
fields.roundsfor repeated identical sets. Give different ramp-up loads separate steps. - Names are optional and default on save. Labels describe intent; they do not control execution.
- Put required work in structured targets. Instructions are optional technique context.
- Loads are pounds. Specify rep scope and weight basis where needed. Bodyweight work logs reps without pounds.
- Use
record_only_fieldsfor measurements to log without a prescribed target.
Every attached target field needs its target unless explicitly recording-only. Load needs load_type; external weight needs weight_lb.
{
"title": "Bench press",
"items": [
{
"title": "Ramp-up",
"exercises": [
{
"exercise": "bench",
"targets": {
"load_type": "externalWeight",
"weight_lb": 45,
"reps": 10,
"rest_seconds": 60
}
},
{
"exercise": "bench",
"targets": {
"load_type": "externalWeight",
"weight_lb": 95,
"reps": 5,
"rest_seconds": 60
}
}
]
},
{
"title": "Working sets",
"fields": {
"rounds": 3
},
"exercises": [
{
"exercise": "bench",
"targets": {
"load_type": "externalWeight",
"weight_lb": 140,
"reps": 8,
"rest_seconds": 90
}
}
]
}
]
}Programs & progression
Create a draft by omitting both start_date and end_date. Supply both dates only when the owner requests scheduling. Dates are inclusive floating calendar dates; the maximum range is 366 days.
Weekly schedules
Rules use Sunday = 1 through Saturday = 7. Target changes belong to the rule and use either relative week or scheduled effective_date. Partial patches accumulate and preserve omitted targets.
Relative plans
Use week_count (1–52) and seven relative_days numbered 1–7, without weekday rules or dates. The app anchors Day 1 only when the owner schedules the plan. Optional workouts can offer rest; a rest-only day omits its workout and sets rest_alternative: true.
Each scheduled occurrence has a frozen prescription. Automatic performance-based progression and RRULE parsing are not implemented.
Complete examples
Example dates and targets are illustrative. Adapt them to the owner’s request before submitting.
Retries, errors & limits
POST requires a durable Idempotency-Key (1–128 characters: letters, numbers, dot, underscore, colon, or hyphen). Retry with the same token, key, and exact body to retain the same IDs. Different content under an accepted key returns 409.
Duplicate names, including archived definitions, are checked transactionally. Reuse owned UUIDs instead of recreating existing definitions.
401 Invalid, expired, or revoked token.
404 Owned definition or receipt not found.
409 Duplicate name/ID or idempotency conflict. Inspect before retrying.
415 Send application/json.
422 Invalid prescription. Fix the fields described in the error.
429 Rate limit. Wait before retrying; preserve the key and body.
503 Backend unavailable. Retry with backoff and the original key/body.
Request limits
1 MiB request body
5 MiB expanded prescriptions
30 new operations/minute/token
200 new exercises
50 new workouts
1,000 prescribed steps
2,000 scheduled entries
Read your catalog
/v1/catalogRead owned exercise, workout, recipe, and Program definitions. Results and workout history are excluded.
Parameters
include_archived Include owned archived definitions for inspection/reuse.
Responses
200 Latest uploaded catalogue; excludes history
401 Invalid token
503 Unavailable
curl --request GET \
'https://fvgemdcvjuknvzdqkurt.supabase.co/functions/v1/agent-api/v1/catalog' \
--header "Authorization: Bearer $SWOLLSTEP_TOKEN"Create a Program
/v1/programsCreate a Program with new or existing workouts. Omit both dates for a draft.
Parameters
Idempotency-Key Request body
CreateProgram schema → · application/json
Responses
201 Created atomically in normalized tables; immediately readable
400 Missing/invalid idempotency key
401 Invalid token
404 Not found
409 Idempotency conflict
415 Unsupported content type
422 Invalid prescription
429 Limit reached
503 Unavailable
curl --request POST \
'https://fvgemdcvjuknvzdqkurt.supabase.co/functions/v1/agent-api/v1/programs' \
--header "Authorization: Bearer $SWOLLSTEP_TOKEN" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: $SWOLLSTEP_REQUEST_KEY" \
--data-binary @program.jsonRetrieve a Program
/v1/programs/{id}Retrieve an owned definition or creation receipt by UUID.
Parameters
id Native Program UUID
Responses
200 Import receipt
401 Invalid token
404 Not found
503 Unavailable
curl --request GET \
'https://fvgemdcvjuknvzdqkurt.supabase.co/functions/v1/agent-api/v1/programs/{id}' \
--header "Authorization: Bearer $SWOLLSTEP_TOKEN"getOpenAPISpec
/openapi.jsonPublic OpenAPI specification; no token required
Responses
200 OpenAPI 3.1 document
curl --request GET \
'https://fvgemdcvjuknvzdqkurt.supabase.co/functions/v1/agent-api/openapi.json' \
--header "Authorization: Bearer $SWOLLSTEP_TOKEN"Create workouts
/v1/workoutsCreate library workouts without dates or schedule entries.
Parameters
Idempotency-Key Request body
CreateWorkouts schema → · application/json
Responses
201 Created atomically in normalized tables; immediately readable
400 Missing/invalid idempotency key
401 Invalid token
404 Not found
409 Idempotency conflict
415 Unsupported content type
422 Invalid prescription
429 Limit reached
503 Unavailable
curl --request POST \
'https://fvgemdcvjuknvzdqkurt.supabase.co/functions/v1/agent-api/v1/workouts' \
--header "Authorization: Bearer $SWOLLSTEP_TOKEN" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: $SWOLLSTEP_REQUEST_KEY" \
--data-binary @workout.jsongetCreationOperation
/v1/operations/{id}Retrieve an owned definition or creation receipt by UUID.
Parameters
id Import receipt ID returned by POST, not the native Program ID.
Responses
200 Import receipt plus canonical workouts and exercise definitions
401 Invalid token
404 Not found
503 Unavailable
curl --request GET \
'https://fvgemdcvjuknvzdqkurt.supabase.co/functions/v1/agent-api/v1/operations/{id}' \
--header "Authorization: Bearer $SWOLLSTEP_TOKEN"Retrieve a workout
/v1/workouts/{id}Retrieve an owned definition or creation receipt by UUID.
Parameters
id Native workout UUID
Responses
200 Import receipt
401 Invalid token
404 Not found
503 Unavailable
curl --request GET \
'https://fvgemdcvjuknvzdqkurt.supabase.co/functions/v1/agent-api/v1/workouts/{id}' \
--header "Authorization: Bearer $SWOLLSTEP_TOKEN"CreateProgram
exercises array<object> Child fields
key string requiredname string requiredfields array<string> requireddistance_unit string pace_unit string workouts array<object> Child fields
key string requiredtitle string color string blocks array<object> requireddescription string labels array<string> estimated_duration_seconds integer duration_progression_seconds array<integer> Ordered reference duration targets, typically one per week. Does not create dates, Programs or schedule entries.
program object | object requiredChild fields
title string start_date string Optional. Provide both start_date and end_date only when scheduling.
end_date string Optional. Omit both dates for an unscheduled Program.
rules array<object> Child fields
weekday integer requiredSunday=1 through Saturday=7
workout string requiredNew workout key or available catalogue UUID
changes array<object | object> Child fields
effective_date string Unique effective date within the Program range. Changes accumulate in chronological order.
targets array<object> requiredChild fields
step string requiredStep key declared on this workout or existing catalogue step UUID.
targets TargetPatch requiredweek integer Program-relative week. Works without calendar dates.
description string week_count integer relative_days array<object> Child fields
Unscheduled relative plan: each Day 1–7 exactly once. Expands into week_count weeks with independent prescriptions. Mutually exclusive with rules and dates.
day integer requiredworkout string optional boolean rest_alternative boolean notes string changes array<object | object> Child fields
effective_date string Unique effective date within the Program range. Changes accumulate in chronological order.
targets array<object> requiredChild fields
step string requiredStep key declared on this workout or existing catalogue step UUID.
targets TargetPatch requiredweek integer Program-relative week. Works without calendar dates.
{
"type": "object",
"additionalProperties": false,
"properties": {
"exercises": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9_-]*import docs from './docs-assets.js';quot;,
"maxLength": 80
},
"name": {
"type": "string",
"maxLength": 200,
"minLength": 1
},
"fields": {
"type": "array",
"items": {
"type": "string",
"enum": [
"load",
"reps",
"duration",
"distance",
"pace",
"effort",
"stroke",
"rest",
"repsInReserve",
"equipment"
]
},
"minItems": 1,
"maxItems": 10,
"uniqueItems": true
},
"distance_unit": {
"type": "string",
"enum": [
"meters",
"kilometers",
"miles",
"yards"
]
},
"pace_unit": {
"type": "string",
"enum": [
"perKilometer",
"perMile",
"per100Meters",
"per100Yards"
]
}
},
"required": [
"key",
"name",
"fields"
]
},
"minItems": 0,
"maxItems": 200
},
"workouts": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9_-]*import docs from './docs-assets.js';quot;,
"maxLength": 80
},
"title": {
"type": "string",
"maxLength": 200
},
"color": {
"type": "string",
"enum": [
"indigo",
"blue",
"green",
"orange",
"pink",
"purple"
]
},
"blocks": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"maxLength": 200
},
"labels": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"minItems": 0,
"maxItems": 20
},
"items": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/Step"
},
{
"$ref": "#/components/schemas/Group"
}
]
},
"minItems": 1,
"maxItems": 100
}
},
"required": [
"items"
]
},
"minItems": 1,
"maxItems": 50
},
"description": {
"type": "string",
"maxLength": 4000
},
"labels": {
"type": "array",
"items": {
"type": "string",
"maxLength": 80
},
"maxItems": 20
},
"estimated_duration_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 86400
},
"duration_progression_seconds": {
"type": "array",
"minItems": 1,
"maxItems": 52,
"items": {
"type": "integer",
"minimum": 1,
"maximum": 86400
},
"description": "Ordered reference duration targets, typically one per week. Does not create dates, Programs or schedule entries."
}
},
"required": [
"key",
"blocks"
]
},
"minItems": 0,
"maxItems": 50
},
"program": {
"type": "object",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"maxLength": 200
},
"start_date": {
"type": "string",
"format": "date",
"description": "Optional. Provide both start_date and end_date only when scheduling."
},
"end_date": {
"type": "string",
"format": "date",
"description": "Optional. Omit both dates for an unscheduled Program."
},
"rules": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"weekday": {
"type": "integer",
"minimum": 1,
"maximum": 7,
"description": "Sunday=1 through Saturday=7"
},
"workout": {
"type": "string",
"maxLength": 80,
"description": "New workout key or available catalogue UUID"
},
"changes": {
"type": "array",
"maxItems": 100,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"targets"
],
"properties": {
"effective_date": {
"type": "string",
"format": "date",
"description": "Unique effective date within the Program range. Changes accumulate in chronological order."
},
"targets": {
"type": "array",
"minItems": 1,
"maxItems": 1000,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"step",
"targets"
],
"properties": {
"step": {
"type": "string",
"maxLength": 80,
"description": "Step key declared on this workout or existing catalogue step UUID."
},
"targets": {
"$ref": "#/components/schemas/TargetPatch"
}
}
}
},
"week": {
"type": "integer",
"minimum": 1,
"maximum": 52,
"description": "Program-relative week. Works without calendar dates."
}
},
"oneOf": [
{
"required": [
"week"
],
"not": {
"required": [
"effective_date"
]
}
},
{
"required": [
"effective_date"
],
"not": {
"required": [
"week"
]
}
}
]
}
}
},
"required": [
"weekday",
"workout"
]
},
"minItems": 1,
"maxItems": 40
},
"description": {
"type": "string",
"maxLength": 4000
},
"week_count": {
"type": "integer",
"minimum": 1,
"maximum": 52
},
"relative_days": {
"type": "array",
"minItems": 7,
"maxItems": 7,
"description": "Unscheduled relative plan: each Day 1–7 exactly once. Expands into week_count weeks with independent prescriptions. Mutually exclusive with rules and dates.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"day"
],
"properties": {
"day": {
"type": "integer",
"minimum": 1,
"maximum": 7
},
"workout": {
"type": "string",
"maxLength": 80
},
"optional": {
"type": "boolean"
},
"rest_alternative": {
"type": "boolean"
},
"notes": {
"type": "string",
"maxLength": 4000
},
"changes": {
"type": "array",
"maxItems": 100,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"targets"
],
"properties": {
"effective_date": {
"type": "string",
"format": "date",
"description": "Unique effective date within the Program range. Changes accumulate in chronological order."
},
"targets": {
"type": "array",
"minItems": 1,
"maxItems": 1000,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"step",
"targets"
],
"properties": {
"step": {
"type": "string",
"maxLength": 80,
"description": "Step key declared on this workout or existing catalogue step UUID."
},
"targets": {
"$ref": "#/components/schemas/TargetPatch"
}
}
}
},
"week": {
"type": "integer",
"minimum": 1,
"maximum": 52,
"description": "Program-relative week. Works without calendar dates."
}
},
"oneOf": [
{
"required": [
"week"
],
"not": {
"required": [
"effective_date"
]
}
},
{
"required": [
"effective_date"
],
"not": {
"required": [
"week"
]
}
}
]
}
}
}
}
}
},
"required": [],
"oneOf": [
{
"required": [
"rules"
],
"not": {
"required": [
"relative_days"
]
}
},
{
"required": [
"relative_days",
"week_count"
],
"not": {
"anyOf": [
{
"required": [
"rules"
]
},
{
"required": [
"start_date"
]
},
{
"required": [
"end_date"
]
}
]
}
}
]
}
},
"required": [
"program"
]
}Targets
load_type string weight_lb number reps integer rep_scope string weight_basis string duration_seconds integer distance number pace_seconds integer effort string stroke string rest_seconds integer reps_in_reserve integer equipment string {
"type": "object",
"additionalProperties": false,
"properties": {
"load_type": {
"type": "string",
"enum": [
"bodyweight",
"externalWeight",
"none"
]
},
"weight_lb": {
"type": "number",
"minimum": 0,
"maximum": 10000
},
"reps": {
"type": "integer",
"minimum": 1,
"maximum": 100000
},
"rep_scope": {
"type": "string",
"enum": [
"total",
"perSide",
"perDirection"
]
},
"weight_basis": {
"type": "string",
"enum": [
"total",
"perDumbbell"
]
},
"duration_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 86400
},
"distance": {
"type": "number",
"minimum": 0.000001,
"maximum": 1000000
},
"pace_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 86400
},
"effort": {
"type": "string",
"enum": [
"easy",
"moderate",
"hard",
"maximal"
]
},
"stroke": {
"type": "string",
"enum": [
"freestyle",
"backstroke",
"breaststroke",
"butterfly",
"mixed"
]
},
"rest_seconds": {
"type": "integer",
"minimum": 0,
"maximum": 86400
},
"reps_in_reserve": {
"type": "integer",
"minimum": 0,
"maximum": 100
},
"equipment": {
"type": "string",
"maxLength": 200
}
}
}Step
exercise string requiredNew exercise key or available catalogue UUID.
title string labels array<string> instructions string targets Targets requiredkey string Optional unique step key within a workout, used by dated target changes.
record_only_fields array<string> Attached measurements to record without requiring a prescribed target. Actual results remain empty until performed.
{
"type": "object",
"additionalProperties": false,
"properties": {
"exercise": {
"type": "string",
"maxLength": 80,
"description": "New exercise key or available catalogue UUID."
},
"title": {
"type": "string",
"maxLength": 200
},
"labels": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"minItems": 0,
"maxItems": 20
},
"instructions": {
"type": "string",
"maxLength": 2000
},
"targets": {
"$ref": "#/components/schemas/Targets"
},
"key": {
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9_-]*import docs from './docs-assets.js';quot;,
"maxLength": 80,
"description": "Optional unique step key within a workout, used by dated target changes."
},
"record_only_fields": {
"type": "array",
"maxItems": 6,
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
"reps",
"duration",
"distance",
"pace",
"effort",
"stroke"
]
},
"description": "Attached measurements to record without requiring a prescribed target. Actual results remain empty until performed."
}
},
"required": [
"exercise",
"targets"
]
}Group
title string labels array<string> fields object Child fields
rounds integer duration_seconds integer interval_seconds integer rest_between_rounds_seconds integer repetition string tracks_rounds boolean exercises array<Step> required{
"type": "object",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"maxLength": 200
},
"labels": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"minItems": 0,
"maxItems": 20
},
"fields": {
"type": "object",
"additionalProperties": false,
"properties": {
"rounds": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"duration_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 86400
},
"interval_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 86400
},
"rest_between_rounds_seconds": {
"type": "integer",
"minimum": 0,
"maximum": 86400
},
"repetition": {
"type": "string",
"enum": [
"once",
"untilDuration"
]
},
"tracks_rounds": {
"type": "boolean"
}
}
},
"exercises": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Step"
},
"minItems": 1,
"maxItems": 100
}
},
"required": [
"exercises"
]
}Receipt
id string requiredCreation operation ID; use /v1/operations/{id} for its receipt.
status string requiredcreated_at string requiredprograms array<object> requiredChild fields
id string requiredtitle string requiredworkout_ids array<string> required{
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"format": "uuid",
"description": "Creation operation ID; use /v1/operations/{id} for its receipt."
},
"status": {
"type": "string",
"enum": [
"created"
]
},
"created_at": {
"type": "string",
"format": "date-time"
},
"programs": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"title": {
"type": "string"
}
},
"required": [
"id",
"title"
]
},
"minItems": 0,
"maxItems": 100
},
"workout_ids": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"minItems": 0,
"maxItems": 100
}
},
"required": [
"id",
"status",
"created_at",
"programs",
"workout_ids"
]
}Error
error string required{
"type": "object",
"additionalProperties": false,
"properties": {
"error": {
"type": "string"
}
},
"required": [
"error"
]
}TargetPatch
Partial target changes; omitted targets retain their previous value. Only attached fields may change. load_type=bodyweight/none clears an omitted external weight.
load_type string weight_lb number reps integer rep_scope string weight_basis string duration_seconds integer distance number pace_seconds integer effort string stroke string rest_seconds integer reps_in_reserve integer equipment string {
"type": "object",
"additionalProperties": false,
"properties": {
"load_type": {
"type": "string",
"enum": [
"bodyweight",
"externalWeight",
"none"
]
},
"weight_lb": {
"type": "number",
"minimum": 0,
"maximum": 10000
},
"reps": {
"type": "integer",
"minimum": 1,
"maximum": 100000
},
"rep_scope": {
"type": "string",
"enum": [
"total",
"perSide",
"perDirection"
]
},
"weight_basis": {
"type": "string",
"enum": [
"total",
"perDumbbell"
]
},
"duration_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 86400
},
"distance": {
"type": "number",
"minimum": 0.000001,
"maximum": 1000000
},
"pace_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 86400
},
"effort": {
"type": "string",
"enum": [
"easy",
"moderate",
"hard",
"maximal"
]
},
"stroke": {
"type": "string",
"enum": [
"freestyle",
"backstroke",
"breaststroke",
"butterfly",
"mixed"
]
},
"rest_seconds": {
"type": "integer",
"minimum": 0,
"maximum": 86400
},
"reps_in_reserve": {
"type": "integer",
"minimum": 0,
"maximum": 100
},
"equipment": {
"type": "string",
"maxLength": 200
}
},
"minProperties": 1,
"description": "Partial target changes; omitted targets retain their previous value. Only attached fields may change. load_type=bodyweight/none clears an omitted external weight."
}CreateWorkouts
exercises array<object> Child fields
key string requiredname string requiredfields array<string> requireddistance_unit string pace_unit string workouts array<object> requiredChild fields
key string requiredtitle string color string blocks array<object> requireddescription string labels array<string> estimated_duration_seconds integer duration_progression_seconds array<integer> Ordered reference duration targets, typically one per week. Does not create dates, Programs or schedule entries.
{
"type": "object",
"additionalProperties": false,
"required": [
"workouts"
],
"properties": {
"exercises": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9_-]*import docs from './docs-assets.js';quot;,
"maxLength": 80
},
"name": {
"type": "string",
"maxLength": 200,
"minLength": 1
},
"fields": {
"type": "array",
"items": {
"type": "string",
"enum": [
"load",
"reps",
"duration",
"distance",
"pace",
"effort",
"stroke",
"rest",
"repsInReserve",
"equipment"
]
},
"minItems": 1,
"maxItems": 10,
"uniqueItems": true
},
"distance_unit": {
"type": "string",
"enum": [
"meters",
"kilometers",
"miles",
"yards"
]
},
"pace_unit": {
"type": "string",
"enum": [
"perKilometer",
"perMile",
"per100Meters",
"per100Yards"
]
}
},
"required": [
"key",
"name",
"fields"
]
},
"minItems": 0,
"maxItems": 200
},
"workouts": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9_-]*import docs from './docs-assets.js';quot;,
"maxLength": 80
},
"title": {
"type": "string",
"maxLength": 200
},
"color": {
"type": "string",
"enum": [
"indigo",
"blue",
"green",
"orange",
"pink",
"purple"
]
},
"blocks": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"maxLength": 200
},
"labels": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"minItems": 0,
"maxItems": 20
},
"items": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/Step"
},
{
"$ref": "#/components/schemas/Group"
}
]
},
"minItems": 1,
"maxItems": 100
}
},
"required": [
"items"
]
},
"minItems": 1,
"maxItems": 50
},
"description": {
"type": "string",
"maxLength": 4000
},
"labels": {
"type": "array",
"items": {
"type": "string",
"maxLength": 80
},
"maxItems": 20
},
"estimated_duration_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 86400
},
"duration_progression_seconds": {
"type": "array",
"minItems": 1,
"maxItems": 52,
"items": {
"type": "integer",
"minimum": 1,
"maximum": 86400
},
"description": "Ordered reference duration targets, typically one per week. Does not create dates, Programs or schedule entries.",
"deprecated": true
}
},
"required": [
"key",
"blocks"
]
},
"minItems": 1,
"maxItems": 50
}
}
}