0

Post body data to a provider

by
Published Oct 17, 2025

Used to post body data to a provider. This endpoint only works for users connected via Google Fit. Returns error for other providers.

Script terra Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Post body data to a provider
4
 * Used to post body data to a provider. This endpoint only works for users connected via Google Fit. Returns error for other providers.
5
 */
6
export async function main(auth: RT.Terra, body: Body) {
7
	const url = new URL(`https://api.tryterra.co/v2/body`)
8

9
	const response = await fetch(url, {
10
		method: 'POST',
11
		headers: {
12
			'dev-id': auth.devId,
13
			'Content-Type': 'application/json',
14
			'X-api-key': auth.apiKey
15
		},
16
		body: JSON.stringify(body)
17
	})
18
	if (!response.ok) {
19
		const text = await response.text()
20
		throw new Error(`${response.status} ${text}`)
21
	}
22
	return await response.json()
23
}
24

25
/* eslint-disable */
26
/**
27
 * This file was automatically generated by json-schema-to-typescript.
28
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
29
 * and run json-schema-to-typescript to regenerate this file.
30
 */
31

32
/**
33
 * Represents data types that a certain device contributed to.
34
 */
35
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasDeviceDataTypeYaml =
36
	| Steps
37
	| ActiveMinutes
38
	| BasalMetabolicRate
39
	| Calories
40
	| Distance
41
	| HeartRate
42
	| OxygenSaturation
43
	| SleepClassification
44
	| Speed
45
	| Cadence
46
/**
47
 * Count of steps taken by the user.
48
 */
49
export type Steps = 'STEPS'
50
/**
51
 * Duration of time the user spent in physical activity.
52
 */
53
export type ActiveMinutes = 'ACTIVE_MINUTES'
54
/**
55
 * User's basal metabolic rate - calories burned at rest.
56
 */
57
export type BasalMetabolicRate = 'BMR'
58
/**
59
 * Calories burned by the user during activity.
60
 */
61
export type Calories = 'CALORIES'
62
/**
63
 * Distance traveled by the user during activity.
64
 */
65
export type Distance = 'DISTANCE'
66
/**
67
 * User's heart rate measurements.
68
 */
69
export type HeartRate = 'HEART_RATE'
70
/**
71
 * Blood oxygen saturation level (SpO2) of the user.
72
 */
73
export type OxygenSaturation = 'OXYGEN_SATURATION'
74
/**
75
 * Classification of user's sleep stages or types.
76
 */
77
export type SleepClassification = 'SLEEP_TYPE'
78
/**
79
 * User's movement speed during activity.
80
 */
81
export type Speed = 'SPEED'
82
/**
83
 * Rate of movement repetition during activity (steps per minute).
84
 */
85
export type Cadence = 'CADENCE'
86
/**
87
 * Represents data types that a certain device contributed to.
88
 */
89
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasDeviceDataTypeYaml1 =
90

91
		| Steps1
92
		| ActiveMinutes1
93
		| BasalMetabolicRate1
94
		| Calories1
95
		| Distance1
96
		| HeartRate1
97
		| OxygenSaturation1
98
		| SleepClassification1
99
		| Speed1
100
		| Cadence1
101
/**
102
 * Count of steps taken by the user.
103
 */
104
export type Steps1 = 'STEPS'
105
/**
106
 * Duration of time the user spent in physical activity.
107
 */
108
export type ActiveMinutes1 = 'ACTIVE_MINUTES'
109
/**
110
 * User's basal metabolic rate - calories burned at rest.
111
 */
112
export type BasalMetabolicRate1 = 'BMR'
113
/**
114
 * Calories burned by the user during activity.
115
 */
116
export type Calories1 = 'CALORIES'
117
/**
118
 * Distance traveled by the user during activity.
119
 */
120
export type Distance1 = 'DISTANCE'
121
/**
122
 * User's heart rate measurements.
123
 */
124
export type HeartRate1 = 'HEART_RATE'
125
/**
126
 * Blood oxygen saturation level (SpO2) of the user.
127
 */
