{
  "openapi": "3.0.3",
  "info": {
    "title": "MovePacket API",
    "version": "0.1.0",
    "description": "MovePacket workspace APIs and app-scoped builder publishing. Activity APIs require an authorised workspace key; Builder endpoints use a separate app-scoped connection. Check service availability before uploading. Workspace builders can connect through owner-approved device pairing and a scoped portable API tool. Native MCP is not implemented."
  },
  "servers": [
    {
      "url": "https://movepacket.com",
      "description": "Private beta origin; access and activation required"
    },
    {
      "url": "http://127.0.0.1:8787",
      "description": "Local development with a locally provisioned key"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Activities",
      "description": "Upload original FIT files and retrieve decoded activity data"
    },
    {
      "name": "Event Intelligence",
      "description": "Private route demands and climb analysis; usage tracking with billing off."
    },
    {
      "name": "Athlete library",
      "description": "Private combined activity library and project connections."
    },
    {
      "name": "Builder",
      "description": "Portable static projects, verified publishing and recovery. Requires an app-scoped connection."
    },
    {
      "name": "Workspace builders",
      "description": "Owner-approved workspace connection: selected Projects plus Projects it creates. Athlete creation and FIT/FIT.GZ imports require separate owner opt-in and selected athletes. No publication, deletion, billing, provider credentials or access to existing ride history."
    }
  ],
  "paths": {
    "/v1/activities": {
      "post": {
        "tags": [
          "Activities"
        ],
        "operationId": "uploadActivity",
        "summary": "Upload a FIT activity",
        "description": "Send raw FIT bytes, not multipart or JSON. Maximum 4 MiB. The same bytes in the same workspace reuse one activity. HTTP 202 means processing is pending; 200 means the returned activity is already ready or failed. Concurrent uploads converge on one ID; duplicate is advisory.",
        "requestBody": {
          "required": true,
          "content": {
            "application/vnd.ant.fit": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Existing terminal activity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadResponse"
                }
              }
            }
          },
          "202": {
            "description": "Activity accepted for asynchronous processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadResponse"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Relative status URL",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Input or result exceeds the endpoint limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Input validation or analysis failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Activities"
        ],
        "operationId": "listActivities",
        "summary": "List activities",
        "description": "Workspace-scoped, newest first (created_at then id, both descending). Offset pages can shift when new activities are added. stats always describes the entire workspace, independent of filters.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Case-sensitive activity ID substring; trimmed",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "processing combines received and queued",
            "schema": {
              "type": "string",
              "enum": [
                "received",
                "queued",
                "processing",
                "ready",
                "failed"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching activities and workspace counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/activities/{id}": {
      "get": {
        "tags": [
          "Activities"
        ],
        "operationId": "getActivity",
        "summary": "Read activity status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Activity ID returned by upload",
            "schema": {
              "type": "string",
              "pattern": "^act_[a-f0-9-]{36}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activity metadata; check status for processing state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Activity"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/activities/{id}/data": {
      "get": {
        "tags": [
          "Activities"
        ],
        "operationId": "getActivityData",
        "summary": "Retrieve decoded JSON",
        "description": "Available only for ready activities. FIT SDK field names and units are retained; source-dependent message fields are intentionally open.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Activity ID returned by upload",
            "schema": {
              "type": "string",
              "pattern": "^act_[a-f0-9-]{36}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Decoded FIT messages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecodedActivity"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/activities/{id}/original": {
      "get": {
        "tags": [
          "Activities"
        ],
        "operationId": "getOriginal",
        "summary": "Download untouched original",
        "description": "Available even when decoding failed. Compare its SHA-256 with the activity metadata and your source.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Activity ID returned by upload",
            "schema": {
              "type": "string",
              "pattern": "^act_[a-f0-9-]{36}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exact uploaded FIT bytes",
            "headers": {
              "Content-Disposition": {
                "description": "Attachment with activity-ID filename",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/vnd.ant.fit": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/event-analyses": {
      "post": {
        "tags": [
          "Event Intelligence"
        ],
        "operationId": "analyseEvent",
        "summary": "Analyse a GPX course",
        "description": "One continuous route with elevation, up to 3 MiB / 50,000 points. Saves a private derived result. 100 attempts per owner per UTC day; 1,000 shared. Raw GPX is not retained. No weather or athlete matching. See /docs/event-intelligence for retry and retention semantics.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{8,128}$"
            },
            "description": "Keep stable for retries; different input with the same key returns 409. If omitted, normalized input determines duplicate identity."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "gpx_xml"
                ],
                "properties": {
                  "gpx_xml": {
                    "type": "string",
                    "description": "Raw GPX XML, maximum 3 MiB UTF-8"
                  },
                  "event": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "maxLength": 160
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "road_race",
                          "criterium",
                          "time_trial",
                          "gran_fondo",
                          "sportive",
                          "gravel",
                          "mtb",
                          "mtb_xc",
                          "ultra",
                          "stage",
                          "triathlon_bike_leg",
                          "other"
                        ]
                      },
                      "date": {
                        "type": "string",
                        "format": "date"
                      },
                      "course_format": {
                        "type": "string",
                        "enum": [
                          "point_to_point",
                          "loop",
                          "laps"
                        ]
                      },
                      "course_laps": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Existing terminal attempt; inspect status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "processing",
                        "ready",
                        "failed"
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "completed_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "error_code": {
                      "type": "string",
                      "nullable": true
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "self": {
                          "type": "string"
                        }
                      }
                    },
                    "analysis": {
                      "type": "object",
                      "nullable": true,
                      "description": "Versioned movepacket_event_intelligence_v1 result. See the Event Intelligence guide.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "New completed analysis",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "processing",
                        "ready",
                        "failed"
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "completed_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "error_code": {
                      "type": "string",
                      "nullable": true
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "self": {
                          "type": "string"
                        }
                      }
                    },
                    "analysis": {
                      "type": "object",
                      "nullable": true,
                      "description": "Versioned movepacket_event_intelligence_v1 result. See the Event Intelligence guide.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Matching attempt is processing; retrieve links.self",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "processing",
                        "ready",
                        "failed"
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "completed_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "error_code": {
                      "type": "string",
                      "nullable": true
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "self": {
                          "type": "string"
                        }
                      }
                    },
                    "analysis": {
                      "type": "object",
                      "nullable": true,
                      "description": "Versioned movepacket_event_intelligence_v1 result. See the Event Intelligence guide.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Result has been deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Input or result exceeds the endpoint limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Input validation or analysis failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily analysis allowance reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Event Intelligence"
        ],
        "operationId": "listEventAnalyses",
        "summary": "List route analyses",
        "description": "Newest first, 20 per page. Deleted results are omitted. Offset pages can shift as new records arrive.",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Private attempt summaries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "analyses": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "status"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "ready",
                              "failed"
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "completed_at": {
                            "type": "string",
                            "nullable": true
                          },
                          "error_code": {
                            "type": "string",
                            "nullable": true
                          },
                          "replayed": {
                            "type": "boolean"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "self": {
                                "type": "string"
                              }
                            }
                          },
                          "analysis": {
                            "type": "object",
                            "nullable": true,
                            "description": "Versioned movepacket_event_intelligence_v1 result. See the Event Intelligence guide.",
                            "additionalProperties": true
                          }
                        }
                      }
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/event-analyses/{id}": {
      "get": {
        "tags": [
          "Event Intelligence"
        ],
        "operationId": "getEventAnalysis",
        "summary": "Retrieve a route analysis",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^evt_[a-f0-9-]{36}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Attempt status and result when ready",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "processing",
                        "ready",
                        "failed"
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "completed_at": {
                      "type": "string",
                      "nullable": true
                    },
                    "error_code": {
                      "type": "string",
                      "nullable": true
                    },
                    "replayed": {
                      "type": "boolean"
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "self": {
                          "type": "string"
                        }
                      }
                    },
                    "analysis": {
                      "type": "object",
                      "nullable": true,
                      "description": "Versioned movepacket_event_intelligence_v1 result. See the Event Intelligence guide.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Result has been deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Event Intelligence"
        ],
        "operationId": "deleteEventAnalysis",
        "summary": "Delete a saved route result",
        "description": "Removes derived result and event name. Minimal usage and idempotency metadata remains. Does not purge backups or downloaded copies. Processing attempts cannot be deleted.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^evt_[a-f0-9-]{36}$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Result removed"
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/event-analyses/usage": {
      "get": {
        "tags": [
          "Event Intelligence"
        ],
        "operationId": "getEventUsage",
        "summary": "Read Event Intelligence usage",
        "description": "Current UTC month. Attempts count admissions, not validation failures or replays. Measured cost is unknown (null), never inferred as zero. Billing is off.",
        "responses": {
          "200": {
            "description": "Usage and current daily allowance",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "capability": {
                      "type": "string"
                    },
                    "period": {
                      "type": "string"
                    },
                    "timezone": {
                      "type": "string",
                      "enum": [
                        "UTC"
                      ]
                    },
                    "attempts": {
                      "type": "integer"
                    },
                    "successful": {
                      "type": "integer"
                    },
                    "failed": {
                      "type": "integer"
                    },
                    "processing": {
                      "type": "integer"
                    },
                    "today": {
                      "type": "integer"
                    },
                    "daily_limit": {
                      "type": "integer"
                    },
                    "billing_enabled": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "measured_cost": {
                      "type": "number",
                      "nullable": true
                    },
                    "currency": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/library": {
      "get": {
        "tags": [
          "Athlete library"
        ],
        "operationId": "getAthleteLibrary",
        "summary": "Read combined individual uploads and bulk recordings",
        "description": "Up to 50 rows ordered by ingestion time. Single-upload summaries are null; retrieve their decoded data for metrics. No storage data is rewritten or merged.",
        "parameters": [
          {
            "name": "athlete_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Optional workspace filter; athlete-scoped credentials are always constrained to their athlete."
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Private activity library",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "activities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "athlete_id": {
                            "type": "string",
                            "nullable": true
                          },
                          "athlete_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "recording",
                              "activity"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "summary": {
                            "type": "object",
                            "nullable": true,
                            "additionalProperties": true
                          },
                          "api_path": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "athlete_id",
                          "athlete_name",
                          "kind",
                          "status",
                          "created_at",
                          "summary",
                          "api_path"
                        ]
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "imports": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "state": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "state",
                          "count"
                        ]
                      }
                    }
                  },
                  "required": [
                    "activities",
                    "has_more",
                    "offset",
                    "imports"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/project-data/{id}": {
      "get": {
        "tags": [
          "Athlete library"
        ],
        "operationId": "getProjectAthleteLibrary",
        "summary": "Read the athlete connected to a private project",
        "description": "Connection is configured in the signed-in workspace. Credential must authorise the workspace and, for athlete grants, the connected athlete. Disconnected projects return 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connected athlete library",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "activities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "athlete_id": {
                            "type": "string",
                            "nullable": true
                          },
                          "athlete_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "recording",
                              "activity"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "summary": {
                            "type": "object",
                            "nullable": true,
                            "additionalProperties": true
                          },
                          "api_path": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "athlete_id",
                          "athlete_name",
                          "kind",
                          "status",
                          "created_at",
                          "summary",
                          "api_path"
                        ]
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "imports": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "state": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "state",
                          "count"
                        ]
                      }
                    }
                  },
                  "required": [
                    "activities",
                    "has_more",
                    "offset",
                    "imports"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recordings": {
      "get": {
        "tags": [
          "Athlete library"
        ],
        "operationId": "listRecordings",
        "summary": "List bulk-imported recordings",
        "parameters": [
          {
            "name": "athlete_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Optional workspace filter; athlete-scoped credentials are always constrained to their athlete."
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recording summaries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recordings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recordings/{id}": {
      "get": {
        "tags": [
          "Athlete library"
        ],
        "operationId": "getRecording",
        "summary": "Read a recording summary",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^rec_[a-f0-9-]{36}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recording summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recordings/{id}/data": {
      "get": {
        "tags": [
          "Athlete library"
        ],
        "operationId": "getRecordingData",
        "summary": "Read full decoded FIT messages",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^rec_[a-f0-9-]{36}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Decoded evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecodedActivity"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recordings/{id}/original": {
      "get": {
        "tags": [
          "Athlete library"
        ],
        "operationId": "getRecordingOriginal",
        "summary": "Download the first uploaded source unchanged",
        "description": "May be FIT or FIT.GZ; preserves the original container bytes.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^rec_[a-f0-9-]{36}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original file",
            "content": {
              "application/vnd.ant.fit": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/gzip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}": {
      "get": {
        "tags": [
          "Builder"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "operationId": "getSoftwareStatus",
        "summary": "Read app status and current version",
        "responses": {
          "200": {
            "description": "Owned app status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "app"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Active Core subscription required for customer writes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Browser access or processing restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily analysis allowance reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/inspect": {
      "get": {
        "tags": [
          "Builder"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "operationId": "inspectBuilderCapabilities",
        "summary": "Inspect supported runtime, limits and access",
        "responses": {
          "200": {
            "description": "Builder capability contract",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Active Core subscription required for customer writes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Browser access or processing restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily analysis allowance reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/source": {
      "get": {
        "tags": [
          "Builder"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "operationId": "getSoftwareSource",
        "summary": "Download verified current public source",
        "description": "Returns the static package or a legacy generated-page object, plus current version. Does not include provider credentials or private records.",
        "responses": {
          "200": {
            "description": "Current source",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "version": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "version"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Active Core subscription required for customer writes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Browser access or processing restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily analysis allowance reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/releases": {
      "get": {
        "tags": [
          "Builder"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "operationId": "listSoftwareReleases",
        "summary": "List up to 200 app-owned releases",
        "responses": {
          "200": {
            "description": "Versions and active pointer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "active_version": {
                      "type": "string",
                      "nullable": true
                    },
                    "releases": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "active_version",
                    "releases"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Active Core subscription required for customer writes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Browser access or processing restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily analysis allowance reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/deploy-static": {
      "put": {
        "tags": [
          "Builder"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "Exact current version ID, without quotes. A different current version returns 409.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "operationId": "publishStaticApp",
        "summary": "Publish a verified static browser app",
        "description": "Maximum 6 MiB JSON request. Use a stable new UUID for retries and public:true after reviewing all files. Storage verification precedes atomic activation. Retries can return active:false if a later version is live; do not present that as a successful current publish. 30 releases/day and 200 retained rows per app, including failed attempts. No server code execution.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "release_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "public": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  },
                  "package": {
                    "$ref": "#/components/schemas/StaticApp"
                  }
                },
                "required": [
                  "release_id",
                  "public",
                  "package"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Release outcome; check active",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "version": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "active": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "url",
                    "version",
                    "active"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Active Core subscription required for customer writes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Browser access or processing restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily analysis allowance reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/stage": {
      "put": {
        "tags": [
          "Builder"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "Exact current version ID, without quotes. A different current version returns 409.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "operationId": "stageSoftwareUpdate",
        "summary": "Save a private static update without changing the live app",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "release_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "preview": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  },
                  "package": {
                    "$ref": "#/components/schemas/StaticApp"
                  }
                },
                "required": [
                  "release_id",
                  "preview",
                  "package"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved candidate and base version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Active Core subscription required for customer writes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Browser access or processing restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily analysis allowance reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/release-source/{version}": {
      "get": {
        "tags": [
          "Builder"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "operationId": "getSoftwareCandidate",
        "summary": "Retrieve verified app-owned candidate files for a local preview",
        "responses": {
          "200": {
            "description": "Private candidate package and base version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Active Core subscription required for customer writes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Browser access or processing restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily analysis allowance reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/review/{version}": {
      "get": {
        "tags": [
          "Builder"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "operationId": "reviewSoftwareCandidate",
        "summary": "Review changes and check evidence for a saved static update",
        "description": "Returns a private hosted preview URL, exact saved content hash, file change summary and scoped check results. The preview requires the owner’s MovePacket sign-in even for a public project. Manual functional review and unconfigured independent review are not marked passed.",
        "responses": {
          "200": {
            "description": "Saved-version review evidence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Active Core subscription required for customer writes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Browser access or processing restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily analysis allowance reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/publish-candidate": {
      "post": {
        "tags": [
          "Builder"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "Exact current version ID, without quotes. A different current version returns 409.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "operationId": "publishSoftwareCandidate",
        "summary": "Publish the exact saved candidate after owner review",
        "description": "Requires the live version to still match the candidate base. Does not apply database changes.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "public": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  }
                },
                "required": [
                  "version",
                  "public"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Published candidate",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "version": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "active": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "url",
                    "version",
                    "active"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Active Core subscription required for customer writes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Browser access or processing restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily analysis allowance reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/rollback": {
      "post": {
        "tags": [
          "Builder"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "Exact current version ID, without quotes. A different current version returns 409.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "operationId": "restoreSoftwareRelease",
        "summary": "Restore an app-owned verified release",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "version"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Restored version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "version": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "active": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "url",
                    "version",
                    "active"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Active Core subscription required for customer writes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Browser access or processing restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown resource or inaccessible workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting request or resource still processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Daily analysis allowance reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service or stored object unavailable; hosted beta may not be open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect": {
      "get": {
        "operationId": "discoverDataConnect",
        "summary": "Discover Data Connect capabilities",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect/athletes": {
      "get": {
        "operationId": "listConnectedAthletes",
        "summary": "List athletes explicitly granted to this app",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}": {
      "get": {
        "operationId": "getAthleteCapabilities",
        "summary": "Discover this athlete’s app permissions",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/identity": {
      "get": {
        "operationId": "readAthleteidentity",
        "summary": "Read athlete identity",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "description": "Requires the corresponding current athlete grant. No provider activation or automatic coaching. Activities include quality status; memory and observations retain separate source semantics."
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/activities": {
      "get": {
        "operationId": "readAthleteactivities",
        "summary": "Read athlete activities",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "description": "Requires the corresponding current athlete grant. No provider activation or automatic coaching. Activities include quality status; memory and observations retain separate source semantics."
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/memory": {
      "get": {
        "operationId": "readAthletememory",
        "summary": "Read athlete memory",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "description": "Requires the corresponding current athlete grant. No provider activation or automatic coaching. Activities include quality status; memory and observations retain separate source semantics."
      },
      "post": {
        "operationId": "promoteConnectedAthleteMemory",
        "summary": "Promote a selected app record field into athlete memory",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Promoted evidence ID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "description": "Uses the existing single-athlete app record promotion contract documented in Records. No arbitrary memory value is accepted.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "withdrawConnectedAthleteMemory",
        "summary": "Withdraw supplied memory evidence",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/observations": {
      "get": {
        "operationId": "readAthleteobservations",
        "summary": "Read athlete observations",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "description": "Requires the corresponding current athlete grant. No provider activation or automatic coaching. Activities include quality status; memory and observations retain separate source semantics."
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/activities/{activity_id}": {
      "get": {
        "operationId": "readConnectedActivity",
        "summary": "Read an athlete activity",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "activity_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/activities/{activity_id}/{part}": {
      "get": {
        "operationId": "downloadConnectedActivity",
        "summary": "Download original or decoded athlete activity",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "activity_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "part",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "original",
                "data"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Original FIT/FIT.GZ or decoded JSON",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/records/{domain}": {
      "get": {
        "operationId": "listAthleteDomainRecords",
        "summary": "Read dated source records and history",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "measurements",
                "coaching_relationship",
                "goals",
                "events",
                "constraints",
                "availability",
                "history",
                "performance_targets",
                "subjective_feedback",
                "coach_observations",
                "decisions",
                "interventions",
                "outcomes",
                "current_priorities",
                "prescriptions"
              ]
            }
          },
          {
            "name": "before",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "view",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "history",
                "current"
              ],
              "default": "history"
            }
          },
          {
            "name": "as_of",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "description": "50 records/page, opaque ID cursor. Current is latest effective record per app/domain/record_key/schema version, preserving distinct producers. RetainedSyntheticPlanV2 is an internal synthetic provider-plan read variant requiring current named operation grants as well as Foundation read grants; version-1 records cannot supersede or withdraw it. as_of filters effective dates under current permissions; it is not a reconstruction of what was known at that time. Local-only measurements use capture time for selection and retain the unzoned measurement date separately."
      },
      "post": {
        "operationId": "supplyAthleteDomainRecord",
        "summary": "Supply one immutable athlete record",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "measurements",
                "coaching_relationship",
                "goals",
                "events",
                "constraints",
                "availability",
                "history",
                "performance_targets",
                "subjective_feedback",
                "coach_observations",
                "decisions",
                "interventions",
                "outcomes",
                "current_priorities",
                "prescriptions"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created record with permanent ID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "description": "Version 1 only; internal provider-plan receipts cannot be supplied here. 32 KiB maximum. Server app key plus per-athlete/domain supply grant and paid writes. Source rights are caller assertions, not provider authorisation. Same request_id and identical body replay safely; changed body conflicts. No direct provider calls.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataConnectRecordInput"
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/records/{domain}/{record_id}": {
      "get": {
        "operationId": "readAthleteDomainRecord",
        "summary": "Read a retained domain record",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "measurements",
                "coaching_relationship",
                "goals",
                "events",
                "constraints",
                "availability",
                "history",
                "performance_targets",
                "subjective_feedback",
                "coach_observations",
                "decisions",
                "interventions",
                "outcomes",
                "current_priorities",
                "prescriptions"
              ]
            }
          },
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "withdrawAthleteDomainRecord",
        "summary": "Withdraw this app’s version-1 domain record",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "measurements",
                "coaching_relationship",
                "goals",
                "events",
                "constraints",
                "availability",
                "history",
                "performance_targets",
                "subjective_feedback",
                "coach_observations",
                "decisions",
                "interventions",
                "outcomes",
                "current_priorities",
                "prescriptions"
              ]
            }
          },
          {
            "name": "record_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/imports": {
      "get": {
        "operationId": "listConnectedImports",
        "summary": "List this app’s imports for the athlete",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "startConnectedImport",
        "summary": "Create an athlete FIT import manifest",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Import session ID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "description": "Requires training_data.supply, paid account and activated Core app. Maximum 200 files, 4 MiB/file, 200 MiB/batch. Uses existing manifest validation, idempotency and limits. Accepted work belongs to the workspace.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "athlete_id",
                  "request_id",
                  "permission_note",
                  "files"
                ],
                "properties": {
                  "athlete_id": {
                    "type": "string"
                  },
                  "request_id": {
                    "type": "string",
                    "minLength": 16,
                    "maxLength": 80
                  },
                  "permission_note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "files": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 200,
                    "items": {
                      "type": "object",
                      "required": [
                        "filename",
                        "format",
                        "sha256",
                        "byte_size"
                      ],
                      "properties": {
                        "filename": {
                          "type": "string",
                          "maxLength": 240
                        },
                        "format": {
                          "type": "string",
                          "enum": [
                            "fit",
                            "fit.gz"
                          ]
                        },
                        "sha256": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "byte_size": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 4194304
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/imports/{session_id}": {
      "get": {
        "operationId": "readConnectedImport",
        "summary": "Read this app’s import status",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/imports/{session_id}/items/{item_id}": {
      "put": {
        "operationId": "uploadConnectedImportFile",
        "summary": "Upload an original FIT or FIT.GZ file",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "File accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/imports/{session_id}/items/{item_id}/retry": {
      "post": {
        "operationId": "retryConnectedImportFile",
        "summary": "Retry eligible failed file processing",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/software/{app_id}/data-connect/athletes/{athlete_id}/imports/{session_id}/items/{item_id}/original": {
      "get": {
        "operationId": "downloadConnectedImportOriginal",
        "summary": "Download an original from this app’s import",
        "tags": [
          "Data Connect"
        ],
        "security": [
          {
            "AppBuilderBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorised result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or unsupported input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired server app credential",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Permission, entitlement or current resource access denied",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict, changed state or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "description": "Also requires training_data.read."
      }
    },
    "/v1/workspace-builder": {
      "get": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderCapabilities",
        "summary": "Discover current connection capabilities and intake limits",
        "responses": {
          "200": {
            "description": "Current capability flags, links and limits",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/athletes": {
      "get": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderAthletes",
        "summary": "Find explicitly selected active athletes by name",
        "description": "Returns only id, name and status. Names do not establish permission or a unique identity. Resolve ambiguity before uploading. Current selections are paginated in pages of 50.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Selected athletes, offset and has_more",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "createWorkspaceBuilderAthlete",
        "summary": "Create and select one athlete with explicit athlete-create permission",
        "description": "Permission defaults off. Reuse the same request_id and exact payload after interruption. Conflicting reuse returns 409. A removed selection cannot be restored by replay. Active paid subscription required; at most 100 new intake athlete requests per day, 1000 retained per workspace and 50 selected athletes per connection. Limit or lost access returns 403. This creates an Athlete record, not a login or provider connection.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "request_id",
                  "name",
                  "permission_note"
                ],
                "properties": {
                  "request_id": {
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9_-]{16,80}$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "permission_note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Identical creation replay",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Created athlete ID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/athletes/{athlete_id}/imports": {
      "get": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderImports",
        "summary": "List this connection’s latest 50 imports for a selected athlete",
        "parameters": [
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ath_[a-f0-9-]{36}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scoped import sessions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "createWorkspaceBuilderImport",
        "summary": "Admit a bounded FIT/FIT.GZ import manifest",
        "parameters": [
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ath_[a-f0-9-]{36}$"
            }
          }
        ],
        "description": "Requires import permission, current athlete selection and an active paid subscription. Body athlete_id must match the path. Reuse request_id and the exact manifest to resume. Maximum 200 files, 4 MiB per file and expanded FIT, 200 MiB per batch, 100 manifests per UTC day and 1000 retained per workspace. Limit or lost access returns 403. Only this connection can use this credential to read its import status and originals; no existing athlete ride-history access is added. Already stored files continue processing under current workspace, athlete and privacy restrictions after connection revocation. No ZIP archive support.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "athlete_id",
                  "request_id",
                  "permission_note",
                  "files"
                ],
                "properties": {
                  "athlete_id": {
                    "type": "string",
                    "pattern": "^ath_[a-f0-9-]{36}$"
                  },
                  "request_id": {
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9_-]{16,80}$"
                  },
                  "permission_note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "files": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 200,
                    "items": {
                      "type": "object",
                      "required": [
                        "filename",
                        "format",
                        "sha256",
                        "byte_size"
                      ],
                      "properties": {
                        "filename": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 240
                        },
                        "format": {
                          "type": "string",
                          "enum": [
                            "fit",
                            "fit.gz"
                          ]
                        },
                        "sha256": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "byte_size": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 4194304
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replayed import session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "New import session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/athletes/{athlete_id}/imports/{session_id}": {
      "get": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderImportStatus",
        "summary": "Read this connection’s import items and states",
        "parameters": [
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ath_[a-f0-9-]{36}$"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^imp_[a-f0-9-]{36}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Import session and items",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/athletes/{athlete_id}/imports/{session_id}/items/{item_id}": {
      "put": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderImportBytes",
        "summary": "Upload original file bytes matching the admitted item hash and size",
        "parameters": [
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ath_[a-f0-9-]{36}$"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^imp_[a-f0-9-]{36}$"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^itm_[a-f0-9-]{36}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 4194304
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Previously stored item",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "202": {
            "description": "Stored and queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "415": {
            "description": "Send application/octet-stream",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/athletes/{athlete_id}/imports/{session_id}/items/{item_id}/retry": {
      "post": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderRetryImport",
        "summary": "Explicitly retry an eligible processing failure",
        "parameters": [
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ath_[a-f0-9-]{36}$"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^imp_[a-f0-9-]{36}$"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^itm_[a-f0-9-]{36}$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Queued for processing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/athletes/{athlete_id}/imports/{session_id}/items/{item_id}/original": {
      "get": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderImportOriginal",
        "summary": "Download this connection’s exact stored original",
        "parameters": [
          {
            "name": "athlete_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ath_[a-f0-9-]{36}$"
            }
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^imp_[a-f0-9-]{36}$"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^itm_[a-f0-9-]{36}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Private original bytes",
            "content": {
              "application/vnd.ant.fit": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/gzip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/projects": {
      "get": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "listBuilderProjects",
        "summary": "List up to 50 Projects currently granted to this connection",
        "responses": {
          "200": {
            "description": "Selected Projects only",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "createBuilderProject",
        "summary": "Create an internal Project and grant this connection access",
        "description": "Uses the canonical paid creation transition. Reuse the same request_key and payload for retries. Up to 50 workspace setup records. Does not call a model, provision external hosting, buy infrastructure or publish. Removing Project access prevents a creation replay from restoring it.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "request_key",
                  "prompt"
                ],
                "properties": {
                  "request_key": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 5,
                    "maxLength": 1200
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replayed Project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Created Project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "202": {
            "description": "Saved; preparation needs attention",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/projects/{project_id}/inspect": {
      "get": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderInspect",
        "summary": "Inspect Project state and allowed operations",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(?:[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}|new)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project-scoped result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/projects/{project_id}/source": {
      "get": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderSource",
        "summary": "Read the active source",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(?:[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}|new)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project-scoped result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/projects/{project_id}/working-source": {
      "get": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderWorkingSource",
        "summary": "Read the selected working source",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(?:[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}|new)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project-scoped result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/projects/{project_id}/releases": {
      "get": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderReleases",
        "summary": "List saved versions",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(?:[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}|new)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project-scoped result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/projects/{project_id}/review/{version}": {
      "get": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderReview",
        "summary": "Read saved-version review evidence",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(?:[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}|new)$"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project-scoped result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/projects/{project_id}/release-source/{version}": {
      "get": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "workspaceBuilderReleaseSource",
        "summary": "Read a saved private candidate",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(?:[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}|new)$"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project-scoped result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspace-builder/projects/{project_id}/stage": {
      "put": {
        "tags": [
          "Workspace builders"
        ],
        "security": [
          {
            "workspaceBuilderAuth": []
          }
        ],
        "operationId": "stageWorkspaceBuilderProject",
        "summary": "Save a private static candidate for owner review",
        "description": "Same limits and immutable release validation as app-specific stage. Never publishes. Reuses a stable release_id for retries. Existing live and working versions must match.",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(?:[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}|new)$"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Working-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Working version UUID followed by colon and generation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "release_id",
                  "preview",
                  "package"
                ],
                "properties": {
                  "release_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "preview": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  },
                  "package": {
                    "$ref": "#/components/schemas/StaticApp"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved version and private preview URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid bounded input",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid proof",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "402": {
            "description": "Subscription required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Current permission denies access",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Project or operation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "409": {
            "description": "State changed or preparation incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "413": {
            "description": "Package too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Workspace or release limit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Workspace API key. Keep it in your backend or secret manager; never expose it to browser code."
      },
      "AppBuilderBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "App-scoped builder connection. Local tool/server only; browser Origin and Sec-Fetch-Site requests are rejected. Never publish this credential."
      },
      "workspaceBuilderAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Local proof approved by the workspace owner in Settings → AI builders. Expires in 30 days. Never place in browser code, URLs, prompts or Project files. Requests with browser Origin/Sec-Fetch-Site headers are rejected."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "Activity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^act_[a-f0-9-]{36}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "received",
              "queued",
              "ready",
              "failed"
            ]
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "byte_size": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4194304
          },
          "error_code": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string"
              },
              "original": {
                "type": "string"
              },
              "data": {
                "type": "string"
              }
            },
            "required": [
              "self",
              "original",
              "data"
            ]
          }
        },
        "required": [
          "id",
          "status",
          "sha256",
          "byte_size",
          "error_code",
          "created_at",
          "links"
        ]
      },
      "UploadResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Activity"
          },
          {
            "type": "object",
            "properties": {
              "duplicate": {
                "type": "boolean"
              }
            },
            "required": [
              "duplicate"
            ]
          }
        ]
      },
      "ActivityList": {
        "type": "object",
        "properties": {
          "activities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Activity"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "stats": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "ready": {
                "type": "integer",
                "minimum": 0
              },
              "processing": {
                "type": "integer",
                "minimum": 0
              },
              "failed": {
                "type": "integer",
                "minimum": 0
              },
              "stored_bytes": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "total",
              "ready",
              "processing",
              "failed",
              "stored_bytes"
            ]
          }
        },
        "required": [
          "activities",
          "total",
          "limit",
          "offset",
          "stats"
        ]
      },
      "DecodedActivity": {
        "type": "object",
        "properties": {
          "schema_version": {
            "type": "string",
            "enum": [
              "0.1"
            ]
          },
          "parser": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "@garmin/fitsdk"
                ]
              },
              "version": {
                "type": "string"
              },
              "fit_profile": {
                "description": "FIT profile version reported by the decoder"
              }
            },
            "required": [
              "name",
              "version",
              "fit_profile"
            ]
          },
          "summary": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "message_count": {
            "type": "integer",
            "minimum": 1
          },
          "messages": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "required": [
          "schema_version",
          "parser",
          "summary",
          "message_count",
          "messages"
        ]
      },
      "StaticApp": {
        "type": "object",
        "required": [
          "kind",
          "format",
          "title",
          "maps",
          "files"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "static-app"
            ]
          },
          "format": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "maps": {
            "type": "boolean",
            "description": "Allow the fixed OpenFreeMap tile origin."
          },
          "files": {
            "type": "array",
            "minItems": 1,
            "maxItems": 80,
            "items": {
              "type": "object",
              "required": [
                "path",
                "content"
              ],
              "properties": {
                "path": {
                  "type": "string",
                  "maxLength": 100,
                  "description": "Relative allowed public asset path. index.html required. Private/config paths, traversal and symlinks unsupported."
                },
                "content": {
                  "type": "string",
                  "format": "byte",
                  "description": "Base64 file bytes. 2 MiB decoded per file; 4 MiB total."
                }
              }
            }
          }
        }
      },
      "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
          }
        }
      },
      "DataConnectRecordInput": {
        "oneOf": [
          {
            "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"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_measurements"
              }
            }
          },
          {
            "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": [
                  "coaching_relationship"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_coaching_relationship"
              }
            }
          },
          {
            "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": [
                  "goals"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_goals"
              }
            }
          },
          {
            "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": [
                  "events"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_events"
              }
            }
          },
          {
            "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": [
                  "constraints"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_constraints"
              }
            }
          },
          {
            "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": [
                  "availability"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_availability"
              }
            }
          },
          {
            "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": [
                  "history"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_history"
              }
            }
          },
          {
            "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": [
                  "performance_targets"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_performance_targets"
              }
            }
          },
          {
            "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": [
                  "subjective_feedback"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_subjective_feedback"
              }
            }
          },
          {
            "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": [
                  "coach_observations"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_coach_observations"
              }
            }
          },
          {
            "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": [
                  "decisions"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_decisions"
              }
            }
          },
          {
            "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": [
                  "interventions"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_interventions"
              }
            }
          },
          {
            "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": [
                  "outcomes"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_outcomes"
              }
            }
          },
          {
            "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": [
                  "current_priorities"
                ]
              },
              "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": {
                "$ref": "#/components/schemas/Domain_current_priorities"
              }
            }
          },
          {
            "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": [
                  "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": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Domain_prescriptions"
                  },
                  {
                    "$ref": "#/components/schemas/TrainingPeaksPrescription"
                  }
                ]
              }
            }
          }
        ]
      }
    }
  }
}
