---
url: /docs/api/core/variables/healthExtensionPayloadSchema.md
---
[**@kaiord/core**](../README.md)

***

[@kaiord/core](../README.md) / healthExtensionPayloadSchema

# Variable: healthExtensionPayloadSchema

> `const` **healthExtensionPayloadSchema**: `ZodDiscriminatedUnion`<\[`ZodObject`<{ `endTime`: `ZodISODateTime`; `externalId`: `ZodOptional`<`ZodString`>; `kaiordRecordId`: `ZodOptional`<`ZodString`>; `kind`: `ZodLiteral`<`"sleep"`>; `restingHeartRate`: `ZodOptional`<`ZodNumber`>; `score`: `ZodOptional`<`ZodNumber`>; `sourceBridgeId`: `ZodOptional`<`ZodString`>; `stages`: `ZodArray`<`ZodObject`<{ `durationSeconds`: `ZodNumber`; `stage`: `ZodEnum`<{ `awake`: `"awake"`; `deep`: `"deep"`; `light`: `"light"`; `rem`: `"rem"`; }>; `startTime`: `ZodISODateTime`; }, `$strip`>>; `startTime`: `ZodISODateTime`; `totalDurationSeconds`: `ZodOptional`<`ZodNumber`>; `version`: `ZodString`; }, `$strip`>, `ZodObject`<{ `externalId`: `ZodOptional`<`ZodString`>; `kaiordRecordId`: `ZodOptional`<`ZodString`>; `kind`: `ZodLiteral`<`"weight"`>; `measuredAt`: `ZodISODateTime`; `sourceBridgeId`: `ZodOptional`<`ZodString`>; `version`: `ZodString`; `weightKilograms`: `ZodNumber`; }, `$strip`>, `ZodObject`<{ `externalId`: `ZodOptional`<`ZodString`>; `kaiordRecordId`: `ZodOptional`<`ZodString`>; `kind`: `ZodLiteral`<`"hrv"`>; `measuredAt`: `ZodISODateTime`; `measurementWindow`: `ZodEnum`<{ `overnight`: `"overnight"`; `spot`: `"spot"`; }>; `rMSSD`: `ZodNumber`; `score`: `ZodOptional`<`ZodNumber`>; `sourceBridgeId`: `ZodOptional`<`ZodString`>; `version`: `ZodString`; }, `$strip`>], `"kind"`>

Defined in: [packages/core/src/domain/schemas/health/index.ts:22](https://github.com/pablo-albaladejo/kaiord/blob/3eacbe62ef72342d970523967cc5155b5935bb85/packages/core/src/domain/schemas/health/index.ts#L22)

Tagged discriminated union of the health-metric payloads carried under
`extensions.health.<metric>` in KRD v2.0: the six bidirectional FIT-core
types plus the read-only wearable-session metrics `strain`, `vitals`, and
`heart-rate-series`.

The `kind` discriminator selects the variant; sub-schemas validate
their own per-metric invariants.