128
export type OxygenSaturation1 = 'OXYGEN_SATURATION'
129
/**
130
 * Classification of user's sleep stages or types.
131
 */
132
export type SleepClassification1 = 'SLEEP_TYPE'
133
/**
134
 * User's movement speed during activity.
135
 */
136
export type Speed1 = 'SPEED'
137
/**
138
 * Rate of movement repetition during activity (steps per minute).
139
 */
140
export type Cadence1 = 'CADENCE'
141
/**
142
 * Flag indicating the atrial fibrillation classification of the individual
143
 */
144
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasAFibFlagYaml =
145
	| Negative
146
	| Positive
147
	| Inconclusive
148
/**
149
 * AFib was not detected in the heart rhythm analysis.
150
 */
151
export type Negative = 0
152
/**
153
 * AFib was detected in the heart rhythm analysis.
154
 */
155
export type Positive = 1
156
/**
157
 * The heart rhythm analysis couldn't determine whether AFib was present or absent.
158
 */
159
export type Inconclusive = 2
160
/**
161
 * User's afib classification throught the day.
162
 */
163
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasAFibFlagYaml1 =
164
	| Negative1
165
	| Positive1
166
	| Inconclusive1
167
/**
168
 * AFib was not detected in the heart rhythm analysis.
169
 */
170
export type Negative1 = 0
171
/**
172
 * AFib was detected in the heart rhythm analysis.
173
 */
174
export type Positive1 = 1
175
/**
176
 * The heart rhythm analysis couldn't determine whether AFib was present or absent.
177
 */
178
export type Inconclusive1 = 2
179
/**
180
 * Represents the context in which heart rate was measured.
181
 */
182
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateContextYaml =
183
	NotSet | Active | NotActive
184
/**
185
 * Heart rate measurement context is not specified.
186
 */
187
export type NotSet = 0
188
/**
189
 * Heart rate was measured during physical activity or exercise.
190
 */
191
export type Active = 1
192
/**
193
 * Heart rate was measured during rest or non-active periods.
194
 */
195
export type NotActive = 2
196
/**
197
 * Heart rate zone designation
198
 */
199
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateZoneYaml =
200
	| Zone0
201
	| Zone1
202
	| Zone2
203
	| Zone3
204
	| Zone4
205
	| Zone5
206
	| Other
207
/**
208
 * Resting heart rate zone.
209
 */
210
export type Zone0 = 0
211
/**
212
 * Very light activity zone.
213
 */
214
export type Zone1 = 1
215
/**
216
 * Light activity zone.
217
 */
218
export type Zone2 = 2
219
/**
220
 * Moderate activity zone.
221
 */
222
export type Zone3 = 3
223
/**
224
 * Hard activity zone.
225
 */
226
export type Zone4 = 4
227
/**
228
 * Maximum effort zone.
229
 */
230
export type Zone5 = 5
231
/**
232
 * Heart rate zone that doesn't fit into the standard zones or couldn't be classified.
233
 */
234
export type Other = 6
235
/**
236
 * Flag indicating the ketone sample type (e.g. blood, breath, urine)
237
 */
238
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasKetoneSampleTypeYaml =
239
	Unknown | Blood | Urine | Breath
240
/**
241
 * The type of ketone sample is unknown or not specified.
242
 */
243
export type Unknown = 0
244
/**
245
 * Ketone sample taken from blood.
246
 */
247
export type Blood = 1
248
/**
249
 * Ketone sample taken from urine.
250
 */
251
export type Urine = 2
252
/**
253
 * Ketone sample taken from breath.
254
 */
255
export type Breath = 3
256
/**
257
 * Indicates whether the timestamps in this payload are localized (LOCAL) or in UTC.
258
 */
259
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTimestampLocalizationYaml =
260
	0 | 1
261
/**
262
 * Type of oxygen saturation measurement (i.e. blood vs muscle)
263
 */
264
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasOxygenSaturationTypeYaml =
265
	Blood1 | Muscle
266
/**
267
 * Oxygen saturation measurement for blood.
268
 */
