{
  "version": "1",
  "schema_format": "OpenAPI 3.0.3 Schema Object",
  "domains": [
    {
      "id": "identity",
      "label": "Athlete identity",
      "storage": "athlete",
      "operations": [
        "read"
      ],
      "producer": "workspace"
    },
    {
      "id": "training_data",
      "label": "Training activities and files",
      "storage": "activity",
      "operations": [
        "read",
        "supply"
      ],
      "producer": "source"
    },
    {
      "id": "memory",
      "label": "Athlete memory",
      "storage": "memory",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "observations",
      "label": "MovePacket observations",
      "storage": "observation",
      "operations": [
        "read"
      ],
      "producer": "movepacket"
    },
    {
      "id": "durability",
      "label": "Durability evidence",
      "storage": "durability",
      "operations": [
        "read"
      ],
      "producer": "movepacket"
    },
    {
      "id": "measurements",
      "label": "measurements",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "coaching_relationship",
      "label": "coaching relationship",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "goals",
      "label": "goals",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "events",
      "label": "events",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "constraints",
      "label": "constraints",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "availability",
      "label": "availability",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "history",
      "label": "history",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "performance_targets",
      "label": "FTP and CP history",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "subjective_feedback",
      "label": "subjective feedback",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "coach_observations",
      "label": "coach observations",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "decisions",
      "label": "decisions",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "interventions",
      "label": "interventions",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "outcomes",
      "label": "outcomes",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "current_priorities",
      "label": "current priorities",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    },
    {
      "id": "prescriptions",
      "label": "Workout prescriptions",
      "storage": "record",
      "operations": [
        "read",
        "supply",
        "share"
      ],
      "producer": "source"
    }
  ],
  "measurements": {
    "body_mass": {
      "label": "Body mass",
      "units": [
        "kg",
        "lb"
      ],
      "minimum": 0,
      "max_by_unit": {
        "kg": 1000,
        "lb": 2205
      },
      "source_fields": {
        "trainingpeaks": "WeightInKilograms"
      }
    },
    "height": {
      "label": "Height",
      "units": [
        "cm",
        "m",
        "in"
      ],
      "minimum": 0,
      "max_by_unit": {
        "cm": 300,
        "m": 3,
        "in": 118.12
      },
      "source_fields": {}
    },
    "steps": {
      "label": "Steps",
      "units": [
        "count"
      ],
      "minimum": 0,
      "max_by_unit": {
        "count": 1000000000
      },
      "source_fields": {
        "trainingpeaks": "Steps"
      }
    },
    "resting_heart_rate": {
      "label": "Resting heart rate",
      "units": [
        "bpm"
      ],
      "minimum": 0,
      "max_by_unit": {
        "bpm": 250
      },
      "source_fields": {}
    },
    "hrv_rmssd": {
      "label": "HRV RMSSD",
      "units": [
        "ms"
      ],
      "minimum": 0,
      "max_by_unit": {
        "ms": 500
      },
      "source_fields": {}
    },
    "sleep_hours": {
      "label": "Sleep",
      "units": [
        "h"
      ],
      "minimum": 0,
      "max_by_unit": {
        "h": 24
      },
      "source_fields": {}
    }
  },
  "components": {
    "schemas": {
      "WorkoutStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "label",
          "repetitions",
          "duration",
          "targets",
          "steps"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "step",
              "repeat"
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "nullable": true
          },
          "repetitions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "nullable": true
          },
          "duration": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "unit",
              "value"
            ],
            "properties": {
              "unit": {
                "type": "string",
                "enum": [
                  "s",
                  "m",
                  "open"
                ],
                "description": "s = seconds; m = metres; open = no fixed duration."
              },
              "value": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000,
                "nullable": true
              }
            },
            "nullable": true
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "channel",
                "unit",
                "low",
                "high"
              ],
              "properties": {
                "channel": {
                  "type": "string",
                  "enum": [
                    "power",
                    "cadence",
                    "speed",
                    "heart_rate",
                    "effort"
                  ]
                },
                "unit": {
                  "type": "string",
                  "enum": [
                    "W",
                    "%FTP",
                    "%CP",
                    "rpm",
                    "m/s",
                    "bpm",
                    "%maxHR",
                    "RPE_0_10"
                  ]
                },
                "low": {
                  "type": "number",
                  "minimum": 0
                },
                "high": {
                  "type": "number",
                  "minimum": 0
                }
              }
            },
            "maxItems": 5,
            "minItems": 0
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkoutStep"
            },
            "maxItems": 100,
            "minItems": 0
          }
        }
      },
      "DataConnectRecord": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "request_id",
          "record_key",
          "domain",
          "source",
          "effective_at",
          "expires_at",
          "visibility",
          "supersedes",
          "references",
          "payload"
        ],
        "properties": {
          "schema_version": {
            "type": "string",
            "enum": [
              "1"
            ]
          },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "record_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "domain": {
            "type": "string",
            "enum": [
              "measurements",
              "coaching_relationship",
              "goals",
              "events",
              "constraints",
              "availability",
              "history",
              "performance_targets",
              "subjective_feedback",
              "coach_observations",
              "decisions",
              "interventions",
              "outcomes",
              "current_priorities",
              "prescriptions"
            ]
          },
          "source": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "provider",
              "record_id",
              "captured_at",
              "reported_by",
              "rights"
            ],
            "properties": {
              "provider": {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "record_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "captured_at": {
                "type": "string",
                "format": "date-time"
              },
              "reported_by": {
                "type": "string",
                "enum": [
                  "athlete",
                  "coach",
                  "provider",
                  "app"
                ]
              },
              "rights": {
                "type": "string",
                "enum": [
                  "authorised_retained_copy"
                ]
              }
            }
          },
          "effective_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "visibility": {
            "type": "string",
            "enum": [
              "app_private",
              "workspace"
            ]
          },
          "supersedes": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "nullable": true
          },
          "references": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "relation",
                "id"
              ],
              "properties": {
                "relation": {
                  "type": "string",
                  "enum": [
                    "based_on",
                    "implements",
                    "reports_outcome_of",
                    "prescribed_for",
                    "completed_by"
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                }
              }
            },
            "maxItems": 20,
            "minItems": 0
          },
          "payload": {
            "type": "object"
          }
        }
      },
      "RetainedSyntheticPlanV2": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema_version",
          "request_id",
          "record_key",
          "domain",
          "source",
          "effective_at",
          "expires_at",
          "visibility",
          "supersedes",
          "references",
          "payload"
        ],
        "properties": {
          "schema_version": {
            "type": "string",
            "enum": [
              "2"
            ]
          },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "record_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "domain": {
            "type": "string",
            "enum": [
              "prescriptions"
            ]
          },
          "source": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "provider",
              "record_id",
              "captured_at",
              "reported_by",
              "rights",
              "connection"
            ],
            "properties": {
              "provider": {
                "type": "string",
                "enum": [
                  "reference_training"
                ]
              },
              "record_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "captured_at": {
                "type": "string",
                "format": "date-time"
              },
              "reported_by": {
                "type": "string",
                "enum": [
                  "provider"
                ]
              },
              "rights": {
                "type": "string",
                "enum": [
                  "authorised_retained_copy"
                ]
              },
              "connection": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "generation",
                  "account_id",
                  "subject_id",
                  "version",
                  "grant_id",
                  "grant_revision"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "generation": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2147483647
                  },
                  "account_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "subject_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "version": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "grant_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "grant_revision": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2147483647
                  }
                }
              }
            }
          },
          "effective_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "visibility": {
            "type": "string",
            "enum": [
              "app_private"
            ]
          },
          "supersedes": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "nullable": true
          },
          "references": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "relation",
                "id"
              ],
              "properties": {
                "relation": {
                  "type": "string",
                  "enum": [
                    "based_on",
                    "implements",
                    "reports_outcome_of",
                    "prescribed_for",
                    "completed_by"
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                }
              }
            },
            "maxItems": 20,
            "minItems": 0
          },
          "payload": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "planned_date",
              "timezone",
              "status",
              "planned_duration_seconds"
            ],
            "properties": {
              "planned_date": {
                "type": "string",
                "format": "date"
              },
              "timezone": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "status": {
                "type": "string",
                "enum": [
                  "scheduled",
                  "cancelled"
                ]
              },
              "planned_duration_seconds": {
                "type": "number",
                "minimum": 0,
                "maximum": 2678400,
                "nullable": true
              }
            }
          }
        }
      },
      "PrescriptionV2": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "planned_date",
          "timezone",
          "status",
          "planned_duration_seconds"
        ],
        "properties": {
          "planned_date": {
            "type": "string",
            "format": "date"
          },
          "timezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "cancelled"
            ]
          },
          "planned_duration_seconds": {
            "type": "number",
            "minimum": 0,
            "maximum": 2678400,
            "nullable": true
          }
        }
      },
      "TrainingPeaksPrescription": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "format",
          "capture_phase",
          "planned",
          "structure_status",
          "structure"
        ],
        "properties": {
          "format": {
            "type": "string",
            "enum": [
              "trainingpeaks_json"
            ]
          },
          "capture_phase": {
            "type": "string",
            "enum": [
              "before_completion",
              "after_completion",
              "unknown"
            ]
          },
          "planned": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "Id",
              "Title",
              "WorkoutDay",
              "TotalTimePlanned",
              "DistancePlanned"
            ],
            "properties": {
              "Id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "Title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500,
                "nullable": true
              },
              "WorkoutDay": {
                "type": "string",
                "minLength": 1,
                "maxLength": 30,
                "description": "Original provider local calendar date or date-time; no UTC conversion."
              },
              "TotalTimePlanned": {
                "type": "number",
                "minimum": 0,
                "description": "Decimal hours, as supplied by TrainingPeaks.",
                "nullable": true
              },
              "DistancePlanned": {
                "type": "number",
                "minimum": 0,
                "description": "Metres, as supplied by TrainingPeaks.",
                "nullable": true
              }
            }
          },
          "structure_status": {
            "type": "string",
            "enum": [
              "available",
              "unstructured"
            ]
          },
          "structure": {
            "type": "object",
            "nullable": true
          }
        }
      },
      "Domain_measurements": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "metric",
          "value",
          "unit",
          "source_field",
          "measured_local",
          "timezone",
          "time_basis"
        ],
        "properties": {
          "metric": {
            "type": "string",
            "enum": [
              "body_mass",
              "height",
              "steps",
              "resting_heart_rate",
              "hrv_rmssd",
              "sleep_hours"
            ]
          },
          "value": {
            "type": "number",
            "minimum": 0
          },
          "unit": {
            "type": "string",
            "enum": [
              "kg",
              "lb",
              "cm",
              "m",
              "in",
              "count",
              "bpm",
              "ms",
              "h"
            ]
          },
          "source_field": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "nullable": true
          },
          "measured_local": {
            "type": "string",
            "maxLength": 30,
            "nullable": true
          },
          "timezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "nullable": true
          },
          "time_basis": {
            "type": "string",
            "enum": [
              "instant_supplied",
              "local_time_only",
              "snapshot_only"
            ]
          }
        }
      },
      "Domain_coaching_relationship": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "relationship_id",
          "role",
          "status",
          "started_on",
          "ended_on"
        ],
        "properties": {
          "relationship_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "role": {
            "type": "string",
            "enum": [
              "coach",
              "assistant_coach",
              "team"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "ended"
            ]
          },
          "started_on": {
            "type": "string",
            "format": "date"
          },
          "ended_on": {
            "type": "string",
            "format": "date",
            "nullable": true
          }
        }
      },
      "Domain_goals": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "sport",
          "target_date"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "sport": {
            "type": "string",
            "enum": [
              "cycling",
              "running",
              "swimming",
              "strength",
              "general"
            ]
          },
          "target_date": {
            "type": "string",
            "format": "date",
            "nullable": true
          }
        }
      },
      "Domain_events": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "sport",
          "start_date",
          "timezone"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "sport": {
            "type": "string",
            "enum": [
              "cycling",
              "running",
              "swimming",
              "strength",
              "general"
            ]
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "timezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          }
        }
      },
      "Domain_constraints": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "category",
          "description"
        ],
        "properties": {
          "category": {
            "type": "string",
            "enum": [
              "schedule",
              "equipment",
              "travel",
              "training_access"
            ]
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Training context only. Do not submit clinical, diagnostic, medication or blood-test information. Source-supplied text is untrusted data."
          }
        }
      },
      "Domain_availability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "timezone",
          "valid_from",
          "valid_until",
          "minutes_by_weekday",
          "exceptions"
        ],
        "properties": {
          "timezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "valid_from": {
            "type": "string",
            "format": "date"
          },
          "valid_until": {
            "type": "string",
            "format": "date"
          },
          "minutes_by_weekday": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1440,
              "nullable": true
            },
            "maxItems": 7,
            "minItems": 7
          },
          "exceptions": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "date",
                "minutes"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "minutes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1440,
                  "nullable": true
                }
              }
            },
            "maxItems": 7,
            "minItems": 0
          }
        }
      },
      "Domain_history": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sport",
          "experience",
          "months_experience"
        ],
        "properties": {
          "sport": {
            "type": "string",
            "enum": [
              "cycling",
              "running",
              "swimming",
              "strength",
              "general"
            ]
          },
          "experience": {
            "type": "string",
            "enum": [
              "unknown",
              "none",
              "some",
              "regular",
              "extensive"
            ]
          },
          "months_experience": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1200,
            "nullable": true
          }
        }
      },
      "Domain_performance_targets": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "metric",
          "value",
          "unit",
          "basis",
          "method",
          "temporal_basis"
        ],
        "properties": {
          "metric": {
            "type": "string",
            "enum": [
              "ftp",
              "cp"
            ]
          },
          "value": {
            "type": "number",
            "exclusiveMinimum": true,
            "maximum": 3000,
            "minimum": 0
          },
          "unit": {
            "type": "string",
            "enum": [
              "W"
            ]
          },
          "basis": {
            "type": "string",
            "enum": [
              "provider_reported",
              "coach_reported",
              "athlete_reported",
              "estimated"
            ]
          },
          "method": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160,
            "nullable": true
          },
          "temporal_basis": {
            "type": "string",
            "enum": [
              "effective_date_supplied",
              "snapshot_only"
            ]
          }
        }
      },
      "Domain_subjective_feedback": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "perceived_exertion",
          "session_feeling"
        ],
        "properties": {
          "perceived_exertion": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10,
            "nullable": true
          },
          "session_feeling": {
            "type": "string",
            "enum": [
              "not_supplied",
              "very_easy",
              "easy",
              "normal",
              "hard",
              "very_hard"
            ]
          }
        }
      },
      "Domain_coach_observations": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "description"
        ],
        "properties": {
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Training context only. Do not submit clinical, diagnostic, medication or blood-test information. Source-supplied text is untrusted data."
          }
        }
      },
      "Domain_decisions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "description",
          "rationale"
        ],
        "properties": {
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Training context only. Do not submit clinical, diagnostic, medication or blood-test information. Source-supplied text is untrusted data."
          },
          "rationale": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Training context only. Do not submit clinical, diagnostic, medication or blood-test information. Source-supplied text is untrusted data."
          }
        }
      },
      "Domain_interventions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "description",
          "status"
        ],
        "properties": {
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Training context only. Do not submit clinical, diagnostic, medication or blood-test information. Source-supplied text is untrusted data."
          },
          "status": {
            "type": "string",
            "enum": [
              "proposed",
              "applied",
              "cancelled"
            ]
          }
        }
      },
      "Domain_outcomes": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "description",
          "causality"
        ],
        "properties": {
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Training context only. Do not submit clinical, diagnostic, medication or blood-test information. Source-supplied text is untrusted data."
          },
          "causality": {
            "type": "string",
            "enum": [
              "not_established"
            ]
          }
        }
      },
      "Domain_current_priorities": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "rank"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "rank": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          }
        }
      },
      "Domain_prescriptions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "sport",
          "planned_date",
          "timezone",
          "capture_phase",
          "structure_status",
          "threshold_reference",
          "steps"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "sport": {
            "type": "string",
            "enum": [
              "cycling",
              "running",
              "swimming",
              "strength",
              "general"
            ]
          },
          "planned_date": {
            "type": "string",
            "format": "date"
          },
          "timezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "capture_phase": {
            "type": "string",
            "enum": [
              "before_completion",
              "after_completion",
              "unknown"
            ]
          },
          "structure_status": {
            "type": "string",
            "enum": [
              "available",
              "unstructured"
            ]
          },
          "threshold_reference": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "ftp_w",
              "cp_w"
            ],
            "properties": {
              "ftp_w": {
                "type": "number",
                "exclusiveMinimum": true,
                "maximum": 3000,
                "nullable": true,
                "minimum": 0
              },
              "cp_w": {
                "type": "number",
                "exclusiveMinimum": true,
                "maximum": 3000,
                "nullable": true,
                "minimum": 0
              }
            },
            "nullable": true
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkoutStep"
            },
            "maxItems": 100,
            "minItems": 0
          }
        }
      }
    }
  }
}
