Skip to content

Commit b73e26f

Browse files
terra-alexclaude
andcommitted
fix: correct Teams API spec — add to_destination param, fix date param names
- Rename start_time/end_time to start_date/end_date on activities and tests endpoints to match actual server implementation (format: date, YYYY-MM-DD) - Add missing to_destination query parameter to activities, tests, and metrics schema endpoints with 202 response documentation - Add missing POST /coaches/{coachId}/tests/search endpoint - Add DataSentToDestination and TestSearchQuery schemas Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4b74651 commit b73e26f

1 file changed

Lines changed: 151 additions & 8 deletions

File tree

teams.yml

Lines changed: 151 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,18 +205,30 @@ paths:
205205
required: true
206206
schema:
207207
type: string
208-
- name: start_time
208+
- name: start_date
209+
in: query
210+
required: true
211+
description: Start date for the query range (YYYY-MM-DD).
212+
schema:
213+
type: string
214+
format: date
215+
example: '2025-01-01'
216+
- name: end_date
209217
in: query
210218
required: false
219+
description: End date for the query range (YYYY-MM-DD). Defaults to start_date + 1 day if omitted.
211220
schema:
212221
type: string
213-
format: date-time
214-
- name: end_time
222+
format: date
223+
example: '2025-01-07'
224+
- name: to_destination
215225
in: query
216226
required: false
227+
description: When `true`, data is sent asynchronously to your configured webhook and the endpoint returns HTTP 202 with a reference ID. When `false` (default), data is returned inline in the response body.
217228
schema:
218229
type: string
219-
format: date-time
230+
enum: ['true', 'false']
231+
default: 'false'
220232
responses:
221233
'200':
222234
description: "List of activities within the specified time range for all athletes under the coach"
@@ -231,6 +243,12 @@ paths:
231243
type: array
232244
items:
233245
$ref: '#/components/schemas/TeamActivity'
246+
'202':
247+
description: Data dispatch accepted. Returned when `to_destination=true`. Data will be sent to your configured webhook.
248+
content:
249+
application/json:
250+
schema:
251+
$ref: '#/components/schemas/DataSentToDestination'
234252
tags:
235253
- Coaches
236254
/coaches/{coachId}/activities/metrics/schema:
@@ -245,6 +263,14 @@ paths:
245263
schema:
246264
type: string
247265
description: Unique identifier of the coach.
266+
- name: to_destination
267+
in: query
268+
required: false
269+
description: When `true`, data is sent asynchronously to your configured webhook and the endpoint returns HTTP 202 with a reference ID. When `false` (default), data is returned inline in the response body.
270+
schema:
271+
type: string
272+
enum: ['true', 'false']
273+
default: 'false'
248274
responses:
249275
'200':
250276
description: Schema retrieved successfully.
@@ -259,6 +285,12 @@ paths:
259285
type: array
260286
items:
261287
$ref: '#/components/schemas/MetricSchema'
288+
'202':
289+
description: Data dispatch accepted. Returned when `to_destination=true`. Data will be sent to your configured webhook.
290+
content:
291+
application/json:
292+
schema:
293+
$ref: '#/components/schemas/DataSentToDestination'
262294
'404':
263295
description: Coach not found.
264296
content:
@@ -277,18 +309,30 @@ paths:
277309
required: true
278310
schema:
279311
type: string
280-
- name: start_time
312+
- name: start_date
313+
in: query
314+
required: true
315+
description: Start date for the query range (YYYY-MM-DD).
316+
schema:
317+
type: string
318+
format: date
319+
example: '2025-01-01'
320+
- name: end_date
281321
in: query
282322
required: false
323+
description: End date for the query range (YYYY-MM-DD). Defaults to start_date + 1 day if omitted.
283324
schema:
284325
type: string
285-
format: date-time
286-
- name: end_time
326+
format: date
327+
example: '2025-01-07'
328+
- name: to_destination
287329
in: query
288330
required: false
331+
description: When `true`, data is sent asynchronously to your configured webhook and the endpoint returns HTTP 202 with a reference ID. When `false` (default), data is returned inline in the response body.
289332
schema:
290333
type: string
291-
format: date-time
334+
enum: ['true', 'false']
335+
default: 'false'
292336
responses:
293337
'200':
294338
description: "List of tests within the specified time range for all athletes under the coach"
@@ -303,6 +347,59 @@ paths:
303347
type: array
304348
items:
305349
$ref: '#/components/schemas/Test'
350+
'202':
351+
description: Data dispatch accepted. Returned when `to_destination=true`. Data will be sent to your configured webhook.
352+
content:
353+
application/json:
354+
schema:
355+
$ref: '#/components/schemas/DataSentToDestination'
356+
tags:
357+
- Coaches
358+
/coaches/{coachId}/tests/search:
359+
post:
360+
operationId: searchTestsForCoach
361+
summary: Search and filter tests for a specific coach
362+
description: Returns tests matching the specified filters. Allows filtering by time range and athlete IDs.
363+
parameters:
364+
- name: coachId
365+
in: path
366+
required: true
367+
schema:
368+
type: string
369+
- name: to_destination
370+
in: query
371+
required: false
372+
description: When `true`, data is sent asynchronously to your configured webhook and the endpoint returns HTTP 202 with a reference ID. When `false` (default), data is returned inline in the response body.
373+
schema:
374+
type: string
375+
enum: ['true', 'false']
376+
default: 'false'
377+
requestBody:
378+
required: true
379+
content:
380+
application/json:
381+
schema:
382+
$ref: '#/components/schemas/TestSearchQuery'
383+
responses:
384+
'200':
385+
description: Filtered list of tests matching the query.
386+
content:
387+
application/json:
388+
schema:
389+
allOf:
390+
- $ref: '#/components/schemas/CoachDataReturned'
391+
- type: object
392+
properties:
393+
data:
394+
type: array
395+
items:
396+
$ref: '#/components/schemas/Test'
397+
'202':
398+
description: Data dispatch accepted. Returned when `to_destination=true`. Data will be sent to your configured webhook.
399+
content:
400+
application/json:
401+
schema:
402+
$ref: '#/components/schemas/DataSentToDestination'
306403
tags:
307404
- Coaches
308405
/athletes:
@@ -429,6 +526,52 @@ components:
429526
in: header
430527
name: dev-id
431528
schemas:
529+
DataSentToDestination:
530+
type: object
531+
description: Returned when `to_destination=true`. Confirms that data retrieval has been queued and will be delivered to your webhook.
532+
properties:
533+
coach:
534+
$ref: '#/components/schemas/Coach'
535+
reference:
536+
type: string
537+
format: uuid
538+
description: Unique reference ID for this dispatch. Can be used to correlate the subsequent webhook delivery.
539+
example: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
540+
message:
541+
type: string
542+
description: Human-readable confirmation message.
543+
example: 'Data dispatched to destination'
544+
type:
545+
type: string
546+
description: The type of data being dispatched.
547+
enum:
548+
- test.dispatched
549+
- activity.dispatched
550+
- activity.metric.dispatched
551+
example: 'activity.dispatched'
552+
TestSearchQuery:
553+
type: object
554+
description: Query body for filtering tests.
555+
required:
556+
- start_time
557+
- end_time
558+
properties:
559+
start_time:
560+
type: string
561+
format: date
562+
description: Start date for the query range (YYYY-MM-DD).
563+
example: '2025-01-01'
564+
end_time:
565+
type: string
566+
format: date
567+
description: End date for the query range (YYYY-MM-DD).
568+
example: '2025-01-07'
569+
athlete_ids:
570+
type: array
571+
description: Optional list of athlete IDs to filter results. If omitted, returns tests for all athletes.
572+
items:
573+
type: string
574+
example: ['athlete-abc-123', 'athlete-def-456']
432575
WidgetSessionParams:
433576
type: object
434577
properties:

0 commit comments

Comments
 (0)