269
export type Blood1 = 0
270
/**
271
 * Oxygen saturation measurement for muscle.
272
 */
273
export type Muscle = 1
274
/**
275
 * Flag indicating state of user's blood glucose level
276
 */
277
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasGlucoseFlagYaml =
278
	| Normal
279
	| High
280
	| Low
281
/**
282
 * Blood glucose level is within the normal/healthy range.
283
 */
284
export type Normal = 0
285
/**
286
 * Blood glucose level is above the normal range (hyperglycemia).
287
 */
288
export type High = 1
289
/**
290
 * Blood glucose level is below the normal range (hypoglycemia).
291
 */
292
export type Low = 2
293
/**
294
 * Flag indicating the current trend in the user's blood glucose level (e.g. rising, constant, falling)
295
 */
296
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTrendArrowYaml =
297
	| Unknown1
298
	| FallingQuickly
299
	| Falling
300
	| Flat
301
	| Rising
302
	| RisingQuickly
303
/**
304
 * Glucose trend cannot be determined.
305
 */
306
export type Unknown1 = 0
307
/**
308
 * Glucose level is decreasing rapidly.
309
 */
310
export type FallingQuickly = 1
311
/**
312
 * Glucose level is decreasing gradually.
313
 */
314
export type Falling = 2
315
/**
316
 * Glucose level is remaining stable.
317
 */
318
export type Flat = 3
319
/**
320
 * Glucose level is increasing gradually.
321
 */
322
export type Rising = 4
323
/**
324
 * Glucose level is increasing rapidly.
325
 */
326
export type RisingQuickly = 5
327
/**
328
 * Flag indicating state of user's blood glucose level
329
 */
330
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasGlucoseFlagYaml1 =
331
	| Normal1
332
	| High1
333
	| Low1
334
/**
335
 * Blood glucose level is within the normal/healthy range.
336
 */
337
export type Normal1 = 0
338
/**
339
 * Blood glucose level is above the normal range (hyperglycemia).
340
 */
341
export type High1 = 1
342
/**
343
 * Blood glucose level is below the normal range (hypoglycemia).
344
 */
345
export type Low1 = 2
346
/**
347
 * Flag indicating the current trend in the user's blood glucose level (e.g. rising, constant, falling)
348
 */
349
export type HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTrendArrowYaml1 =
350
	| Unknown2
351
	| FallingQuickly1
352
	| Falling1
353
	| Flat1
354
	| Rising1
355
	| RisingQuickly1
356
/**
357
 * Glucose trend cannot be determined.
358
 */
359
export type Unknown2 = 0
360
/**
361
 * Glucose level is decreasing rapidly.
362
 */
363
export type FallingQuickly1 = 1
364
/**
365
 * Glucose level is decreasing gradually.
366
 */
367
export type Falling1 = 2
368
/**
369
 * Glucose level is remaining stable.
370
 */
371
export type Flat1 = 3
372
/**
373
 * Glucose level is increasing gradually.
374
 */
375
export type Rising1 = 4
376
/**
377
 * Glucose level is increasing rapidly.
378
 */
379
export type RisingQuickly1 = 5
380

381
export interface Body {
382
	/**
383
	 * Body measurement metrics to post to data provider
384
	 */
385
	data: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasBodyYaml[]
386
	[k: string]: unknown
387
}
388
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasBodyYaml {
389
	blood_pressure_data?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasBloodPressureDataYaml
390
	device_data?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasDeviceDataYaml
391
	heart_data?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartDataYaml
392
	hydration_data?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHydrationDataYaml
393
	ketone_data?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasKetoneDataYaml
394
	measurements_data?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasMeasurementsDataYaml
395
	metadata: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasBodyMetadataYaml
396
	oxygen_data?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasOxygenDataYaml
397
	temperature_data?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTemperatureDataYaml
398
	glucose_data?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasGlucoseDataYaml
399
	[k: string]: unknown
400
}
401
/**
402
 * Object containing information on user's Blood Pressure.
403
 */
