openapi: 3.0.3 info: title: TrainingPeaks Partners Athlete Coach API version: '2.0' description: 'The TrainingPeaks Partners API (Public API) lets approved third-party applications read and write TrainingPeaks data on behalf of a user - athlete profiles, planned and completed workouts, structured workout files, wellness metrics, nutrition, events, routes, coach relationships, activity file uploads, and workout webhooks. It is a JSON over HTTPS REST API secured with OAuth 2.0 (authorization_code and refresh_token grants). ACCESS MODEL: Access is partner-gated. Applications must request credentials at https://api.trainingpeaks.com/request-access and are individually evaluated; TrainingPeaks states it is not accepting API requests for personal use. Each application is granted a fixed set of OAuth scopes; requesting more scopes than granted causes the token exchange to fail. The full API surface is publicly documented at https://github.com/TrainingPeaks/PartnersAPI/wiki, from which this specification was authored. ENDPOINT PROVENANCE: All paths, HTTP methods, and OAuth scopes in this document are CONFIRMED against the public PartnersAPI wiki API-Endpoints page. Request and response SCHEMAS are MODELED from the wiki object pages and examples, because the live reference responses require partner credentials and an authorized user; treat the property lists as representative rather than exhaustive (marked with x-endpoints-modeled below).' contact: name: TrainingPeaks API Partnerships Team url: https://api.trainingpeaks.com/request-access x-access-model: partner-gated (application required; not available for personal use) x-endpoints-confirmed: true x-schemas-modeled: true x-documentation: https://github.com/TrainingPeaks/PartnersAPI/wiki servers: - url: https://api.trainingpeaks.com description: Production - url: https://api.sandbox.trainingpeaks.com description: Sandbox (UAT; database refreshed weekly from production) security: - OAuth2: [] tags: - name: Coach description: Coach profile, athletes, and assistant management. paths: /v1/coach/profile: get: tags: - Coach summary: Get coach profile description: Retrieve the authenticated coach's profile. Scope coach:athletes. operationId: getCoachProfile responses: '200': description: The coach profile. content: application/json: schema: $ref: '#/components/schemas/CoachProfile' '401': $ref: '#/components/responses/Unauthorized' /v1/coach/athletes: get: tags: - Coach summary: List coach athletes description: List the athletes attached to the authenticated coach. Scope coach:athletes. operationId: getCoachAthletes responses: '200': description: The coach's athletes. content: application/json: schema: type: array items: $ref: '#/components/schemas/AthleteProfile' '401': $ref: '#/components/responses/Unauthorized' /v1/coach/athletes/zones: get: tags: - Coach summary: Get coach athletes zones (deprecated) description: Deprecated. Zones for the coach's athletes. Scope coach:athletes. operationId: getCoachAthleteZones deprecated: true responses: '200': description: Zones for the coach's athletes. '401': $ref: '#/components/responses/Unauthorized' /v1/coach/athletes/zones/{zoneType}: get: tags: - Coach summary: Get coach athletes zones by type (deprecated) description: Deprecated. Zones by type for the coach's athletes. Scope coach:athletes. operationId: getCoachAthleteZonesByType deprecated: true parameters: - name: zoneType in: path required: true schema: type: string enum: - heartrate - power - speed responses: '200': description: Zones for the coach's athletes for the type. '401': $ref: '#/components/responses/Unauthorized' /v1/coach/assistants: get: tags: - Coach summary: List assistants description: List assistant coaches for the authenticated coach. Scope coach:athletes. operationId: getCoachAssistants responses: '200': description: The coach's assistants. '401': $ref: '#/components/responses/Unauthorized' /v1/coach/assistants/{assistantId}: get: tags: - Coach summary: Get assistant description: Retrieve a single assistant coach. Scope coach:athletes. operationId: getCoachAssistant parameters: - name: assistantId in: path required: true schema: type: integer format: int64 responses: '200': description: The assistant coach. '401': $ref: '#/components/responses/Unauthorized' /v1/coach/assistants/{assistantId}/athletes: get: tags: - Coach summary: List assistant athletes description: List the athletes attached to an assistant coach. Scope coach:athletes. operationId: getCoachAssistantAthletes parameters: - name: assistantId in: path required: true schema: type: integer format: int64 responses: '200': description: The assistant's athletes. content: application/json: schema: type: array items: $ref: '#/components/schemas/AthleteProfile' '401': $ref: '#/components/responses/Unauthorized' components: schemas: CoachProfile: type: object description: Coach profile. Modeled. properties: Id: type: integer format: int64 FirstName: type: string LastName: type: string Email: type: string CoachType: type: string AthleteProfile: type: object description: Athlete profile. Modeled - property set is representative. properties: Id: type: integer format: int64 FirstName: type: string LastName: type: string Email: type: string IsPremium: type: boolean description: Governs which workout fields are returned. Type: type: string description: athlete or coach account type. TimeZone: type: string Units: type: string description: english or metric. responses: Unauthorized: description: Bad, expired, or missing authorization header. securitySchemes: OAuth2: type: oauth2 description: OAuth 2.0 authorization code flow. Tokens are short-lived (expires_in seconds) and refreshed with the refresh_token grant. Scopes are not inclusive (e.g. workouts:details does not include workouts:read) and are limited to those granted to your application. flows: authorizationCode: authorizationUrl: https://oauth.trainingpeaks.com/OAuth/Authorize tokenUrl: https://oauth.trainingpeaks.com/oauth/token refreshUrl: https://oauth.trainingpeaks.com/oauth/token scopes: athlete:profile: Read the authenticated athlete's profile and zones. coach:athletes: Read coach profile, athletes, and assistants. workouts:read: Read planned and completed workouts and analytics. workouts:plan: Create, update, and delete planned workouts. workouts:wod: Read Workout of the Day and structured workout files. workouts:details: Read workout detail samples and post comments. metrics:read: Read athlete metrics. metrics:write: Create athlete metrics. nutrition:read: Read athlete nutrition entries. nutrition:write: Create, update, and delete nutrition entries. events:read: Read athlete events. events:write: Create athlete events. routes:read: Read athlete routes. routes:write: Create athlete routes. file:write: Upload activity files. webhook:read-subscriptions: List webhook subscriptions. webhook:write-subscriptions: Create, update, and delete webhook subscriptions.