404
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasBloodPressureDataYaml {
405
	/**
406
	 * List of Blood Pressure measurements sampled throughout the day.
407
	 */
408
	blood_pressure_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasBloodPressureSampleYaml[]
409
	[k: string]: unknown
410
}
411
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasBloodPressureSampleYaml {
412
	/**
413
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
414
	 */
415
	timestamp?: string
416
	/**
417
	 * User's diastolic blood pressure, in mmHg
418
	 */
419
	diastolic_bp?: number
420
	/**
421
	 * User's systolic blood pressure, in mmHg
422
	 */
423
	systolic_bp?: number
424
	[k: string]: unknown
425
}
426
/**
427
 * Object containing information on the device which recorded data for the payload.
428
 */
429
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasDeviceDataYaml {
430
	/**
431
	 * Activation timestamp of the device, if applicable.
432
	 */
433
	activation_timestamp?: string
434
	/**
435
	 * Data provided by the device, as enumerated types.
436
	 */
437
	data_provided?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasDeviceDataTypeYaml[]
438
	/**
439
	 * Hardware version of the device.
440
	 */
441
	hardware_version?: string
442
	/**
443
	 * Last upload date from the device.
444
	 */
445
	last_upload_date?: string
446
	/**
447
	 * Device manufacturer name.
448
	 */
449
	manufacturer?: string
450
	/**
451
	 * Device name - note that this can also be the name of the application/package which the data comes from, if coming from a data aggregator such as Google Fit.
452
	 */
453
	name?: string
454
	/**
455
	 * Data pertaining to other devices which may have contributed data for this workout.
456
	 */
457
	other_devices?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasOtherDeviceDataYaml[]
458
	/**
459
	 * Sensor state of the device.
460
	 */
461
	sensor_state?: string
462
	/**
463
	 * Device Serial Number.
464
	 */
465
	serial_number?: string
466
	/**
467
	 * Device Software Version.
468
	 */
469
	software_version?: string
470
	[k: string]: unknown
471
}
472
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasOtherDeviceDataYaml {
473
	/**
474
	 * Device manufacturer name.
475
	 */
476
	manufacturer?: string
477
	/**
478
	 * Hardware version of the device.
479
	 */
480
	hardware_version?: string
481
	/**
482
	 * Device Serial Number.
483
	 */
484
	serial_number?: string
485
	/**
486
	 * Device name - note that this can also be the name of the application/package which the data comes from, if coming from a data aggregator such as Google Fit.
487
	 */
488
	name?: string
489
	/**
490
	 * Device Software Version.
491
	 */
492
	software_version?: string
493
	activation_timestamp?: string
494
	data_provided?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasDeviceDataTypeYaml1[]
495
	last_upload_date?: string
496
	[k: string]: unknown
497
}
498
/**
499
 * Object containing information on user's heart metrics.
500
 */
501
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartDataYaml {
502
	/**
503
	 * List of Atrial Fibrillation classification measurements sampled through the day.
504
	 */
505
	afib_classification_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasAFibClassificationSampleYaml[]
506
	/**
507
	 * List of ECGReadings sampled through the day.
508
	 */
509
	ecg_signal?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasECGReadingYaml[]
510
	heart_rate_data?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateDataYaml
511
	/**
512
	 * List of Pulse Wave Velocity measurements sampled throughout the day. This represents a measurement of arterial stiffness that is an independent predictor of cardiovascular risk.
513
	 */
514
	pulse_wave_velocity_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasPulseVelocitySampleYaml[]
515
	/**
516
	 * List of RR Interval samples throughout the day.
517
	 */
518
	rr_interval_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasRRIntervalSampleYaml[]
519
	[k: string]: unknown
520
}
521
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasAFibClassificationSampleYaml {
522
	/**
523
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
524
	 */
525
	timestamp?: string
526
	afib_classification?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasAFibFlagYaml
527
	[k: string]: unknown
528
}
529
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasECGReadingYaml {
530
	/**
531
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
532
	 */
533
	start_timestamp?: string
534
	/**
535
	 * User's average heart rate throughout the day, in beats per minute (bpm).
536
	 */
537
	avg_hr_bpm?: number
538
	afib_classification?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasAFibFlagYaml1
539
	/**
540
	 * List of raw ECG readings sampled through the day.
541
	 */
542
	raw_signal?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasRawECGSampleYaml[]
543
	[k: string]: unknown
544
}
545
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasRawECGSampleYaml {
546
	/**
547
	 * Potential uV in the RawECG Sample
548
	 */
549
	potential_uV?: number
550
	/**
551
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
552
	 */
553
	timestamp?: string
554
	[k: string]: unknown
555
}
556
/**
557
 * Object containing heart rate data.
558
 */
559
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateDataYaml {
560
	detailed?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateDataDetailedYaml
561
	summary?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateDataSummaryYaml
562
	[k: string]: unknown
563
}
564
/**
565
 * Object containing detailed heart rate information for the associated workout.
566
 */
567
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateDataDetailedYaml {
568
	/**
569
	 * Array of HeartRate data samples recorded for the user during the workout.
570
	 */
571
	hr_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateDataSampleYaml[]
572
	/**
573
	 * Array of HeartRate Variability data samples recorded for the user during the workout, computed using RMSSD.
574
	 */
575
	hrv_samples_rmssd?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateVariabilityDataSampleRMSSDYaml[]
576
	/**
577
	 * Array of HeartRate Variability data samples recorded for the user during the workout, computed using SDNN.
578
	 */
579
	hrv_samples_sdnn?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateVariabilityDataSampleSDNNYaml[]
580
	[k: string]: unknown
581
}
582
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateDataSampleYaml {
583
	/**
584
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
585
	 */
586
	timestamp?: string
587
	/**
588
	 * User's heart rate in bpm
589
	 */
590
	bpm?: number
591
	/**
592
	 * Time elapsed since the start of the workout, subtracting time during which the recording was paused
593
	 */
594
	timer_duration_seconds?: number
595
	context?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateContextYaml
596
	[k: string]: unknown
597
}
598
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateVariabilityDataSampleRMSSDYaml {
599
	/**
600
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
601
	 */
602
	timestamp?: string
603
	/**
604
	 * User's Heart Rate Variability, computed using RMSSD
605
	 */
606
	hrv_rmssd?: number
607
	[k: string]: unknown
608
}
609
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateVariabilityDataSampleSDNNYaml {
610
	/**
611
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
612
	 */
613
	timestamp?: string
614
	/**
615
	 * User's Heart Rate Variability, computed using SDNN
616
	 */
617
	hrv_sdnn?: number
618
	[k: string]: unknown
619
}
620
/**
621
 * Object containing summary heart rate information for the associated workout.
622
 */
623
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateDataSummaryYaml {
624
	/**
625
	 * Average HeartRate of the user during the workout.
626
	 */
627
	avg_hr_bpm?: number
628
	/**
629
	 * Average HeartRate Variability of the user during the workout, computed using RMSSD.
630
	 */
631
	avg_hrv_rmssd?: number
632
	/**
633
	 * Average HeartRate Variability of the user during the workout, computed using SDNN.
634
	 */
635
	avg_hrv_sdnn?: number
636
	/**
637
	 * Array of time spent in various HR zones throughout the workout.
638
	 */
639
	hr_zone_data?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateZoneDataYaml[]
640
	/**
641
	 * Maximum HeartRate of the user during the workout.
642
	 */
643
	max_hr_bpm?: number
644
	/**
645
	 * Minimum HeartRate of the user during the workout.
646
	 */
647
	min_hr_bpm?: number
648
	/**
649
	 * Resting HeartRate of the user, as determined by the fitness data provider.
650
	 */
651
	resting_hr_bpm?: number
652
	/**
653
	 * User's maximum HeartRate based on their age, and other factors as determined by the fitness data provider.
654
	 */
655
	user_max_hr_bpm?: number
656
	[k: string]: unknown
657
}
658
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateZoneDataYaml {
659
	zone?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHeartRateZoneYaml
660
	/**
661
	 * Start percentage (based off user's max HR) of the HR zone
662
	 */
663
	start_percentage?: number
664
	/**
665
	 * End percentage (based off user's max HR) of the HR zone
666
	 */
667
	end_percentage?: number
668
	/**
669
	 * Name of the associated heart rate zone
670
	 */
671
	name?: string
672
	/**
673
	 * Duration spent in the heart rate zone
674
	 */
675
	duration_seconds?: number
676
	[k: string]: unknown
677
}
678
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasPulseVelocitySampleYaml {
679
	/**
680
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
681
	 */
682
	timestamp?: string
683
	/**
684
	 * User's Pulse Wave Velocity measurement - velocity at which the blood pressure pulse propagates through the circulatory system
685
	 */
686
	pulse_wave_velocity_meters_per_second?: number
687
	[k: string]: unknown
688
}
689
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasRRIntervalSampleYaml {
690
	/**
691
	 * User's RR Interval for a specific heart beat in milliseconds.
692
	 */
693
	rr_interval_ms?: number
694
	/**
695
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
696
	 */
697
	timestamp?: string
698
	/**
699
	 * The heart beat value at that specific instance.
700
	 */
701
	hr_bpm?: number
702
	[k: string]: unknown
703
}
704
/**
705
 * Object containing information on user's hydration (both internal & consumption of water) for the day.
706
 */
707
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHydrationDataYaml {
708
	/**
709
	 * User's total water consumption throughout the day.
710
	 */
711
	day_total_water_consumption_ml?: number
712
	/**
713
	 * User's hydration level samples throughout the day.
714
	 */
715
	hydration_amount_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHydrationMeasurementSampleYaml[]
716
	[k: string]: unknown
717
}
718
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasHydrationMeasurementSampleYaml {
719
	/**
720
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
721
	 */
722
	timestamp?: string
723
	/**
724
	 * Total body water composition of the user, in kilograms.
725
	 */
726
	hydration_kg?: number
727
	[k: string]: unknown
728
}
729
/**
730
 * Object containing information on user's ketone data for the day.
731
 */
732
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasKetoneDataYaml {
733
	/**
734
	 * List of ketone data sampled through the day.
735
	 */
736
	ketone_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasKetoneSampleYaml[]
737
	[k: string]: unknown
738
}
739
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasKetoneSampleYaml {
740
	/**
741
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
742
	 */
743
	timestamp?: string
744
	/**
745
	 * Ketone in mg per dL
746
	 */
747
	ketone_mg_per_dL?: number
748
	sample_type?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasKetoneSampleTypeYaml
749
	[k: string]: unknown
750
}
751
/**
752
 * Object containing information on body measurements for the day.
753
 */
754
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasMeasurementsDataYaml {
755
	/**
756
	 * List of body metrics & measurements taken throughout the associated day.
757
	 */
758
	measurements?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasMeasurementDataSampleYaml[]
759
	[k: string]: unknown
760
}
761
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasMeasurementDataSampleYaml {
762
	/**
763
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
764
	 */
765
	measurement_time?: string
766
	/**
767
	 * User's Body Mass Index (BMI).
768
	 */
769
	BMI?: number
770
	/**
771
	 * User's Basal Metabolic Rate - minimum amount of calories that a person's body needs to perform necessary functions.
772
	 */
773
	BMR?: number
774
	/**
775
	 * User's Resting Metabolic Rate - amount of energy that a person's body needs to function while at rest. RMR accounts for additional low-effort daily activities on top of basic body functions.
776
	 */
777
	RMR?: number
778
	/**
779
	 * Estimate of how fit the user is compared to their actual age, as measured by the device.
780
	 */
781
	estimated_fitness_age?: string
782
	/**
783
	 * User's skin fold measurement.
784
	 */
785
	skin_fold_mm?: number
786
	/**
787
	 * User's body fat percentage.
788
	 */
789
	bodyfat_percentage?: number
790
	/**
791
	 * User's body weight.
792
	 */
793
	weight_kg?: number
794
	/**
795
	 * User's height.
796
	 */
797
	height_cm?: number
798
	/**
799
	 * User's total bone mass.
800
	 */
801
	bone_mass_g?: number
802
	/**
803
	 * User's total muscle mass (i.e. skeletal muscle mass).
804
	 */
805
	muscle_mass_g?: number
806
	/**
807
	 * Total lean mass of the user - calculated as the difference between total body weight and body fat weight.
808
	 */
809
	lean_mass_g?: number
810
	/**
811
	 * Total amount of fluid in the user's body.
812
	 */
813
	water_percentage?: number
814
	/**
815
	 * Quantity of insulin administered to the user.
816
	 */
817
	insulin_units?: number
818
	/**
819
	 * Type of insulin administered to the user.
820
	 */
821
	insulin_type?: string
822
	/**
823
	 * Color of the user's urine.
824
	 */
825
	urine_color?: string
826
	/**
827
	 * User notes associated with the measurement.
828
	 */
829
	user_notes?: string
830
	[k: string]: unknown
831
}
832
/**
833
 * Object containing daily summary metadata.
834
 */
835
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasBodyMetadataYaml {
836
	/**
837
	 * The end time of the associated day, in ISO8601 format with microsecond precision. Will always fall on midnight of any given day, and will always be equal to 24h after start_time. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
838
	 */
839
	end_time: string
840
	/**
841
	 * The start time of the associated day, in ISO8601 format with microsecond precision. Will always fall on midnight of any given day, and will always be equal to 24h before end_time. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
842
	 */
843
	start_time: string
844
	timestamp_localization?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTimestampLocalizationYaml
845
	[k: string]: unknown
846
}
847
/**
848
 * Object containing information on user's oxygen-related data.
849
 */
850
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasOxygenDataYaml {
851
	/**
852
	 * Average Oxygen Saturation percentage of the user during the day (SpO2 or SmO2).
853
	 */
854
	avg_saturation_percentage?: number
855
	/**
856
	 * Array of Oxygen Saturation percentage datapoints sampled throughout the day.
857
	 */
858
	saturation_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasOxygenSaturationSampleYaml[]
859
	/**
860
	 * Array of VO2 datapoints sampled throughout the day.
861
	 */
862
	vo2_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasVo2MaxSampleYaml[]
863
	/**
864
	 * VO2Max for the given user.
865
	 */
866
	vo2max_ml_per_min_per_kg?: number
867
	[k: string]: unknown
868
}
869
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasOxygenSaturationSampleYaml {
870
	/**
871
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
872
	 */
873
	timestamp?: string
874
	/**
875
	 * User's oxygen saturation percentage - referring to either SpO2 or SmO2, based on the `type` field
876
	 */
877
	percentage?: number
878
	type?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasOxygenSaturationTypeYaml
879
	[k: string]: unknown
880
}
881
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasVo2MaxSampleYaml {
882
	/**
883
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
884
	 */
885
	timestamp?: string
886
	/**
887
	 * User's VO2Max - maximum amount of oxygen the user's body can utilize during exercise
888
	 */
889
	vo2max_ml_per_min_per_kg?: number
890
	[k: string]: unknown
891
}
892
/**
893
 * Object containing temperature information (core, skin, ambient) during the day.
894
 */
895
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTemperatureDataYaml {
896
	/**
897
	 * List of ambient temperature measurements sampled throughout the day.
898
	 */
899
	ambient_temperature_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTemperatureSampleYaml[]
900
	/**
901
	 * List of body temperature measurements sampled throughout the day.
902
	 */
903
	body_temperature_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTemperatureSampleYaml1[]
904
	/**
905
	 * List of skin temperature measurements sampled throughout the day.
906
	 */
907
	skin_temperature_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTemperatureSampleYaml2[]
908
	[k: string]: unknown
909
}
910
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTemperatureSampleYaml {
911
	/**
912
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
913
	 */
914
	timestamp?: string
915
	/**
916
	 * Temperature value in degrees Celsius.
917
	 */
918
	temperature_celsius?: number
919
	[k: string]: unknown
920
}
921
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTemperatureSampleYaml1 {
922
	/**
923
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
924
	 */
925
	timestamp?: string
926
	/**
927
	 * Temperature value in degrees Celsius.
928
	 */
929
	temperature_celsius?: number
930
	[k: string]: unknown
931
}
932
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTemperatureSampleYaml2 {
933
	/**
934
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
935
	 */
936
	timestamp?: string
937
	/**
938
	 * Temperature value in degrees Celsius.
939
	 */
940
	temperature_celsius?: number
941
	[k: string]: unknown
942
}
943
/**
944
 * Object containing information on user's blood glucose for the day.
945
 */
946
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasGlucoseDataYaml {
947
	/**
948
	 * List of blood glucose readings sampled throughout the day.
949
	 */
950
	blood_glucose_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasGlucoseDataSampleYaml[]
951
	/**
952
	 * List of blood glucose readings sampled throughout the day - this represents additional data points, potentially at higher frequency from the ones in blood_glucose_samples, which may come at a cost of reduced accuracy.
953
	 */
954
	detailed_blood_glucose_samples?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasGlucoseDataSampleYaml1[]
955
	/**
956
	 * User's average glucose level throughout the day.
957
	 */
958
	day_avg_blood_glucose_mg_per_dL?: number
959
	/**
960
	 * GMI (Glucose Management Indicator) is a metric derived from continuous glucose monitoring (CGM) data that estimates average glucose levels to help guide diabetes management, without implying a precise match to laboratory A1C.
961
	 */
962
	gmi?: number
963
	/**
964
	 * Time that the user's glucose is within acceptable range (not hyper or hypoglycemic).
965
	 */
966
	time_in_range?: number
967
	/**
968
	 * Number of data points recorded by the sensor throughout the day.
969
	 */
970
	sensor_usage?: number
971
	/**
972
	 * List of glucose percentile samples throughout the day.
973
	 */
974
	daily_patterns?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasDailyPatternSampleYaml[]
975
	[k: string]: unknown
976
}
977
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasGlucoseDataSampleYaml {
978
	/**
979
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
980
	 */
981
	timestamp?: string
982
	/**
983
	 * User's blood glucose reading
984
	 */
985
	blood_glucose_mg_per_dL?: number
986
	glucose_level_flag?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasGlucoseFlagYaml
987
	trend_arrow?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTrendArrowYaml
988
	[k: string]: unknown
989
}
990
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasGlucoseDataSampleYaml1 {
991
	/**
992
	 * Time with which the record is associated, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time.
993
	 */
994
	timestamp?: string
995
	/**
996
	 * User's blood glucose reading
997
	 */
998
	blood_glucose_mg_per_dL?: number
999
	glucose_level_flag?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasGlucoseFlagYaml1
1000
	trend_arrow?: HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasTrendArrowYaml1
1001
	[k: string]: unknown
1002
}
1003
export interface HttpsRawGithubusercontentComTryterraOpenapiRefsHeadsV5UpdateSchemasDailyPatternSampleYaml {
1004
	/**
1005
	 * Hour of the day, represented as an integer from 0 to 23, where 0 is midnight and 23 is the hour before the next midnight.
1006
	 */
1007
	time_from_midnight?: number
1008
	/**
1009
	 * Percentile 5 of the glucose level at the given time of day.
1010
	 */
1011
	percentile_5?: number
1012
	/**
1013
	 * Percentile 25 of the glucose level at the given time of day.
1014
	 */
1015
	percentile_25?: number
1016
	/**
1017
	 * Percentile 50 of the glucose level at the given time of day.
1018
	 */
1019
	percentile_50?: number
1020
	/**
1021
	 * Percentile 75 of the glucose level at the given time of day.
1022
	 */
1023
	percentile_75?: number
1024
	/**
1025
	 * Percentile 95 of the glucose level at the given time of day.
1026
	 */
1027
	percentile_95?: number
1028
	[k: string]: unknown
1029
}
1030