openapi: 3.1.0 info: description: | The Terra API (v2 surface, served at access.tryterra.co/api/v2). Protected product operations require a current product entitlement in addition to valid credentials and token scopes. Missing access returns HTTP 403 with code entitlement_required; disabled environments return environment_disabled. Unavailable current authorization returns HTTP 503 with code authorization_unavailable. Billing, configuration and recovery remain available under their existing permissions. Completed Health Scores stay with the caller's own authorized data. Pass recipients require their own Health Scores entitlement; otherwise enrichment fields retain null values. New score computation requires Health Scores access. Retained lab reports remain readable through the report endpoints with valid credentials and ownership, without a current Lab Reports entitlement. New uploads and reprocessing require it. title: TerraAPI version: 2026.10.01 license: name: Apache-2.0 url: https://github.com/tryterra/openapi/blob/master/LICENSE termsOfService: https://tryterra.co/terms-of-service contact: name: Terra API url: https://tryterra.co/ email: dev@tryterra.co servers: - url: https://access.tryterra.co/api/v2 security: - ApiKeyAuth: [] DevID: [] paths: /auth/authenticateUser: post: summary: Generate an authentication link description: Creates a login link that allows end users to connect their fitness tracking account tags: - Authentication operationId: Authentication_AuthenticateUser parameters: - name: resource in: query description: Provider resource identifier (e.g., 'FITBIT', 'GARMIN', 'OURA'). See "Get detailed list of integrations" for available providers schema: type: string example: FITBIT required: true - name: dev-id in: header description: your developer ID required: true schema: type: string example: testingTerra requestBody: content: application/json: schema: type: object properties: language: type: string reference_id: type: string auth_success_redirect_url: type: string auth_failure_redirect_url: type: string sdk_app: type: string enum: - avengers - grip description: Which Terra reference app an APPLE_HEALTH authentication link hands the end user to. Omit to use Terra Avengers. Sending this for any other resource has no effect. required: false responses: '200': description: Returned when authentication link could be successfully generated content: application/json: schema: type: object properties: status: type: string enum: - success - error description: indicates that the request was successful example: success user_id: description: User ID for the user being created type: string example: 23dc2540-7139-44c6-8158-f81196e2cf2e auth_url: type: string description: authentication URL the user must be redirected to in order to link their account example: https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=23BBG9&scope=settings+nutrition+sleep+heartrate+electrocardiogram+weight+respiratory_rate+oxygen_saturation+profile+temperature+cardio_fitness+activity+location&state=bLqqjPie9ptwoWm6VBxHCu6JkkoWJp '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /auth/generateWidgetSession: post: summary: Generate a Terra Widget session link description: Returns a Terra Widget session with a hosted URL where the end user selects a provider and logs in. tags: - Authentication operationId: Authentication_GenerateWidgetSession requestBody: content: application/json: schema: $ref: '#/components/schemas/WidgetSessionParams' required: true responses: '200': description: Returned when authentication link could be successfully generated content: application/json: schema: type: object properties: session_id: description: Session ID for the widget authentication session type: string example: 23dc2540-7139-44c6-8158-f81196e2cf2e url: type: string description: the widget URL the user must be redirected to in order to link their account example: https://widget.tryterra.co/session/344d475f-296a-489a-a88c-54183671dafd status: type: string enum: - success - error description: indicates that the request was successful (value is success) example: success expires_in: type: number description: a number in seconds depicting how long the url is valid for example: 900 '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '410': description: Returned for Terra accounts created after the widget relaunch (2026-09-03) — this endpoint is deprecated for them. Create widget sessions with POST https://access.tryterra.co/api/widget/session instead. The response carries Deprecation and Link (rel="deprecation") headers. content: application/json: schema: $ref: '#/components/schemas/Problem' '503': $ref: '#/components/responses/AuthorizationUnavailable' /auth/deauthenticateUser: delete: summary: Deauthenticate a user description: Deletes every record Terra holds for the user, including any cached data, and revokes Terra's access to their provider data. tags: - Authentication operationId: Authentication_DeauthenticateUser parameters: - name: user_id in: query description: Terra user ID (UUID format) to deauthenticate and remove from Terra system schema: type: string required: true responses: '200': description: Returned when user is successfully deauthenticated and data is deleted content: application/json: schema: type: object properties: status: enum: - success - error description: indicates that the deauthentication was successful (value is success) type: string '404': $ref: '#/components/responses/NotFound' /auth/tokens: post: tags: - Authentication summary: Generate a mobile SDK auth token description: Creates a token to be used with initConnection() functions in the Terra mobile SDKs in order to create a user record for Apple Health or Samsung Health (or equivalent) operationId: Authentication_CreateAuthToken parameters: - name: reference_id in: query description: Your identifier for the end user this token is being issued for. When supplied, the token is bound to it and redemption ignores the reference_id the SDK sends, so a token cannot be used to attach a device to a different user. Omit to keep the SDK-supplied value. required: false schema: type: string example: user-42 responses: '200': description: '200' content: application/json: examples: Result: value: status: success token: 250c68b9c21b78e40e7a3285a2d538d3bc24aabd3b4c76a782fb0a571ca4501d expires_in: 180 schema: type: object properties: status: type: string example: success token: type: string example: 250c68b9c21b78e40e7a3285a2d538d3bc24aabd3b4c76a782fb0a571ca4501d expires_in: type: integer example: 180 default: 0 '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /auth/generateAuthToken: post: tags: - Authentication summary: Generate a mobile SDK auth token (deprecated) description: Deprecated spelling of POST /auth/tokens, which it is identical to. Kept indefinitely because shipped mobile SDK versions call this path; new integrations should use POST /auth/tokens. operationId: Authentication_GenerateAuthToken parameters: - name: reference_id in: query description: Your identifier for the end user this token is being issued for. When supplied, the token is bound to it and redemption ignores the reference_id the SDK sends, so a token cannot be used to attach a device to a different user. Omit to keep the SDK-supplied value. required: false schema: type: string example: user-42 responses: '200': description: '200' content: application/json: examples: Result: value: status: success token: 250c68b9c21b78e40e7a3285a2d538d3bc24aabd3b4c76a782fb0a571ca4501d expires_in: 180 schema: type: object properties: status: type: string example: success token: type: string example: 250c68b9c21b78e40e7a3285a2d538d3bc24aabd3b4c76a782fb0a571ca4501d expires_in: type: integer example: 180 default: 0 '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' deprecated: true /activity: get: summary: Retrieve activity data description: Returns completed workout sessions, each with a defined start and end time and an activity type such as running or cycling. tags: - Activity operationId: Activity_Get parameters: - name: user_id in: query description: Terra user ID (UUID format) to retrieve data for schema: type: string required: true - name: start_date in: query description: Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit) schema: oneOf: - type: integer - type: string format: date required: true - name: end_date in: query description: End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit) schema: oneOf: - type: integer - type: string format: date required: false - name: to_webhook in: query description: | Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided) schema: type: boolean required: false - name: with_samples in: query description: | Boolean flag specifying whether to include detailed samples in the returned payload (default: false) schema: type: boolean required: false responses: '200': description: Returned upon successful data request content: application/json: schema: oneOf: - type: object properties: user: $ref: '#/components/schemas/TerraUser' data: type: array items: $ref: '#/components/schemas/Activity' type: type: - string - 'null' - $ref: '#/components/schemas/DataSentToWebhook' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /athlete: get: summary: Retrieve athlete profile description: Returns the user profile, such as first and last name, birth date and gender. tags: - Athlete operationId: Athlete_Get parameters: - name: user_id in: query description: Terra user ID (UUID format) to retrieve data for schema: type: string required: true - name: to_webhook in: query description: | Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided) schema: type: boolean required: false responses: '200': description: Returned upon successful data request content: application/json: schema: oneOf: - $ref: '#/components/schemas/AthleteCollection' - $ref: '#/components/schemas/DataSentToWebhook' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /body: get: summary: Retrieve body metrics description: Returns body metrics such as weight, height and body-fat percentage. tags: - Body operationId: Body_Get parameters: - name: user_id in: query description: Terra user ID (UUID format) to retrieve data for schema: type: string required: true - name: start_date in: query description: Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit) schema: oneOf: - type: integer - type: string format: date required: true - name: end_date in: query description: End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit) schema: oneOf: - type: integer - type: string format: date required: false - name: to_webhook in: query description: | Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided) schema: type: boolean required: false - name: with_samples in: query description: | Boolean flag specifying whether to include detailed samples in the returned payload (default: false) schema: type: boolean required: false responses: '200': description: Returned upon successful data request content: application/json: schema: oneOf: - type: object properties: user: $ref: '#/components/schemas/TerraUser' data: type: array items: $ref: '#/components/schemas/Body' type: type: - string - 'null' - $ref: '#/components/schemas/DataSentToWebhook' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /daily: get: summary: Retrieve daily summaries description: Returns daily summaries of activity metrics such as steps, distance and calories burned. tags: - Daily operationId: Daily_Get parameters: - name: user_id in: query description: Terra user ID (UUID format) to retrieve data for schema: type: string required: true - name: start_date in: query description: Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit) schema: oneOf: - type: integer - type: string format: date required: true - name: end_date in: query description: End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit) schema: oneOf: - type: integer - type: string format: date required: false - name: to_webhook in: query description: | Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided) schema: type: boolean required: false - name: with_samples in: query description: | Boolean flag specifying whether to include detailed samples in the returned payload (default: false) schema: type: boolean required: false responses: '200': description: Returned upon successful data request content: application/json: schema: oneOf: - type: object properties: user: $ref: '#/components/schemas/TerraUser' data: type: array items: $ref: '#/components/schemas/Daily' type: type: - string - 'null' - $ref: '#/components/schemas/DataSentToWebhook' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /menstruation: get: summary: Retrieve menstruation data description: Returns menstruation data such as cycle length, period length and ovulation date. tags: - Menstruation operationId: Menstruation_Get parameters: - name: user_id in: query description: Terra user ID (UUID format) to retrieve data for schema: type: string required: true - name: start_date in: query description: Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit) schema: oneOf: - type: integer - type: string format: date required: true - name: end_date in: query description: End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit) schema: oneOf: - type: integer - type: string format: date required: false - name: to_webhook in: query description: | Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided) schema: type: boolean required: false - name: with_samples in: query description: | Boolean flag specifying whether to include detailed samples in the returned payload (default: false) schema: type: boolean required: false responses: '200': description: Returned upon successful data request content: application/json: schema: oneOf: - type: object properties: user: $ref: '#/components/schemas/TerraUser' data: type: array items: $ref: '#/components/schemas/Menstruation' type: type: - string - 'null' - $ref: '#/components/schemas/DataSentToWebhook' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /nutrition: get: summary: Retrieve nutrition data description: Returns nutrition data such as meal type, calories and macronutrients. tags: - Nutrition operationId: Nutrition_Get parameters: - name: user_id in: query description: Terra user ID (UUID format) to retrieve data for schema: type: string required: true - name: start_date in: query description: Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit) schema: oneOf: - type: integer - type: string format: date required: true - name: end_date in: query description: End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit) schema: oneOf: - type: integer - type: string format: date required: false - name: to_webhook in: query description: | Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided) schema: type: boolean required: false - name: with_samples in: query description: | Boolean flag specifying whether to include detailed samples in the returned payload (default: false) schema: type: boolean required: false responses: '200': description: Returned upon successful data request content: application/json: schema: oneOf: - type: object properties: user: $ref: '#/components/schemas/TerraUser' data: type: array items: $ref: '#/components/schemas/Nutrition' type: type: - string - 'null' - $ref: '#/components/schemas/DataSentToWebhook' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /sleep: get: summary: Retrieve sleep sessions description: Returns sleep sessions, each with a defined start and end time, such as sleep duration, stages and quality. tags: - Sleep operationId: Sleep_Get parameters: - name: user_id in: query description: Terra user ID (UUID format) to retrieve data for schema: type: string required: true - name: start_date in: query description: Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit) schema: oneOf: - type: integer - type: string format: date required: true - name: end_date in: query description: End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit) schema: oneOf: - type: integer - type: string format: date required: false - name: to_webhook in: query description: | Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided) schema: type: boolean required: false - name: with_samples in: query description: | Boolean flag specifying whether to include detailed samples in the returned payload (default: false) schema: type: boolean required: false responses: '200': description: Returned upon successful data request content: application/json: schema: oneOf: - type: object properties: user: $ref: '#/components/schemas/TerraUser' data: type: array items: $ref: '#/components/schemas/Sleep' type: type: - string - 'null' - $ref: '#/components/schemas/DataSentToWebhook' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /workouts: post: tags: - Workouts summary: Create a workout template description: | Stores a reusable workout template. Plan it onto a user's calendar with `POST /workouts/{workout_id}/plan`; the template itself carries no date and is not pushed to any provider until planned. operationId: Workouts_CreateWorkout requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/WorkoutTemplate' responses: '200': description: Template stored content: application/json: schema: type: object properties: status: type: string enum: - success workout_id: type: string example: '1024' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' get: tags: - Workouts summary: List workout templates description: Returns every workout template stored for your developer account. operationId: Workouts_ListWorkouts responses: '200': description: Stored templates, each including its workout_id content: application/json: schema: type: array items: $ref: '#/components/schemas/WorkoutTemplate' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' /workouts/{workout_id}: get: tags: - Workouts summary: Get a workout template operationId: Workouts_GetWorkout parameters: - name: workout_id in: path required: true schema: type: integer format: int64 responses: '200': description: The stored template content: application/json: schema: $ref: '#/components/schemas/WorkoutTemplate' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' delete: tags: - Workouts summary: Delete a workout template description: | Deletes the template and cascades deletion of every planned workout created from it, including removal from connected providers. operationId: Workouts_DeleteWorkout parameters: - name: workout_id in: path required: true schema: type: integer format: int64 responses: '204': description: Template and all planned instances deleted '207': description: | Some provider-side deletions failed; the template is retained. Retry to complete the cascade. content: application/json: schema: type: object properties: message: type: string '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '424': description: Provider-side deletion could not be performed; retry later. content: application/problem+json: schema: $ref: '#/components/schemas/Problem' /workouts/{workout_id}/plan: post: tags: - Workouts summary: Plan a workout onto a user's calendar description: | Schedules the workout template for a user on a given date and pushes it to the user's connected provider (or queues it for SDK delivery). Athlete metrics personalise zone-based targets for this plan only. operationId: Workouts_PlanWorkout parameters: - name: workout_id in: path required: true schema: type: integer format: int64 - name: user_id in: query required: true description: Terra user ID of the connection to plan the workout for schema: type: string requestBody: required: true content: application/json: schema: type: object required: - planned_date properties: planned_date: type: string format: date description: Date to schedule the workout on (YYYY-MM-DD) ftp: type: number description: Functional Threshold Power in watts max_heart_rate: type: number description: Maximum heart rate in BPM threshold_heart_rate: type: number description: Threshold heart rate in BPM threshold_speed: type: number description: Threshold speed in m/s pool_length_meters: type: number description: Pool length in meters (overrides the template value) responses: '201': description: Planned workout created and pushed (or queued for SDK delivery) content: application/json: schema: type: object properties: status: type: string enum: - success planned_workout_id: type: string example: '2048' provider_workout_id: type: string description: Identifier assigned by the provider. Absent for SDK-delivered plans. coercion_warnings: type: string deprecated: true description: Deprecated; use warnings. Set when the template could not be represented exactly on the provider. warnings: type: array items: $ref: '#/components/schemas/CoercionWarning' description: Adjustments made when the template could not be represented exactly on the provider. Empty when the push was exact. '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': description: The Planned Workouts add-on is not enabled for this account. content: application/problem+json: schema: $ref: '#/components/schemas/Problem' '404': $ref: '#/components/responses/NotFound' '424': description: The provider rejected the workout push; retry later. content: application/problem+json: schema: $ref: '#/components/schemas/Problem' '503': $ref: '#/components/responses/AuthorizationUnavailable' /plannedWorkouts: get: tags: - Workouts summary: List planned workouts description: | Returns the user's planned workouts, including workouts created on the provider side (is_external true) where the provider exposes them. Every item carries its workout body under `template`, in the same shape for Terra-created and external workouts. External workouts are fetched live from the provider and are not stored by Terra; a workout pushed through Terra that the provider echoes back is listed once, as the Terra row. When the provider could not be read, or a template could not be loaded, the response is still 200 with the rows Terra has and carries the `X-Terra-Provider-Data-Truncated: true` header. Note that providers may limit how far ahead planned workouts are visible. operationId: Workouts_ListPlannedWorkouts parameters: - name: user_id in: query required: true schema: type: string - name: start_date in: query required: false schema: type: string format: date description: | Start of the planned-date window (YYYY-MM-DD). When start_date and end_date are omitted, provider-side workouts default to the trailing 30 days; pass an explicit window to list upcoming workouts. - name: end_date in: query required: false schema: type: string format: date description: End of the planned-date window (YYYY-MM-DD), inclusive. responses: '200': description: Planned workouts for the connection headers: X-Terra-Provider-Data-Truncated: schema: type: string enum: - 'true' description: Present when provider-side workouts could not be included; X-Terra-Provider-Fetch says why. X-Terra-Provider-Fetch: schema: type: string enum: - ok - skipped - rate_limited - unauthorized - unavailable - timeout - failed description: Outcome of the live provider read. `skipped` means the provider does not expose planned workouts or the add-on is not enabled. content: application/json: schema: type: array items: $ref: '#/components/schemas/PlannedWorkout' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /plannedWorkouts/{planned_workout_id}: get: tags: - Workouts summary: Get a planned workout description: | Returns a planned workout created through Terra. Provider-created (external) workouts are not addressable by id — they are returned by the list endpoint with their full body under `details`. operationId: Workouts_GetPlannedWorkout parameters: - name: planned_workout_id in: path required: true schema: type: integer format: int64 - name: user_id in: query required: true schema: type: string responses: '200': description: The planned workout content: application/json: schema: $ref: '#/components/schemas/PlannedWorkoutSummary' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' patch: tags: - Workouts summary: Reschedule a planned workout operationId: Workouts_UpdatePlannedWorkout parameters: - name: planned_workout_id in: path required: true schema: type: integer format: int64 - name: user_id in: query required: true schema: type: string requestBody: required: true content: application/json: schema: type: object required: - planned_date properties: planned_date: type: string format: date description: New scheduled date (YYYY-MM-DD) responses: '200': description: Updated planned workout content: application/json: schema: $ref: '#/components/schemas/PlannedWorkoutSummary' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': description: The Planned Workouts add-on is not enabled for this account. content: application/problem+json: schema: $ref: '#/components/schemas/Problem' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' delete: tags: - Workouts summary: Delete a planned workout description: Removes the planned workout from the user's calendar and from the connected provider. operationId: Workouts_DeletePlannedWorkout parameters: - name: planned_workout_id in: path required: true schema: type: integer format: int64 - name: user_id in: query required: true schema: type: string responses: '204': description: Planned workout deleted '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /userInfo: get: tags: - User operationId: User_Get description: Returns the Terra user for a given user ID, or every user registered under a given reference ID. summary: Get user info by user ID or reference ID parameters: - name: user_id in: query description: user ID to query for schema: type: string required: false - name: reference_id in: query description: reference ID to query for schema: type: string required: false responses: '200': description: Returned when the provided resources are found content: application/json: schema: oneOf: - description: User information for one connection (single User object) type: object properties: user: description: | The connection. In addition to the base User fields, this endpoint also returns polling metadata. allOf: - $ref: '#/components/schemas/TerraUser' - type: object properties: last_polled_at: type: - string - 'null' format: date-time description: Last time Terra polled the provider for this connection. example: '2024-01-20T11:00:00Z' most_recent_data_at: type: - string - 'null' format: date-time description: Timestamp of the most recent data point Terra holds for this connection. example: '2024-01-19T23:00:00Z' status: type: string enum: - success - error default: success is_authenticated: type: boolean - description: List of multiple User objects the reference_id is associated to type: array items: $ref: '#/components/schemas/TerraUser' '400': $ref: '#/components/responses/BadRequest' '404': $ref: '#/components/responses/NotFound' /subscriptions: get: tags: - User operationId: User_List description: Returns all Terra users. Supports optional pagination via `page` and `per_page`; if `page` is omitted, every user is returned in one response for backwards compatibility. summary: List all user IDs parameters: - name: page in: query required: false schema: type: integer description: Zero-based page number. If omitted, results are not paginated. example: 0 - name: per_page in: query required: false schema: type: integer description: Number of results per page (default is 500). example: 500 responses: '200': description: Returned upon a successful request content: application/json: schema: type: object description: If `page` is omitted, `users` contains every user. If `page` is provided, `results`, `max_page`, and `next` contain the paginated response. properties: status: type: string enum: - success default: success users: type: array items: $ref: '#/components/schemas/TerraUser' next: type: - integer - 'null' description: The next page number, or null if there is no next page max_page: type: integer description: Total number of pages available for the requested page size results: type: array items: $ref: '#/components/schemas/TerraUser' '400': $ref: '#/components/responses/BadRequest' /bulkUserInfo: post: tags: - User operationId: User_BatchGet description: Returns the Terra users for a batch of user IDs. summary: Get info for multiple users requestBody: content: application/json: schema: type: array description: List of user IDs to get information for items: type: string required: true responses: '200': description: Returned upon successful request content: application/json: schema: description: List of User objects type: array items: $ref: '#/components/schemas/TerraUser' '400': $ref: '#/components/responses/BadRequest' '404': $ref: '#/components/responses/NotFound' /integrations: get: summary: List available integrations tags: - Integrations operationId: Integrations_List description: Returns all provider integrations available on the API. security: [] responses: '200': description: Returns list of all available integrations on the API content: application/json: schema: type: object properties: providers: type: array items: type: string example: FITBIT sdk_providers: type: array description: Providers available through Terra's mobile SDKs rather than cloud connections items: type: string example: APPLE status: enum: - success - error type: string default: success /integrations/detailed: get: tags: - Integrations operationId: Integrations_ListDetailed summary: List integrations with details description: Returns supported integrations with details, optionally filtered to your enabled integrations and to those that require the SDK. parameters: - in: query name: sdk required: false schema: type: boolean description: If `true`, allows SDK integrations to be included in the response. responses: '200': description: Successful response containing a list of integrations. content: application/json: schema: $ref: '#/components/schemas/IntegrationsResponse' security: [] /reports: post: summary: Upload a report description: Upload a single report file (PDF, PNG, JPEG, GIF, or WebP) as multipart form data. Both clinical lab reports and DXA body-composition/bone-density scans go to this endpoint — Terra identifies which it is from the file, so there is no parameter to declare the type; read `report_type` off the session or the webhook. Returns an `upload_id`; a single upload may fan out to multiple sessions, so learn the `session_id`(s) from the webhook events or from `GET /reports?upload_id=...`. tags: - LabReports operationId: Reports_Upload parameters: - name: reference_id in: query required: false description: Your external identifier for this report or patient. schema: type: string example: patient_456 requestBody: required: true content: multipart/form-data: schema: type: object required: - file properties: file: type: string format: binary description: The lab report file (PDF, PNG, JPEG, GIF, or WebP; max 20 MB). responses: '202': description: Upload accepted for processing. content: application/json: schema: $ref: '#/components/schemas/LabReportUploadResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '413': $ref: '#/components/responses/PayloadTooLarge' '503': $ref: '#/components/responses/AuthorizationUnavailable' get: summary: List report sessions description: List report sessions for your account — both lab reports and scans — with optional reference, upload, and inclusive date-range filters. Use the date filters to narrow large result sets, and read `report_type` on each session to tell a lab panel from a scan. tags: - LabReports operationId: Reports_List parameters: - name: reference_id in: query required: false description: Filter by your external reference ID. schema: type: string - name: report_type in: query required: false description: Return only sessions of this kind. Omit for both. schema: type: string enum: - lab - dexa example: dexa - name: upload_id in: query required: false description: Filter by upload handle — returns every report from that upload. schema: type: string - name: report_date_from in: query required: false description: Lab report date lower bound (inclusive, ISO-8601 `YYYY-MM-DD`). schema: type: string format: date - name: report_date_to in: query required: false description: Lab report date upper bound (inclusive, ISO-8601 `YYYY-MM-DD`). schema: type: string format: date - name: uploaded_at_from in: query required: false description: Upload date lower bound (inclusive, ISO-8601 `YYYY-MM-DD`). schema: type: string format: date - name: uploaded_at_to in: query required: false description: Upload date upper bound (inclusive, ISO-8601 `YYYY-MM-DD`). schema: type: string format: date responses: '200': description: A list of lab report sessions. content: application/json: schema: $ref: '#/components/schemas/LabReportListResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' /reports/{session_id}: get: summary: Retrieve a lab report session description: Retrieve a report's metadata, results, reference ranges, and status history. Immutable and cacheable — presigned file URLs and mutable per-destination delivery state live on the `/files` and `/deliveries` sub-resources. tags: - LabReports operationId: Reports_Get parameters: - name: session_id in: path required: true description: The session's snowflake ID. schema: type: string example: '297405620317847552' responses: '200': description: The lab report session. content: application/json: schema: $ref: '#/components/schemas/LabReportSession' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' delete: summary: Delete a lab report session description: Soft-delete a session. It is marked deleted immediately; associated storage is cleaned up by a background process. tags: - LabReports operationId: Reports_Delete parameters: - name: session_id in: path required: true description: The session's snowflake ID. schema: type: string example: '297405620317847552' responses: '204': description: The session was deleted. '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /reports/{session_id}/deliveries: get: summary: List delivery outcomes description: The per-destination delivery state for a report. Each opted-in destination is tracked independently, so one failure never hides delivery to the others (and is why a session can be `partially_sent`). tags: - LabReports operationId: Reports_ListDeliveries parameters: - name: session_id in: path required: true description: The session's snowflake ID. schema: type: string example: '297405620317847552' responses: '200': description: Per-destination delivery outcomes. content: application/json: schema: $ref: '#/components/schemas/LabReportDeliveriesResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /reports/{session_id}/files: get: summary: List input files description: The uploaded input files and report thumbnail, with freshly minted presigned download URLs. URLs expire; fetch again to mint new ones. tags: - LabReports operationId: Reports_ListFiles parameters: - name: session_id in: path required: true description: The session's snowflake ID. schema: type: string example: '297405620317847552' responses: '200': description: Input files and thumbnail with presigned URLs. content: application/json: schema: $ref: '#/components/schemas/LabReportFilesResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /lab-reports: post: deprecated: true summary: Upload a report description: Upload a single report file (PDF, PNG, JPEG, GIF, or WebP) as multipart form data. Both clinical lab reports and DXA body-composition/bone-density scans go to this endpoint — Terra identifies which it is from the file, so there is no parameter to declare the type; read `report_type` off the session or the webhook. Returns an `upload_id`; a single upload may fan out to multiple sessions, so learn the `session_id`(s) from the webhook events or from `GET /lab-reports?upload_id=...`. tags: - LabReports operationId: LabReports_Upload parameters: - name: reference_id in: query required: false description: Your external identifier for this report or patient. schema: type: string example: patient_456 requestBody: required: true content: multipart/form-data: schema: type: object required: - file properties: file: type: string format: binary description: The lab report file (PDF, PNG, JPEG, GIF, or WebP; max 20 MB). responses: '202': description: Upload accepted for processing. content: application/json: schema: $ref: '#/components/schemas/LabReportUploadResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '413': $ref: '#/components/responses/PayloadTooLarge' '503': $ref: '#/components/responses/AuthorizationUnavailable' get: deprecated: true summary: List report sessions description: List report sessions for your account — both lab reports and scans — with optional reference, upload, and inclusive date-range filters. Use the date filters to narrow large result sets, and read `report_type` on each session to tell a lab panel from a scan. tags: - LabReports operationId: LabReports_List parameters: - name: reference_id in: query required: false description: Filter by your external reference ID. schema: type: string - name: report_type in: query required: false description: Return only sessions of this kind. Omit for both. schema: type: string enum: - lab - dexa example: dexa - name: upload_id in: query required: false description: Filter by upload handle — returns every report from that upload. schema: type: string - name: report_date_from in: query required: false description: Lab report date lower bound (inclusive, ISO-8601 `YYYY-MM-DD`). schema: type: string format: date - name: report_date_to in: query required: false description: Lab report date upper bound (inclusive, ISO-8601 `YYYY-MM-DD`). schema: type: string format: date - name: uploaded_at_from in: query required: false description: Upload date lower bound (inclusive, ISO-8601 `YYYY-MM-DD`). schema: type: string format: date - name: uploaded_at_to in: query required: false description: Upload date upper bound (inclusive, ISO-8601 `YYYY-MM-DD`). schema: type: string format: date responses: '200': description: A list of lab report sessions. content: application/json: schema: $ref: '#/components/schemas/LabReportListResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' /lab-reports/{session_id}: get: deprecated: true summary: Retrieve a lab report session description: Retrieve a report's metadata, results, reference ranges, and status history. Immutable and cacheable — presigned file URLs and mutable per-destination delivery state live on the `/files` and `/deliveries` sub-resources. tags: - LabReports operationId: LabReports_Get parameters: - name: session_id in: path required: true description: The session's snowflake ID. schema: type: string example: '297405620317847552' responses: '200': description: The lab report session. content: application/json: schema: $ref: '#/components/schemas/LabReportSession' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' delete: deprecated: true summary: Delete a lab report session description: Soft-delete a session. It is marked deleted immediately; associated storage is cleaned up by a background process. tags: - LabReports operationId: LabReports_Delete parameters: - name: session_id in: path required: true description: The session's snowflake ID. schema: type: string example: '297405620317847552' responses: '204': description: The session was deleted. '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /lab-reports/{session_id}/deliveries: get: deprecated: true summary: List delivery outcomes description: The per-destination delivery state for a report. Each opted-in destination is tracked independently, so one failure never hides delivery to the others (and is why a session can be `partially_sent`). tags: - LabReports operationId: LabReports_ListDeliveries parameters: - name: session_id in: path required: true description: The session's snowflake ID. schema: type: string example: '297405620317847552' responses: '200': description: Per-destination delivery outcomes. content: application/json: schema: $ref: '#/components/schemas/LabReportDeliveriesResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' /lab-reports/{session_id}/files: get: deprecated: true summary: List input files description: The uploaded input files and report thumbnail, with freshly minted presigned download URLs. URLs expire; fetch again to mint new ones. tags: - LabReports operationId: LabReports_ListFiles parameters: - name: session_id in: path required: true description: The session's snowflake ID. schema: type: string example: '297405620317847552' responses: '200': description: Input files and thumbnail with presigned URLs. content: application/json: schema: $ref: '#/components/schemas/LabReportFilesResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '503': $ref: '#/components/responses/AuthorizationUnavailable' webhooks: auth: post: description: Fires when a user completes or abandons connecting a provider account through Terra. The success arm (type `auth`) carries the new `user` object and your `reference_id`; the failure or cancellation arm (type `auth_cancelled`) carries no user, only a `reason` and the `reference_id`. On success, persist the user and link it to your end user through `reference_id`; on cancellation, treat it as a failed attempt with nothing to store. summary: User authentication event operationId: Webhooks_UserAuth tags: - Webhooks requestBody: content: application/json: schema: oneOf: - $ref: '#/components/schemas/AuthSuccessEvent' - $ref: '#/components/schemas/AuthErrorEvent' examples: authSuccess: summary: Successful authentication value: type: auth status: success message: User has successfully authenticated widget_session_id: 3e982b74-1a94-4d9a-b6a3-f92c6e4d21b5 user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: null scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: true authCancelled: summary: Failed or cancelled authentication value: type: auth_cancelled status: error flow_id: b2f9c611-52c8-4a63-9082-7e50e2f5a1cd reason: access_denied reference_id: your-user-123 responses: '200': description: Successful authentication response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' deauth: post: description: Fires when a user disconnects a previously connected provider account. Carries the affected `user`, identified by `user_id`. Remove that user and their stored data from your system according to your data-retention policy. summary: User deauthentication event operationId: Webhooks_UserDeauth tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/DeauthEvent' example: type: deauth status: success message: User has deauthenticated user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: false responses: '200': description: Successful deauthentication response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' user_reauth: post: description: Fires when a user re-authenticates a provider already connected under the same `reference_id`, which replaces the old connection with a new `user_id`. The payload carries both `old_user`, the record being deleted, and `new_user`, the replacement. Re-key your storage from `old_user.user_id` to `new_user.user_id` and drop the old record; a normal `auth` event is delivered for the same reconnection. summary: User reauthentication event operationId: Webhooks_UserReauth tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/UserReauthEvent' example: type: user_reauth status: warning message: User has reauthenticated and old ID has been deleted version: '2022-03-16' new_user: user_id: 9c8b7a65-4321-4fed-a0b9-87c6d5e4f321 provider: GARMIN last_webhook_update: '2026-07-02T08:03:11.204000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: true old_user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-06-28T17:40:52.118000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: false responses: '200': description: Successful reauthentication response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' access_revoked: post: description: Fires when a user revokes Terra's access from the provider's side, for example in their wearable app's settings. Carries the affected `user`. Remove the user and their stored data according to your data-retention policy. summary: Access revoked event operationId: Webhooks_AccessRevoked tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/AccessRevokedEvent' example: type: access_revoked status: warning message: User revoked access user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: false responses: '200': description: Successful access revocation response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' permission_change: post: description: 'Fires when the set of scopes a user has granted changes on the provider side. Carries the `user` with its current `scopes`, along with `scopes_added` and `scopes_removed`. Treat it as informational: it explains why some data types may later start or stop being delivered.' summary: Permission change event operationId: Webhooks_PermissionChange tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/PermissionChangeEvent' example: type: permission_change status: warning message: User permissions have been modified version: '2022-03-16' scopes_added: BODY_EXPORT scopes_removed: '' user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT,BODY_EXPORT reference_id: your-user-123 active: true responses: '200': description: Successful permission change response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' connection_error: post: description: Fires when a request to a provider returns HTTP 401, 403 or 412, meaning the stored credentials are no longer valid. Carries the affected `user`. Unlike `access_revoked`, Terra cannot tell whether the user deliberately revoked access or the failure is transient, so prompt the user to reconnect before removing their data. summary: Connection error event operationId: Webhooks_ConnectionError tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/ConnectionErrorEvent' example: type: connection_error status: warning message: 'Connection degraded: the provider rejected Terra''s access token; the user may need to reauthenticate' user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: true responses: '200': description: Successful connection error response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' large_request_sending: post: description: Fires just before Terra begins delivering the data for a large historical request of more than one month. Carries `expected_payloads`, the number of chunked data events that will follow, all sharing one `terra_reference`. Use it to track sync progress and to know when every chunk has arrived. summary: Large request sending event operationId: Webhooks_LargeRequestSending tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/LargeRequestSendingEvent' example: type: large_request_sending reference: d3f1a9c2-6b1e-4f0a-8f21-9e5b2c7a4d10 message: Large request payloads are being sent expected_payloads: 43 user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: true responses: '200': description: Successful large request sending response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' large_request_processing: post: description: Fires when you request more than one month of a user's data, acknowledging that Terra has begun assembling it. The data follows as a series of data events that share one `terra_reference`, each capped at 10 MB. Correlate the chunks back to the original request through `terra_reference`; a `large_request_sending` event announces how many will arrive. summary: Large request processing event operationId: Webhooks_LargeRequestProcessing tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/LargeRequestProcessingEvent' example: type: large_request_processing status: processing reference: d3f1a9c2-6b1e-4f0a-8f21-9e5b2c7a4d10 message: Large request is being processed; payloads will be delivered when ready user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: true responses: '200': description: Successful large request processing response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' s3_upload: post: description: Fires in place of a normal data event when a payload is too large to deliver inline, for destinations configured in ping mode. Carries a `type` of `s3_payload` and a pre-signed, time-limited `url` (valid for `expires_in` seconds) instead of the data itself. Download the JSON from `url` before it expires and process it exactly as the equivalent inline data event. summary: S3 upload event operationId: Webhooks_S3Upload tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/S3PayloadEvent' example: type: s3_payload status: success url: https://terra-payload-bucket.s3.eu-west-2.amazonaws.com/payloads/40f7b0e1/activity-2026-07-01.json?X-Amz-Signature=... expires_in: 300 responses: '200': description: Successful S3 upload response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' activity: post: description: Fires when a new completed activity is available, such as a tracked run or ride with a defined start and end. Carries a `data` array of activity sessions for the `user`. Deliveries are at-least-once, so deduplicate on `metadata.summary_id` and overwrite rather than append; on webhook destinations the newer copy carries a higher `x-terra-ordering-timestamp` header. summary: Activity event operationId: Webhooks_ActivityData tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/ActivityEvent' example: type: activity version: '2022-03-16' user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: true data: - metadata: name: Morning Run summary_id: 123e4567-e89b-12d3-a456-426614174000 start_time: '2026-07-01T07:04:11.000000+01:00' end_time: '2026-07-01T07:52:48.000000+01:00' type: 8 upload_type: 1 distance_data: summary: distance_meters: 8250.4 steps: 7902 calories_data: total_burned_calories: 512.5 net_activity_calories: 431.2 heart_rate_data: summary: avg_hr_bpm: 148.2 max_hr_bpm: 181 responses: '200': description: Successful activity response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' athlete: post: description: Fires when a user's athlete profile becomes available or changes, such as name, birth date or gender. Carries the `user` and their profile `data`. Store it against the user; unlike the time-series events there is no per-record deduplication key. summary: Athlete event operationId: Webhooks_AthleteData tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/AthleteEvent' example: type: athlete version: '2022-03-16' user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: true athlete: first_name: John last_name: Smith sex: male date_of_birth: '1991-04-12' email: john.smith@example.com city: San Francisco country: United States responses: '200': description: Successful athlete response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' nutrition: post: description: Fires when new nutrition data is available, such as logged meals, calories and macronutrients. Carries a `data` array for the `user`. Deliveries are at-least-once, so overwrite keyed on `metadata.start_time`; on webhook destinations the newer copy carries a higher `x-terra-ordering-timestamp` header. summary: Nutrition event operationId: Webhooks_NutritionData tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/NutritionEvent' example: type: nutrition version: '2022-03-16' user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: true data: - metadata: start_time: '2026-07-01T00:00:00.000000+01:00' end_time: '2026-07-02T00:00:00.000000+01:00' summary: macros: calories: 2105 protein_g: 128.4 carbohydrates_g: 231 fat_g: 71.3 water_ml: 2300 responses: '200': description: Successful nutrition response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' daily: post: description: Fires as a user's daily totals accrue, carrying the running summary up to the moment of the event, such as steps, calories and distance. Each payload is a cumulative superset for the 24-hour window identified by `metadata.start_time`, so overwrite the stored record for that date rather than appending. Deliveries are at-least-once; on webhook destinations the newer copy carries a higher `x-terra-ordering-timestamp` header. summary: Daily event operationId: Webhooks_DailyData tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/DailyEvent' example: type: daily version: '2022-03-16' user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: true data: - metadata: start_time: '2026-07-01T00:00:00.000000+01:00' end_time: '2026-07-02T00:00:00.000000+01:00' upload_type: 0 distance_data: steps: 11894 distance_meters: 9412.7 calories_data: total_burned_calories: 2450.8 active_durations_data: activity_seconds: 5340 responses: '200': description: Successful daily response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' sleep: post: description: Fires when a new sleep session is available, with a defined start and end. Carries a `data` array of sleep sessions for the `user`. Deliveries are at-least-once, so overwrite keyed on `metadata.summary_id`; on webhook destinations the newer copy carries a higher `x-terra-ordering-timestamp` header. summary: Sleep event operationId: Webhooks_SleepData tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/SleepEvent' example: type: sleep version: '2022-03-16' user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: true data: - metadata: start_time: '2026-06-30T23:12:00.000000+01:00' end_time: '2026-07-01T07:02:00.000000+01:00' is_nap: false upload_type: 1 sleep_durations_data: asleep: duration_asleep_state_seconds: 25200 duration_deep_sleep_state_seconds: 5400 duration_REM_sleep_state_seconds: 5100 awake: duration_awake_state_seconds: 1500 sleep_efficiency: 91.5 responses: '200': description: Successful sleep response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' menstruation: post: description: Fires when new menstruation data is available for a day, such as cycle phase and flow. Each payload is relevant to the 24-hour window identified by `metadata.start_time`, so overwrite the record for that date rather than appending. Deliveries are at-least-once; on webhook destinations the newer copy carries a higher `x-terra-ordering-timestamp` header. summary: Menstruation event operationId: Webhooks_MenstruationData tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/MenstruationEvent' example: type: menstruation version: '2022-03-16' user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: true data: - metadata: start_time: '2026-07-01T00:00:00.000000+01:00' end_time: '2026-07-02T00:00:00.000000+01:00' menstruation_data: period_start_date: '2026-06-28' day_in_cycle: 4 period_length_days: 5 current_phase: 1 is_predicted_cycle: false responses: '200': description: Successful menstruation response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' body: post: description: Fires when new body-metric data is available for a day, such as weight, heart rate or blood-oxygen samples. Each payload is a cumulative superset for the 24-hour window identified by `metadata.start_time`, so overwrite the stored record for that date rather than appending. Deliveries are at-least-once; on webhook destinations the newer copy carries a higher `x-terra-ordering-timestamp` header. summary: Body event operationId: Webhooks_BodyData tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/BodyEvent' example: type: body version: '2022-03-16' user: user_id: 40f7b0e1-89e2-43ac-a5b8-1e29c8d47cad provider: GARMIN last_webhook_update: '2026-07-01T09:12:33.891000+00:00' scopes: ACTIVITY_EXPORT,HEALTH_EXPORT reference_id: your-user-123 active: true data: - metadata: start_time: '2026-07-01T00:00:00.000000+01:00' end_time: '2026-07-02T00:00:00.000000+01:00' measurements_data: measurements: - measurement_time: '2026-07-01T07:55:02.000000+01:00' weight_kg: 72.4 bodyfat_percentage: 17.9 BMI: 22.6 heart_data: heart_rate_data: summary: resting_hr_bpm: 52 responses: '200': description: Successful body response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' lab_report: post: description: 'lab_report data event: sent when a report finishes processing. The same event carries both clinical lab reports and DXA body-composition/bone-density scans - branch on data.report_type, which is always present. The envelope type is lab_report.completed (normalised results delivered under data) or lab_report.failed (a terminal failure, with a structured reason). Both share the lab_report destination event type; branch on the envelope type. Unlike wearable events these are report-scoped, so they carry no user or version.' summary: Lab report event operationId: Webhooks_LabReport tags: - Webhooks requestBody: content: application/json: schema: $ref: '#/components/schemas/LabReportWebhook' examples: completed: summary: Report processed successfully value: type: lab_report.completed event_id: evt_4a2b8c1d-3f9e-4c0a-8b21-9d6e5f2a1c7b occurred_at: '2026-07-01T09:12:33Z' upload_id: upl_9d6e5f2a1c7b data: session_id: '297405620317847552' reference_id: your-patient-123 report_type: lab report_date: '2026-06-30' report_locale: en-GB results_count: 1 results: - source: name: Haemoglobin value: '14.2' units: g/dL collection_date: '2026-06-29' biomarker: key: hemoglobin display_name: Hemoglobin loinc_code: 718-7 measurement: type: numeric numeric: 14.2 units: g/dL ucum_code: g/dL interpretation: flag: normal source: report panels: [] completed_scan: summary: DXA scan processed successfully value: type: lab_report.completed event_id: evt_1b7d3e40-8a55-4f21-9c33-2e08b6d4a915 occurred_at: '2026-07-02T14:05:11Z' upload_id: upl_2e08b6d4a915 data: session_id: '297405620317847553' reference_id: your-patient-123 report_type: dexa report_date: '2026-07-02' report_locale: en-US results_count: 4 results: - source: name: BMD region_name: L1-L4 value: '1.024' units: g/cm2 biomarker: key: bmd display_name: Bone Mineral Density region: l1_l4 loinc_code: 24966-4 measurement: type: numeric numeric: 1.024 units: g/cm2 ucum_code: g/cm2 - source: name: T-score region_name: L1-L4 value: '-1.4' flag: Osteopenia biomarker: key: t_score display_name: T-score region: l1_l4 measurement: type: numeric numeric: -1.4 ucum_code: '{SD}' interpretation: flag: low flag_raw: Osteopenia source: report - source: name: Fat Mass region_name: Android value: '2431' units: g biomarker: key: fat_mass display_name: Fat Mass region: android measurement: type: numeric numeric: 2431 units: g ucum_code: g - source: name: Weight value: '78.4' units: kg biomarker: key: weight display_name: Weight measurement: type: numeric numeric: 78.4 units: kg ucum_code: kg panels: [] failed: summary: Report terminally failed value: type: lab_report.failed event_id: evt_7c1f0a92-52c8-4a63-9082-7e50e2f5a1cd occurred_at: '2026-07-01T09:15:02Z' data: session_id: '297405620317847552' reference_id: your-patient-123 error: code: file_unreadable message: The uploaded file could not be read. retriable: false responses: '200': description: Successful lab_report response '403': $ref: '#/components/responses/Forbidden' '503': $ref: '#/components/responses/AuthorizationUnavailable' components: securitySchemes: ApiKeyAuth: type: apiKey in: header name: x-api-key description: Your API key for authentication DevID: type: apiKey in: header name: dev-id description: Your developer ID for authentication and tracking responses: BadRequest: description: One or more parameters is malformed. The `detail` field describes the specific problem. content: application/problem+json: schema: $ref: '#/components/schemas/Problem' example: type: about:blank title: bad request instance: /activity detail: invalid start_date Unauthorized: description: Authentication credentials are missing or invalid. content: application/problem+json: schema: $ref: '#/components/schemas/Problem' example: type: about:blank title: unauthorized instance: /activity detail: dev-id or x-api-key headers are missing NotFound: description: A referenced resource does not exist on Terra's end. content: application/problem+json: schema: $ref: '#/components/schemas/Problem' example: type: about:blank title: not found instance: /activity detail: user not found Forbidden: description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing. content: application/problem+json: schema: $ref: '#/components/schemas/Problem' AuthorizationUnavailable: description: Current product authorization is unavailable; retry after the service recovers. content: application/problem+json: schema: $ref: '#/components/schemas/Problem' ReportNotReprocessable: description: The session is still being processed, or was cancelled or deleted. content: application/problem+json: schema: $ref: '#/components/schemas/Problem' PayloadTooLarge: description: The uploaded payload exceeds the size limit. content: application/json: schema: $ref: '#/components/schemas/Problem' schemas: WorkoutTemplate: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: name: type: string description: Name of the workout description: anyOf: - type: string - type: 'null' description: Description of the workout environment: anyOf: - $ref: '#/components/schemas/EnvironmentType' - type: 'null' pool_length_meters: anyOf: - type: number - type: 'null' description: Pool length in meters, for swim workouts step_blocks: type: array items: $ref: '#/components/schemas/StepBlock' estimated_duration_seconds: anyOf: - type: number - type: 'null' description: Estimated total duration in seconds estimated_distance_meters: anyOf: - type: number - type: 'null' description: Estimated total distance in meters estimated_calories: anyOf: - type: number - type: 'null' description: Estimated calories burned estimated_tss: anyOf: - type: number - type: 'null' description: Planned training stress score (0-9999), where the provider or author supplies one. Forwarded to TrainingPeaks, which ignores it when any step target is not RPE and derives it from the structure instead. estimated_intensity_factor: anyOf: - type: number - type: 'null' description: Planned intensity factor (0-5), where the provider or author supplies one. Forwarded to TrainingPeaks, which ignores it when any step target is not RPE and derives it from the structure instead. workout_id: anyOf: - type: string - type: 'null' description: Terra identifier of the stored template. Set by Terra in responses; ignored on create. sport: $ref: '#/components/schemas/WorkoutSport' required: - name - step_blocks - sport description: A reusable workout template, created once and planned onto user calendars PlannedWorkoutItem: $ref: '#/components/schemas/PlannedWorkout' PlannedWorkoutSummary: type: object description: Summary of a planned workout, returned by the get and reschedule operations. properties: planned_workout_id: type: string example: '2048' planned_date: type: string format: date is_external: type: boolean description: True when the workout was created on the provider side rather than through Terra. workout_id: type: string description: Identifier of the source template. Absent for external workouts. provider_workout_id: type: string description: Identifier assigned by the provider, once pushed. coercion_warnings: type: string deprecated: true description: Deprecated; use warnings. Set when the template could not be represented exactly on the provider. completed_at: anyOf: - type: string format: date-time - type: 'null' description: Time the session was reported complete by the user's device. Null until a device reports it. warnings: type: array items: $ref: '#/components/schemas/CoercionWarning' description: Adjustments made when the template could not be represented exactly on the provider. Empty when the push was exact. workout: anyOf: - $ref: '#/components/schemas/PlannedWorkoutBody' - type: 'null' description: The workout body, as on the list. Null when the planned workout has no stored template or it could not be loaded. CoercionWarning: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: path: type: string description: JSON path within the workout template of the element that could not be represented exactly message: type: string description: What was changed or dropped, and why required: - path - message description: A non-fatal adjustment made while converting a workout between Terra's template model and a provider's PlannedWorkoutBody: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: name: type: string description: Name of the workout description: anyOf: - type: string - type: 'null' description: Description of the workout environment: anyOf: - $ref: '#/components/schemas/EnvironmentType' - type: 'null' pool_length_meters: anyOf: - type: number - type: 'null' description: Pool length in meters, for swim workouts step_blocks: type: array items: $ref: '#/components/schemas/StepBlock' estimated_duration_seconds: anyOf: - type: number - type: 'null' description: Estimated total duration in seconds estimated_distance_meters: anyOf: - type: number - type: 'null' description: Estimated total distance in meters estimated_calories: anyOf: - type: number - type: 'null' description: Estimated calories burned estimated_tss: anyOf: - type: number - type: 'null' description: Planned training stress score (0-9999), where the provider or author supplies one. Forwarded to TrainingPeaks, which ignores it when any step target is not RPE and derives it from the structure instead. estimated_intensity_factor: anyOf: - type: number - type: 'null' description: Planned intensity factor (0-5), where the provider or author supplies one. Forwarded to TrainingPeaks, which ignores it when any step target is not RPE and derives it from the structure instead. workout_id: anyOf: - type: string - type: 'null' description: Terra identifier of the stored template. Set by Terra in responses; ignored on create. sport: $ref: '#/components/schemas/PlannedWorkoutSport' required: - name - step_blocks - sport description: 'The body of a planned workout: a WorkoutTemplate whose sport may be `unspecified` when it was created on the provider side' Problem: type: object description: | An error response, following RFC 9457 (Problem Details for HTTP APIs, which obsoletes RFC 7807). Returned with `Content-Type: application/problem+json` on every 4xx/5xx response. The HTTP status line carries the status code; it is intentionally not repeated in the body. `type`, `title` and `instance` are always present; `detail` is included when a specific explanation is available. properties: type: type: string description: A URI reference identifying the problem type. Defaults to `about:blank`. example: about:blank title: type: string description: A short, human-readable summary of the problem type (the lowercased HTTP status text). example: unauthorized instance: type: string description: The request path, including any query string, that produced this problem. example: /api/v2/activity?user_id=d4aba475-f714-4663-88fe-28f18b8599b0&to_webhook=false code: type: string description: Stable error classification. Product gates return entitlement_required (403), environment_disabled (403), or authorization_unavailable (503). product: type: string description: The product checked by the authorization gate, when classified. detail: type: string description: A human-readable explanation specific to this occurrence of the problem. example: dev-id or x-api-key headers are missing required: - type - title - instance WidgetSessionParams: type: object properties: providers: type: string description: Comma separated list of providers to display on the device selection page. This overrides your selected sources on your dashboard example: GARMIN,FITBIT,OURA,WITHINGS,SUUNTO language: type: string description: Display language of the widget example: en reference_id: type: string description: Identifier of the end user on your system, such as a user ID or email associated with them example: user123@email.com auth_success_redirect_url: type: string description: URL the user is redirected to upon successful authentication example: https://myapp.com/success auth_failure_redirect_url: type: string description: URL the user is redirected to upon unsuccessful authentication example: https://myapp.com/failure User: $ref: '#/components/schemas/TerraUser' DataSentToWebhook: type: object description: | Acknowledgement returned when `to_webhook` is true (the default): the requested data is fetched asynchronously and delivered to your configured destination, and this body confirms the request was accepted. properties: status: type: string enum: - success example: success type: type: string description: The data type that was requested (e.g. `activity`, `sleep`). example: activity reference: type: string description: Payload reference, tying this request to the webhook payload you will receive. example: 5a3c2540-7139-44c6-8158-f81196e2cf2e trace_id: type: string description: Trace identifier for this request (equal to `reference`). example: 5a3c2540-7139-44c6-8158-f81196e2cf2e message: type: string description: Present only for large requests (date range over one month), which are delivered in chunks. example: Large request submitted. The data is being processed and will be sent to your destination in chunks user: type: object description: Summary of the connection the data was requested for. properties: user_id: type: string example: 5a3c2540-7139-44c6-8158-f81196e2cf2e provider: type: string example: GARMIN reference_id: type: - string - 'null' example: user123@email.com created_at: type: string format: date-time example: '2024-01-15T09:30:00Z' active: type: boolean example: true scopes: type: string description: Comma-separated list of granted scopes. example: activity,sleep,daily last_webhook_update: type: - string - 'null' format: date-time example: '2024-01-20T11:00:00Z' Activity: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: active_durations_data: anyOf: - $ref: '#/components/schemas/ActiveDurationsData' - type: 'null' description: Number of minutes spent at various intensities during the workout, as reported by the Fitness Data provider. calories_data: anyOf: - $ref: '#/components/schemas/CaloriesData' - type: 'null' description: Object containing calorie-related information for the user during the specific workout. cheat_detection: anyOf: - type: number - type: 'null' examples: - 0 description: Cheat detection flag. data_enrichment: anyOf: - $ref: '#/components/schemas/DataEnrichment' - type: 'null' description: Object containing Terra Scores. device_data: anyOf: - $ref: '#/components/schemas/DeviceData' - type: 'null' description: Object containing information on the device which recorded the specific workout. distance_data: anyOf: - $ref: '#/components/schemas/DistanceData' - type: 'null' description: Object containing information related to distance covered during the associated workout. energy_data: anyOf: - $ref: '#/components/schemas/EnergyData' - type: 'null' description: Object containing information on the energy expended by the user during the workout. heart_rate_data: anyOf: - $ref: '#/components/schemas/HeartRateData' - type: 'null' description: Object containing heartrate-related information for the workout. lap_data: anyOf: - $ref: '#/components/schemas/LapData' - type: 'null' description: Object containing information on data for each lap performed by the user - mostly relates to track & field running activities, and swimming activities. MET_data: anyOf: - $ref: '#/components/schemas/METData' - type: 'null' description: Object containing information on the Metabolic Equivalent of Task for the workout. metadata: $ref: '#/components/schemas/ActivityMetadata' description: Object containing workout metadata. movement_data: anyOf: - $ref: '#/components/schemas/MovementData' - type: 'null' description: Object containing information on the user's movement throughout the workout. oxygen_data: anyOf: - $ref: '#/components/schemas/OxygenData' - type: 'null' description: Object containing information on oxygen-related metrics for the workout. polyline_map_data: anyOf: - $ref: '#/components/schemas/PolylineMapData' - type: 'null' description: Object containing polyline-representation map data, plotting the user's trajectory throughout the workout. position_data: anyOf: - $ref: '#/components/schemas/PositionData' - type: 'null' description: Object containing information on the user's position throughout the workout. strength_data: anyOf: - $ref: '#/components/schemas/ActivityStrengthData' - type: 'null' description: Object containing the sets, reps and load performed during a strength workout. Absent when the activity carries no strength content, or when the source recorded no usable set breakdown. power_data: anyOf: - $ref: '#/components/schemas/PowerData' - type: 'null' description: Object containing information on the power generated by the user during the workout. strain_data: anyOf: - $ref: '#/components/schemas/StrainData' - type: 'null' description: Object containing information on the cardiovascular strain imposed on the user during the workout. TSS_data: anyOf: - $ref: '#/components/schemas/TSSData' - type: 'null' description: Object containing information on the stress put on the user's body from a workout. work_data: anyOf: - $ref: '#/components/schemas/WorkData' - type: 'null' description: Object containing information on the work output of the user during the workout. required: - metadata Athlete: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: age: anyOf: - type: integer - type: 'null' examples: - 28 description: User's age. country: anyOf: - type: string - type: 'null' examples: - United States description: User's country of residence. bio: anyOf: - type: string - type: 'null' examples: - Passionate runner and cyclist description: User's bio - a short description they display on their profile. state: anyOf: - type: string - type: 'null' examples: - California description: User's state of residence. last_name: anyOf: - type: string - type: 'null' examples: - Smith description: User's last name. sex: anyOf: - type: string - type: 'null' examples: - male description: User's sex. city: anyOf: - type: string - type: 'null' examples: - San Francisco description: User's city of residence. email: anyOf: - type: string - type: 'null' examples: - user@example.com description: User's email. date_of_birth: anyOf: - type: string - type: 'null' examples: - '1999-11-23' description: User's date of birth, in ISO8601 format. first_name: anyOf: - type: string - type: 'null' examples: - John description: User's first name. gender: anyOf: - type: string - type: 'null' examples: - male description: User's gender. account_creation_date: anyOf: - type: string - type: 'null' examples: - '2023-01-15' description: User's account creation date with the provider, in ISO8601 format. provider_user_id: anyOf: - type: string - type: 'null' examples: - a1b2c3d4e5 description: The user's unique identifier as assigned by the data provider. AthleteCollection: type: object properties: athlete: description: Object containing the user's information type: object allOf: - $ref: '#/components/schemas/Athlete' type: type: - string - 'null' example: athlete user: description: Terra User object type: object allOf: - $ref: '#/components/schemas/TerraUser' Body: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: blood_pressure_data: anyOf: - $ref: '#/components/schemas/BloodPressureData' - type: 'null' description: Object containing information on user's Blood Pressure. device_data: anyOf: - $ref: '#/components/schemas/DeviceData' - type: 'null' description: Object containing information on the device which recorded data for the payload. heart_data: anyOf: - $ref: '#/components/schemas/HeartData' - type: 'null' description: Object containing information on user's heart metrics. hydration_data: anyOf: - $ref: '#/components/schemas/HydrationData' - type: 'null' description: Object containing information on user's hydration (both internal & consumption of water) for the day. ketone_data: anyOf: - $ref: '#/components/schemas/KetoneData' - type: 'null' description: Object containing information on user's ketone data for the day. measurements_data: anyOf: - $ref: '#/components/schemas/MeasurementsData' - type: 'null' description: Object containing information on body measurements for the day. metadata: $ref: '#/components/schemas/BodyMetadata' description: Object containing daily summary metadata. oxygen_data: anyOf: - $ref: '#/components/schemas/OxygenData' - type: 'null' description: Object containing information on user's oxygen-related data. temperature_data: anyOf: - $ref: '#/components/schemas/TemperatureData' - type: 'null' description: Object containing temperature information (core, skin, ambient) during the day. glucose_data: anyOf: - $ref: '#/components/schemas/GlucoseData' - type: 'null' description: Object containing information on user's blood glucose for the day. required: - metadata Daily: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: active_durations_data: anyOf: - $ref: '#/components/schemas/ActiveDurationsData' - type: 'null' description: Object containing information related to the time spent in different activity intensities during over the day. calories_data: anyOf: - $ref: '#/components/schemas/CaloriesData' - type: 'null' description: Object containing calorie-related information for the user during the specific day. data_enrichment: anyOf: - $ref: '#/components/schemas/DailyDataEnrichment' - type: 'null' description: Object containing additional enrichment data for the day. trends: anyOf: - $ref: '#/components/schemas/TrendsData' - type: 'null' description: Personal 30-day baselines and trends for the user as of this day (trends product). Null for customers without the product enabled. device_data: anyOf: - $ref: '#/components/schemas/DeviceData' - type: 'null' description: Object containing information on the device which recorded data for the day. distance_data: anyOf: - $ref: '#/components/schemas/DailyDistanceData' - type: 'null' description: Object containing information related to distance covered during the associated day. heart_rate_data: anyOf: - $ref: '#/components/schemas/HeartRateData' - type: 'null' description: Object containing heartrate-related information for the day. MET_data: anyOf: - $ref: '#/components/schemas/METData' - type: 'null' description: Object containing information on the Metabolic Equivalent of Task for the day. metadata: $ref: '#/components/schemas/DailyMetadata' description: Object containing daily summary metadata. oxygen_data: anyOf: - $ref: '#/components/schemas/OxygenData' - type: 'null' description: Object containing information on oxygen-related metrics for the day. scores: anyOf: - $ref: '#/components/schemas/ScoresData' - type: 'null' description: Scores for the user's performance on different metrics for the given day, as calculated by the fitness data provider. strain_data: anyOf: - $ref: '#/components/schemas/StrainData' - type: 'null' description: Object containing information on the strain put on the user's body over a day. stress_data: anyOf: - $ref: '#/components/schemas/StressData' - type: 'null' description: Object containing information on the stress put on the user over a day. tag_data: anyOf: - $ref: '#/components/schemas/TagData' - type: 'null' description: Object containing all user-entered or automatically tagged events in the day. required: - metadata Menstruation: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: metadata: $ref: '#/components/schemas/MenstruationMetadata' description: Object containing daily summary metadata. menstruation_data: anyOf: - $ref: '#/components/schemas/MenstruationData' - type: 'null' description: Object containing information on user's menstruation for a given day. required: - metadata HormoneSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: type: string examples: - '2026-05-07T08:00:00+02:00' description: ISO-8601 timestamp of the test event, including timezone offset. lh_mIU_per_ml: anyOf: - type: number - type: 'null' examples: - 5.2 description: Luteinizing hormone reading, milli-international units per millilitre. e3g_ng_per_ml: anyOf: - type: number - type: 'null' examples: - 108.5 description: Estrone-3-glucuronide reading, nanograms per millilitre. Urinary estrogen metabolite, rises before ovulation. pdg_ug_per_ml: anyOf: - type: number - type: 'null' examples: - 2.4 description: Pregnanediol glucuronide reading, micrograms per millilitre. Urinary progesterone metabolite, confirms ovulation. hcg_mIU_per_ml: anyOf: - type: number - type: 'null' examples: - 0.8 description: Human chorionic gonadotropin reading, milli-international units per millilitre. Pregnancy hormone. fsh_mIU_per_ml: anyOf: - type: number - type: 'null' examples: - 4.8 description: Follicle-stimulating hormone reading, milli-international units per millilitre. Ovarian reserve / menopause indicator. required: - timestamp Connection: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: id: type: integer examples: - 75001 description: Terra connection ID. reference_id: anyOf: - type: string - type: 'null' examples: - user_external_ref_123 description: External user identifier provided at connect time. created_at: type: string examples: - '2026-04-22T11:00:00Z' description: RFC3339 timestamp of when the connection was first authorised. provider: type: string examples: - MIRA description: Uppercase provider slug, e.g. MIRA or FITBIT. last_polled_at: anyOf: - type: string - type: 'null' description: RFC3339 timestamp of the last poll Terra ran against the provider for this connection. May be null for webhook-only flows. last_updated_at: anyOf: - type: string - type: 'null' description: RFC3339 timestamp of the last time Terra received any data from the provider for this connection. most_recent_data_at: anyOf: - type: string - type: 'null' description: RFC3339 timestamp of the most recent stored sample. May lag last_updated_at when fetches return no new data. scopes: type: array items: type: string description: Granted OAuth scopes. Empty array for providers without scopes (e.g. Mira). required: - id - created_at - provider - scopes Nutrition: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: drink_samples: anyOf: - type: array items: $ref: '#/components/schemas/DrinkSample' - type: 'null' description: Information on drinks the user consumed throughout the day. meals: anyOf: - type: array items: $ref: '#/components/schemas/Meal' - type: 'null' description: Information on individual foods consumed throughout a given day. metadata: $ref: '#/components/schemas/NutritionMetadata' description: Object containing daily summary metadata. summary: anyOf: - $ref: '#/components/schemas/NutritionSummary' - type: 'null' description: Summative nutritional information for a given day. required: - metadata Sleep: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: data_enrichment: anyOf: - $ref: '#/components/schemas/SleepDataEnrichment' - type: 'null' description: Object containing additional enrichment data for the sleep session. trends: anyOf: - $ref: '#/components/schemas/TrendsData' - type: 'null' description: Personal 30-day baselines and trends for the user as of this session (trends product). Null for customers without the product enabled. device_data: anyOf: - $ref: '#/components/schemas/DeviceData' - type: 'null' description: Object containing information on the device which recorded data for the payload. heart_rate_data: anyOf: - $ref: '#/components/schemas/HeartRateData' - type: 'null' description: Object containing information on the user's heart rate during the sleep session. metadata: $ref: '#/components/schemas/SleepMetadata' description: Object containing daily summary metadata. readiness_data: anyOf: - $ref: '#/components/schemas/ReadinessData' - type: 'null' description: Object containing information on the user's readiness for the day, based off the quality and duration of their sleep. respiration_data: anyOf: - $ref: '#/components/schemas/RespirationData' - type: 'null' description: Object containing information on the user's respiration throughout the sleep session. scores: anyOf: - $ref: '#/components/schemas/SleepScores' - type: 'null' description: Scores summarising the user's sleep session. sleep_durations_data: anyOf: - $ref: '#/components/schemas/SleepDurationsData' - type: 'null' description: Object containing information on the user's duration spent in various sleep stages. temperature_data: anyOf: - $ref: '#/components/schemas/SleepTemperatureData' - type: 'null' description: Object containing body temperature information of the user during the sleep recording session. required: - metadata UserAuthWebhook: $ref: '#/components/schemas/AuthSuccessEvent' UserAuthWebhookError: $ref: '#/components/schemas/AuthErrorEvent' PermissionChangeWebhook: $ref: '#/components/schemas/PermissionChangeEvent' UserReauthWebhook: $ref: '#/components/schemas/UserReauthEvent' UserDeauthWebhook: $ref: '#/components/schemas/DeauthEvent' AccessRevokedWebhook: $ref: '#/components/schemas/AccessRevokedEvent' ConnectionErrorWebhook: $ref: '#/components/schemas/ConnectionErrorEvent' LargeRequestSendingWebhook: $ref: '#/components/schemas/LargeRequestSendingEvent' LargeRequestProcessingResponse: $ref: '#/components/schemas/LargeRequestProcessingEvent' AuthenticationFailedWebhook: $ref: '#/components/schemas/AuthErrorEvent' S3UploadWebhook: $ref: '#/components/schemas/S3PayloadEvent' ActivityWebhook: $ref: '#/components/schemas/ActivityEvent' DailyWebhook: $ref: '#/components/schemas/DailyEvent' NutritionWebhook: $ref: '#/components/schemas/NutritionEvent' AthleteWebhook: $ref: '#/components/schemas/AthleteEvent' SleepWebhook: $ref: '#/components/schemas/SleepEvent' MenstruationWebhook: $ref: '#/components/schemas/MenstruationEvent' BodyWebhook: $ref: '#/components/schemas/BodyEvent' PlannedWorkoutWebhook: $ref: '#/components/schemas/PlannedWorkoutEvent' HormoneWebhook: $ref: '#/components/schemas/HormoneEvent' HealthObservationWebhook: $ref: '#/components/schemas/HealthObservationEvent' LabReportWebhook: oneOf: - $ref: '#/components/schemas/LabReportCompletedEvent' - $ref: '#/components/schemas/LabReportFailedEvent' IntegrationsResponse: type: object properties: status: type: string description: Status of the API response example: success providers: type: array description: List of integration providers with their details items: $ref: '#/components/schemas/IntegrationProvider' IntegrationProvider: type: object properties: provider: type: string description: Identifier for the provider example: MAPMYFITNESS name: type: string description: Display name of the integration example: MapMyFitness icon: type: string description: URL for the provider's icon image example: https://access.tryterra.co/api/v2/static/assets/img/app_icons/mapmyfitness.webp setup: type: string description: Indicates how the integration is set up example: API_KEYS_MANAGED enabled: type: boolean description: Whether the integration is enabled example: true types: type: object description: Indicates the types of data available through the provider properties: activity: type: boolean example: true body: type: boolean example: false nutrition: type: boolean example: false daily: type: boolean example: false sleep: type: boolean example: false menstruation: type: boolean example: false WebhookEvents: $ref: '#/components/schemas/WebhookEventType' LabReportUploadResponse: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: upload_id: type: string examples: - upl_4a2b8c1d description: Durable correlation key for the upload; every resulting session and webhook carries it. current_status: type: string examples: - processing description: Processing status as a clean lowercase string. required: - upload_id - current_status LabReportReprocessResponse: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: session_id: type: string examples: - '297405620317847552' current_status: type: string examples: - processing required: - session_id - current_status LabReportListResponse: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: sessions: type: array items: $ref: '#/components/schemas/LabReportSession' required: - sessions LabReportSession: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: session_id: type: string examples: - '297405620317847552' upload_id: type: string reference_id: type: string description: Your external reference; omitted if not set. report_type: $ref: '#/components/schemas/ReportType' examples: - lab description: 'What kind of report this is, as a clean lowercase string (open enum — handle unknown values gracefully). "lab" for a clinical lab report, "dexa" for a DXA body-composition or bone-density scan, "unspecified" while the report is still being classified. Switch on this before reading results: dexa results are scoped by biomarker.region, lab results by biomarker.specimen.' current_status: type: string examples: - sent description: Current status as a clean lowercase string (open enum), e.g. processing, sent, partially_sent, failed. uploaded_at: type: string format: date-time updated_at: type: string format: date-time report_date: type: string description: Date printed on the report (YYYY-MM-DD); omitted if not extracted. report_time: type: string description: Time printed on the report (HH:MM, 24-hour); omitted if not extracted. collection_date: type: string description: Date the sample was collected or the scan was taken (YYYY-MM-DD); omitted if not extracted. collection_time: type: string description: Time the sample was collected or the scan was taken (HH:MM, 24-hour); omitted if not extracted. report_locale: type: string examples: - en-GB lab_name: type: string patient_age_at_collection: type: integer description: Patient age in years; omitted if unknown. patient_sex: type: string examples: - female description: Clean lowercase string (open enum); omitted if unspecified. input_bytes: type: integer results_count: type: integer output_bytes: type: integer file_count: type: integer status_history: type: array items: $ref: '#/components/schemas/LabReportStatusEntry' results: type: array items: $ref: '#/components/schemas/LabReportResult' description: The layered biomarker results. Populated on retrieve, not on list. panels: type: array items: $ref: '#/components/schemas/LabReportPanel' description: Report-level panels that results reference by panel_id. Omitted if the report has no panel grouping. report_notes: type: string required: - session_id - report_type - current_status description: A lab report session. Returned in full on retrieve; list items carry the summary fields only (no results/panels). LabReportStatusEntry: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: status: type: string timestamp: type: string format: date-time note: type: string required: - status LabReportPanel: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: id: type: integer description: Report-local ordinal; matches LabReportBiomarker.panel_id. name: type: string description: Verbatim panel header as printed on the report. key: type: string description: Normalized dedup key (deterministic text, not a LOINC code). required: - id description: A report-level grouping that results reference by panel_id. LabReportResult: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: source: $ref: '#/components/schemas/LabReportResultSource' biomarker: $ref: '#/components/schemas/LabReportBiomarker' measurement: $ref: '#/components/schemas/LabReportMeasurement' interpretation: $ref: '#/components/schemas/LabReportInterpretation' reference_ranges: type: array items: $ref: '#/components/schemas/LabReportReferenceRange' required: - source - biomarker - measurement - interpretation description: 'One layered result: verbatim source, normalized biomarker identity, one typed measurement, and the interpretation. measurement and interpretation are byte-identical to the webhook payload.' LabReportResultSource: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: name: type: string panel: type: string value: type: string description: Raw value string as printed. units: type: string flag: type: string description: Verbatim flag; the coded form is under interpretation. method: type: string notes: type: string reference_text: type: string region_name: type: string description: Anatomical site label exactly as printed on the report, in the original language. Present whenever the report shows a site, including when no canonical region key matched. collection_date: type: string description: Date this specific measurement was taken (YYYY-MM-DD). Distinguishes a prior scan in a trend table from the current one; omitted if not shown per result. collection_time: type: string description: Time this specific measurement was taken (HH:MM, 24-hour); omitted if not shown per result. description: The verbatim provenance layer — what the report literally printed. LabReportBiomarker: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: key: anyOf: - type: string - type: 'null' description: Canonical biomarker slug, or null when unmatched — the sole no-match signal. Do not key off loinc_code, which can be null on a match. display_name: type: string loinc_code: type: string description: 'LOINC code; omitted when the matched biomarker has no LOINC mapping. On a site-scoped (DXA) result the code identifies the (measure, site) pair rather than the measure alone, because LOINC''s DXA terms are pre-coordinated — the site is baked into the term. Read it off each result; do not cache it against biomarker.key. Coverage is partial on scans: per-site body-fat percentage and the mass/lean/BMC measures have no LOINC term and omit the field.' panel_id: type: integer description: References panels[].id on the enclosing session. panel_key: type: string specimen: type: string region: $ref: '#/components/schemas/AnatomicalRegion' examples: - l1_l4 description: Canonical anatomical site key for site-scoped (DXA) reports, drawn from a closed vocabulary of ~70 members (arms, arm_left, trunk, android, gynoid, vat, l1_l4, spine_lumbar, femur_neck_left, forearm_total_right, ...). Treated as an open enum on the wire so new sites do not break existing consumers; the full list is published in the Lab Reports documentation. Together with biomarker.key it forms the identity of a scan result — the same measure appears once per site, so key alone is not unique. Omitted for lab results, which are scoped by specimen instead. required: - key description: The normalized identity layer. LabReportMeasurement: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string examples: - numeric description: One of numeric, bounded, qualitative, text, absent. numeric: type: number bounded: $ref: '#/components/schemas/LabReportBoundedValue' qualitative: $ref: '#/components/schemas/LabReportQualitativeValue' text: type: string absent_reason: type: string units: type: string ucum_code: type: string required: - type description: The single typed value of a result. Exactly one value field is set, named by type. LabReportBoundedValue: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: operator: type: string description: lt or gt. value: type: number required: - operator - value description: A one-sided bound. operator is lt or gt; value is the magnitude (e.g. lt with 0.5 means <0.5). LabReportQualitativeValue: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: text: type: string code: type: string description: Coded qualitative answer (LOINC/SNOMED) when available. LabReportInterpretation: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: flag: anyOf: - type: string - type: 'null' description: Coded signal (high/low/normal), or null when there is no signal. flag_raw: type: string description: The lab's verbatim flag. source: type: string description: Provenance of flag — report, computed, or none. applied_range: $ref: '#/components/schemas/LabReportAppliedRange' required: - flag - source description: The per-result abnormality layer. LabReportAppliedRange: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: lower: type: number upper: type: number description: Bounds of the reference range the flag was judged against. LabReportReferenceRange: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: lower: type: number upper: type: number type: type: string description: 'Coded range type (open enum: normal, low, high, borderline_low, borderline_high, critical_low, critical_high, abnormal, therapeutic, subtherapeutic, toxic). A lossy coding of `label`, judged from the report''s wording and where the band sits among the result''s ranges — a prediabetes band between the no-diabetes and diabetes bands is borderline_high. Omitted when nothing in the vocabulary fits.' label: type: string description: The range's classification exactly as the report printed it — "Optimal", "Moderate", "Consistent with increased risk for diabetes (prediabetes)". When a result carries several ranges they are bands, not one normal interval; this is the field that says what each band means. context: $ref: '#/components/schemas/LabReportRangeContext' description: One reference range. type describes the range, not a verdict on the result. LabReportRangeContext: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: sex: type: string age_lower: type: integer age_upper: type: integer pregnancy_status: type: string gestational_week_lower: type: integer gestational_week_upper: type: integer cycle_phase: type: string reference_population: type: string modifiers: type: array items: type: string description: The patient dimensions a reference range is scoped by. LabReportDeliveriesResponse: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: deliveries: type: array items: $ref: '#/components/schemas/LabReportDelivery' required: - deliveries LabReportDelivery: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: destination_id: type: string destination_type: type: string description: The destination's type (e.g. webhook, s3). status: type: string description: pending, delivered, or failed. attempt_count: type: integer description: Retry count — 0 on the first attempt, incremented per retry. last_error: type: string description: Most recent delivery error; omitted when delivered. required: - destination_id - status - attempt_count LabReportFilesResponse: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: files: type: array items: $ref: '#/components/schemas/LabReportFile' thumbnail: $ref: '#/components/schemas/LabReportFile' expires_at: type: string format: date-time description: Applies to every presigned URL in the response. required: - files LabReportArtifactsResponse: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: artifacts: type: array items: $ref: '#/components/schemas/LabReportFile' expires_at: type: string format: date-time required: - artifacts LabReportFile: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: filename: type: string presigned_url: type: string required: - presigned_url description: One downloadable object with a presigned URL. TerraUser: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: user_id: type: string examples: - 123e4567-e89b-12d3-a456-426614174000 minLength: 1 description: Terra identifier for the wearable connection provider: type: string examples: - FITBIT minLength: 1 description: Connection data source created_at: anyOf: - type: string - type: 'null' examples: - '2022-12-12T10:00:00.000000+00:00' description: Time at which the connection was created last_webhook_update: anyOf: - type: string - type: 'null' examples: - '2022-12-12T10:00:00.000000+00:00' description: Last time at which a webhook update was sent for the connection scopes: anyOf: - type: string - type: 'null' examples: - activity:read,sleep:read description: (when available) Permissions granted by the user during authentication - to be used as debugging metadata reference_id: anyOf: - type: string - type: 'null' examples: - user123@email.com description: Connection identifier on the developer's end, used to tie connection back to a user on the developer's platform active: anyOf: - type: boolean - type: 'null' examples: - true description: 'whether the user is active or not (inactive users will not receive any data updates and are in considered ' required: - user_id - provider ActivityLevel: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: Activity level is unknown or could not be determined. title: Unknown - type: number const: 1 description: User is at rest, with minimal to no physical activity. title: Rest - type: number const: 2 description: User is awake but inactive or sedentary. title: Inactive - type: number const: 3 description: User is engaged in light physical activity such as casual walking. title: Low Intensity - type: number const: 4 description: User is engaged in moderate physical activity such as brisk walking or light exercise. title: Medium Intensity - type: number const: 5 description: User is engaged in vigorous physical activity such as running or intense exercise. title: High Intensity examples: - 4 description: Intensity of the user's activity at an instant in time ActivityLevelSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. activity_level: anyOf: - $ref: '#/components/schemas/ActivityLevel' - type: 'null' description: The user's activity level for the sample. timer_duration_seconds: anyOf: - type: number - type: 'null' examples: - 60 description: Duration the activity-level timer has been running, in seconds. ActiveDurationsData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: activity_levels_samples: anyOf: - type: array items: $ref: '#/components/schemas/ActivityLevelSample' - type: 'null' description: Array of detailed samples of the intensity the user was in at various points during the workout. activity_seconds: anyOf: - type: number - type: 'null' examples: - 1800 minimum: 0 description: Total number of seconds spent in an active state during the workout. inactivity_seconds: anyOf: - type: number - type: 'null' examples: - 600 minimum: 0 description: Total number of seconds spent in an inactive state during the workout. low_intensity_seconds: anyOf: - type: number - type: 'null' examples: - 900 minimum: 0 description: Total number of seconds spent in a low intensity state during the workout. moderate_intensity_seconds: anyOf: - type: number - type: 'null' examples: - 600 minimum: 0 description: Total number of seconds spent in a moderate intensity state during the workout. num_continuous_inactive_periods: anyOf: - type: integer - type: 'null' examples: - 3 minimum: 0 description: Maximum number of continuous periods spent in an inactive state during the workout. rest_seconds: anyOf: - type: number - type: 'null' examples: - 120 minimum: 0 description: Total number of seconds spent resting during the workout. vigorous_intensity_seconds: anyOf: - type: number - type: 'null' examples: - 300 minimum: 0 description: Total number of seconds spent in a state of vigorous intensity during the workout. standing_hours_count: anyOf: - type: number - type: 'null' standing_seconds: anyOf: - type: number - type: 'null' CalorieSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. calories: anyOf: - type: number - type: 'null' description: Number of calories burned at the given timestamp. timer_duration_seconds: anyOf: - type: number - type: 'null' description: Time elapsed since the start of the workout, subtracting time during which the recording was paused CaloriesData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: BMR_calories: anyOf: - type: number - type: 'null' description: Basal Metabolic Rate calories - calories burned at rest. calorie_samples: anyOf: - type: array items: $ref: '#/components/schemas/CalorieSample' - type: 'null' description: Array of calorie data samples recorded throughout the time period. net_activity_calories: anyOf: - type: number - type: 'null' description: Net calories burned through activity (excluding BMR). net_intake_calories: anyOf: - type: number - type: 'null' description: Net calories consumed through food and drink intake. total_burned_calories: anyOf: - type: number - type: 'null' description: Total calories burned including BMR and activity. RecordFloat: type: object properties: {} unevaluatedProperties: type: number DataEnrichment: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: efficiency_score: anyOf: - type: number - type: 'null' examples: - 82 description: Efficiency score for the workout. efficiency_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the efficiency score. strain_score: anyOf: - type: number - type: 'null' examples: - 14.5 description: Strain score for the workout. strain_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the strain score. rcrs_score: anyOf: - type: number - type: 'null' examples: - 9 description: Recovery-corrected relative strain (RCRS) score for the workout. rcrs_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the RCRS score. trimp_score: anyOf: - type: number - type: 'null' examples: - 120 description: Training impulse (TRIMP) score for the workout. trimp_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the TRIMP score. $defs: RecordFloat: type: object properties: {} unevaluatedProperties: type: number DeviceDataType: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: string const: STEPS description: Count of steps taken by the user. title: Steps - type: string const: ACTIVE_MINUTES description: Duration of time the user spent in physical activity. title: Active Minutes - type: string const: BMR description: User's basal metabolic rate - calories burned at rest. title: Basal Metabolic Rate - type: string const: CALORIES description: Calories burned by the user during activity. title: Calories - type: string const: DISTANCE description: Distance traveled by the user during activity. title: Distance - type: string const: HEART_RATE description: User's heart rate measurements. title: Heart Rate - type: string const: OXYGEN_SATURATION description: Blood oxygen saturation level (SpO2) of the user. title: Oxygen Saturation - type: string const: SLEEP_TYPE description: Classification of user's sleep stages or types. title: Sleep Classification - type: string const: SPEED description: User's movement speed during activity. title: Speed - type: string const: CADENCE description: Rate of movement repetition during activity (steps per minute). title: Cadence examples: - STEPS description: Represents data types that a certain device contributed to. OtherDeviceData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: manufacturer: anyOf: - type: string - type: 'null' examples: - Garmin description: Device manufacturer name. hardware_version: anyOf: - type: string - type: 'null' examples: - v2.1 description: Hardware version of the device. serial_number: anyOf: - type: string - type: 'null' examples: - GR123456789 description: Device Serial Number. name: anyOf: - type: string - type: 'null' examples: - Forerunner 945 description: 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. software_version: anyOf: - type: string - type: 'null' examples: - 5.2.1 description: Device Software Version. data_provided: anyOf: - type: array items: $ref: '#/components/schemas/DeviceDataType' - type: 'null' description: Data provided by the device, as enumerated types. last_upload_date: anyOf: - type: string - type: 'null' description: Last upload date from the device. DeviceData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: activation_timestamp: anyOf: - type: string - type: 'null' examples: - '2022-12-25T00:00:00.000000+05:00' description: Activation timestamp of the device, if applicable. data_provided: anyOf: - type: array items: $ref: '#/components/schemas/DeviceDataType' - type: 'null' description: Data provided by the device, as enumerated types. hardware_version: anyOf: - type: string - type: 'null' examples: - v2.1 description: Hardware version of the device. last_upload_date: anyOf: - type: string - type: 'null' description: Last upload date from the device. manufacturer: anyOf: - type: string - type: 'null' examples: - Garmin description: Device manufacturer name. name: anyOf: - type: string - type: 'null' examples: - Forerunner 945 description: 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. other_devices: anyOf: - type: array items: $ref: '#/components/schemas/OtherDeviceData' - type: 'null' description: Data pertaining to other devices which may have contributed data for this workout. serial_number: anyOf: - type: string - type: 'null' examples: - GR123456789 description: Device Serial Number. software_version: anyOf: - type: string - type: 'null' examples: - 5.2.1 description: Device Software Version. DistanceSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. distance_meters: anyOf: - type: number - type: 'null' examples: - 2500 description: Cumulative distance covered up to associated timestamp, since the start of the payload timer_duration_seconds: anyOf: - type: number - type: 'null' examples: - 900 description: Time elapsed since the start of the workout, subtracting time during which the recording was paused ElevationSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. elev_meters: anyOf: - type: number - type: 'null' examples: - 925 description: User's altitude at a given point in time, in meters above sea level. timer_duration_seconds: anyOf: - type: number - type: 'null' examples: - 1200 description: Time elapsed since the start of the workout, subtracting time during which the recording was paused FloorsClimbedSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. floors_climbed: anyOf: - type: number - type: 'null' examples: - 5 description: Cumulative number of elevation gain measured in floors climbed up to associated timestamp, since the start of the payload timer_duration_seconds: anyOf: - type: number - type: 'null' examples: - 600 description: Time elapsed since the start of the workout, subtracting time during which the recording was paused StepSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. steps: anyOf: - type: number - type: 'null' description: Cumulative number of steps taken up to associated timestamp, since the start of the payload timer_duration_seconds: anyOf: - type: number - type: 'null' description: Time elapsed since the start of the workout, subtracting time during which the recording was paused DistanceDataDetailed: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: distance_samples: anyOf: - type: array items: $ref: '#/components/schemas/DistanceSample' - type: 'null' description: Array of detailed samples of distance covered throughout the workout. elevation_samples: anyOf: - type: array items: $ref: '#/components/schemas/ElevationSample' - type: 'null' description: Array of detailed samples of elevation throughout the workout. floors_climbed_samples: anyOf: - type: array items: $ref: '#/components/schemas/FloorsClimbedSample' - type: 'null' description: Array of detailed samples of floors climbed throughout the workout, as determined by the fitness data provider. step_samples: anyOf: - type: array items: $ref: '#/components/schemas/StepSample' - type: 'null' description: Array of detailed samples of steps performed throughout the workout. ElevationData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: avg_meters: anyOf: - type: number - type: 'null' examples: - 950 description: Average elevation of the user throughout the workout. gain_actual_meters: anyOf: - type: number - type: 'null' examples: - 550 minimum: 0 description: Actual elevation gain of the user throughout the workout - this includes all elevation gain, and does _not_ represent net gain. gain_planned_meters: anyOf: - type: number - type: 'null' examples: - 500 minimum: 0 description: Planned elevation gain for the workout. loss_actual_meters: anyOf: - type: number - type: 'null' examples: - 450 minimum: 0 description: Elevation loss of the user throughout the workout. max_meters: anyOf: - type: number - type: 'null' examples: - 1200 description: Maximum elevation of the user during the workout. min_meters: anyOf: - type: number - type: 'null' examples: - 800 description: Minimum elevation of the user during the workout. SwimmingData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: num_laps: anyOf: - type: integer - type: 'null' examples: - 20 minimum: 0 description: Total number of swimming laps performed during the day. num_strokes: anyOf: - type: integer - type: 'null' examples: - 500 minimum: 0 description: Total number of swimming strokes performed during the day. pool_length_meters: anyOf: - type: integer - type: 'null' examples: - 25 minimum: 0 description: Pool length for associated with the day. DistanceDataSummary: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: distance_meters: anyOf: - type: number - type: 'null' description: Total distance covered by the user throughout the workout. elevation: anyOf: - $ref: '#/components/schemas/ElevationData' - type: 'null' description: Object containing information on the elevation of the user throughout the workout. floors_climbed: anyOf: - type: integer - type: 'null' description: Total number of elevation gain in floors climbed equivalent throughout the workout, as determined by the fitness data provider. steps: anyOf: - type: integer - type: 'null' description: Total number of steps performed during the workout. swimming: anyOf: - $ref: '#/components/schemas/SwimmingData' - type: 'null' description: Summary information of the user's swimming statistics for the workout, if applicable. DistanceData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: detailed: anyOf: - $ref: '#/components/schemas/DistanceDataDetailed' - type: 'null' description: Object containing detailed distance information - this may included second-by-second samples. summary: anyOf: - $ref: '#/components/schemas/DistanceDataSummary' - type: 'null' description: Object containing summary information related to distance covered throughout the workout. EnergyData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: energy_kilojoules: anyOf: - type: number - type: 'null' examples: - 1200 description: Total number of kiloJoules expended during the workout energy_planned_kilojoules: anyOf: - type: number - type: 'null' examples: - 1150 description: Total number of kiloJoules planned to be expended during the workout - represents the user's predefined goal for the workout HeartRateContext: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: Heart rate measurement context is not specified. title: Not Set - type: number const: 1 description: Heart rate was measured during physical activity or exercise. title: Active - type: number const: 2 description: Heart rate was measured during rest or non-active periods. title: Not Active examples: - 1 description: Represents the context in which heart rate was measured. HeartRateDataSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. bpm: anyOf: - type: number - type: 'null' examples: - 142 description: User's heart rate in bpm timer_duration_seconds: anyOf: - type: number - type: 'null' examples: - 600 description: Time elapsed since the start of the workout, subtracting time during which the recording was paused context: anyOf: - $ref: '#/components/schemas/HeartRateContext' - type: 'null' description: Represents the context in which heart rate was measured. HeartRateVariabilityDataSampleRMSSD: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. hrv_rmssd: anyOf: - type: number - type: 'null' examples: - 42.1 description: User's Heart Rate Variability, computed using RMSSD HeartRateVariabilityDataSampleSDNN: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. hrv_sdnn: anyOf: - type: number - type: 'null' examples: - 48.3 description: User's Heart Rate Variability, computed using SDNN HeartRateDataDetailed: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: hr_samples: anyOf: - type: array items: $ref: '#/components/schemas/HeartRateDataSample' - type: 'null' description: Array of HeartRate data samples recorded for the user during the workout. hrv_samples_rmssd: anyOf: - type: array items: $ref: '#/components/schemas/HeartRateVariabilityDataSampleRMSSD' - type: 'null' description: Array of HeartRate Variability data samples recorded for the user during the workout, computed using RMSSD. hrv_samples_sdnn: anyOf: - type: array items: $ref: '#/components/schemas/HeartRateVariabilityDataSampleSDNN' - type: 'null' description: Array of HeartRate Variability data samples recorded for the user during the workout, computed using SDNN. HeartRateZoneData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: zone: anyOf: - type: integer - type: 'null' examples: - 2 description: Heart rate zone designation, as a zero-based zone index. start_percentage: anyOf: - type: number - type: 'null' examples: - 60 minimum: 0 maximum: 100 description: Start percentage (based off user's max HR) of the HR zone end_percentage: anyOf: - type: number - type: 'null' examples: - 70 minimum: 0 maximum: 100 description: End percentage (based off user's max HR) of the HR zone name: anyOf: - type: string - type: 'null' examples: - Aerobic description: Name of the associated heart rate zone duration_seconds: anyOf: - type: number - type: 'null' examples: - 300 description: Duration spent in the heart rate zone HeartRateDataSummary: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: avg_hr_bpm: anyOf: - type: number - type: 'null' examples: - 145 minimum: 0 description: Average HeartRate of the user during the workout. avg_hrv_rmssd: anyOf: - type: number - type: 'null' examples: - 35.2 description: Average HeartRate Variability of the user during the workout, computed using RMSSD. avg_hrv_sdnn: anyOf: - type: number - type: 'null' examples: - 45.5 description: Average HeartRate Variability of the user during the workout, computed using SDNN. hr_zone_data: anyOf: - type: array items: $ref: '#/components/schemas/HeartRateZoneData' - type: 'null' description: Array of time spent in various HR zones throughout the workout. max_hr_bpm: anyOf: - type: number - type: 'null' examples: - 180 minimum: 0 description: Maximum HeartRate of the user during the workout. min_hr_bpm: anyOf: - type: number - type: 'null' examples: - 85 minimum: 0 description: Minimum HeartRate of the user during the workout. resting_hr_bpm: anyOf: - type: number - type: 'null' examples: - 65 minimum: 0 description: Resting HeartRate of the user, as determined by the fitness data provider. user_max_hr_bpm: anyOf: - type: number - type: 'null' examples: - 190 description: User's maximum HeartRate based on their age, and other factors as determined by the fitness data provider. HeartRateData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: detailed: anyOf: - $ref: '#/components/schemas/HeartRateDataDetailed' - type: 'null' description: Object containing detailed heart rate information for the associated workout. summary: anyOf: - $ref: '#/components/schemas/HeartRateDataSummary' - type: 'null' description: Object containing summary heart rate information for the associated workout. LapSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: calories: anyOf: - type: number - type: 'null' examples: - 50 description: Calories burned during the lap avg_hr_bpm: anyOf: - type: number - type: 'null' examples: - 145 description: Average heart rate in bpm, for the Lap sample start_time: anyOf: - type: string - type: 'null' examples: - '1999-11-23T09:00:00.000000+02:00' description: The start time of the associated lap, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time avg_speed_meters_per_second: anyOf: - type: number - type: 'null' examples: - 3.5 description: Average speed of the user during the lap distance_meters: anyOf: - type: number - type: 'null' examples: - 400 description: Distance covered during the lap total_strokes: anyOf: - type: integer - type: 'null' examples: - 20 description: Total strokes performed during the lap - only relevant for swimming activities end_time: anyOf: - type: string - type: 'null' examples: - '2022-10-28T10:00:00.000000+01:00' description: The end time of the associated lap, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time stroke_type: anyOf: - type: string - type: 'null' examples: - freestyle description: Stroke type - only relevant for swimming activities avg_watts: anyOf: - type: number - type: 'null' examples: - 210 description: Average power output during the lap, in watts. active_duration_seconds: anyOf: - type: integer - type: 'null' examples: - 120 description: Active duration of the lap, in seconds. trigger_method: anyOf: - type: string - type: 'null' examples: - MANUAL description: 'What caused the lap to be recorded, where the device reports it: one of MANUAL, TIME, DISTANCE, POSITION_START, POSITION_LAP, POSITION_WAYPOINT, POSITION_MARKED, SESSION_END, FITNESS_EQUIPMENT, or UNSPECIFIED where the device reported a trigger we do not recognise. Devices commonly record automatic splits (DISTANCE, TIME) in the same activity as the laps the athlete pressed for (MANUAL), so filter on this to isolate one stream rather than treating every lap as equivalent. Null for providers that do not report a lap trigger.' LapData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: laps: anyOf: - type: array items: $ref: '#/components/schemas/LapSample' - type: 'null' description: Array of datapoints for each lap performed by the user during the workout. METSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. level: anyOf: - type: number - type: 'null' description: Metabolic Equivalent of Task (MET) level at the given timestamp METData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: MET_samples: anyOf: - type: array items: $ref: '#/components/schemas/METSample' - type: 'null' description: An array of Metabolic Equivalent Time samples, as calculated by the user's wearable. avg_level: anyOf: - type: number - type: 'null' examples: - 3.8 description: The average MET level of the activity. num_high_intensity_minutes: anyOf: - type: number - type: 'null' examples: - 10 minimum: 0 description: Number of minutes spent in High Intensity during the workout - based off MET scale. num_inactive_minutes: anyOf: - type: number - type: 'null' examples: - 5 minimum: 0 description: Number of minutes spent in state of Inactivity during the workout - based off MET scale. num_low_intensity_minutes: anyOf: - type: number - type: 'null' examples: - 15 minimum: 0 description: Number of minutes spent in Low Intensity during the workout - based off MET scale. num_moderate_intensity_minutes: anyOf: - type: number - type: 'null' examples: - 25 minimum: 0 description: Number of minutes spent in Moderate Intensity during the workout - based off MET scale. TimestampLocalization: $schema: https://json-schema.org/draft/2020-12/schema type: number enum: - 0 - 1 examples: - 0 description: Indicates whether the timestamps in this payload are localized (LOCAL) or in UTC. ActivityType: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: Activity type for when the user is in a vehicle, such as a car or bus. title: In Vehicle - type: number const: 1 description: Activity type for general biking or cycling. title: Biking - type: number const: 3 description: Activity type for when the user is still or not moving. title: Still - type: number const: 4 description: Activity type is unknown or could not be determined. title: Unknown - type: number const: 5 description: Activity type for when the device detects a tilting motion. title: Tilting - type: number const: 7 description: Activity type for general walking. title: Walking - type: number const: 8 description: Activity type for general running. title: Running - type: number const: 9 description: Activity type for aerobic exercises and workouts. title: Aerobics - type: number const: 10 description: Activity type for playing badminton. title: Badminton - type: number const: 11 description: Activity type for playing baseball. title: Baseball - type: number const: 12 description: Activity type for playing basketball. title: Basketball - type: number const: 13 description: Activity type for biathlon, combining cross-country skiing and rifle shooting. title: Biathlon - type: number const: 14 description: Activity type for hand biking, using a hand-powered bicycle. title: Hand Biking - type: number const: 15 description: Activity type for off-road cycling on rough terrain. title: Mountain Biking - type: number const: 16 description: Activity type for cycling on paved roads. title: Road Biking - type: number const: 17 description: Activity type for indoor cycling classes or spinning. title: Spinning - type: number const: 18 description: Activity type for exercising on a stationary bicycle. title: Stationary Biking - type: number const: 19 description: Activity type for cycling for transportation or utility purposes. title: Utility Biking - type: number const: 20 description: Activity type for boxing training or matches. title: Boxing - type: number const: 21 description: Activity type for bodyweight exercises focusing on rhythm and flow. title: Calisthenics - type: number const: 22 description: Activity type for workout consisting of a series of exercises performed in rotation. title: Circuit Training - type: number const: 23 description: Activity type for playing cricket. title: Cricket - type: number const: 24 description: Activity type for various forms of dance. title: Dancing - type: number const: 25 description: Activity type for exercising on an elliptical trainer. title: Elliptical - type: number const: 26 description: Activity type for fencing sport. title: Fencing - type: number const: 27 description: Activity type for playing American football. title: American Football - type: number const: 28 description: Activity type for playing Australian rules football. title: Australian Football - type: number const: 29 description: Activity type for playing soccer/football. title: English Football - type: number const: 30 description: Activity type for playing frisbee or disc sports. title: Frisbee - type: number const: 31 description: Activity type for gardening and yard work. title: Gardening - type: number const: 32 description: Activity type for playing golf. title: Golf - type: number const: 33 description: Activity type for performing gymnastics. title: Gymnastics - type: number const: 34 description: Activity type for playing handball. title: Handball - type: number const: 35 description: Activity type for hiking or walking on trails. title: Hiking - type: number const: 36 description: Activity type for playing hockey. title: Hockey - type: number const: 37 description: Activity type for horseback riding. title: Horseback Riding - type: number const: 38 description: Activity type for household chores and cleaning. title: Housework - type: number const: 39 description: Activity type for skipping or jumping rope. title: Jumping Rope - type: number const: 40 description: Activity type for kayaking on water. title: Kayaking - type: number const: 41 description: Activity type for exercises using kettlebells. title: Kettlebell Training - type: number const: 42 description: Activity type for kickboxing training or matches. title: Kickboxing - type: number const: 43 description: Activity type for kitesurfing or kiteboarding. title: Kitesurfing - type: number const: 44 description: Activity type for general martial arts training. title: Martial Arts - type: number const: 45 description: Activity type for meditation practice. title: Meditation - type: number const: 46 description: Activity type for MMA training or fighting. title: Mixed Martial Arts - type: number const: 47 description: Activity type for P90X home fitness program. title: P90X Exercises - type: number const: 48 description: Activity type for paragliding sport. title: Paragliding - type: number const: 49 description: Activity type for pilates exercises. title: Pilates - type: number const: 50 description: Activity type for playing polo. title: Polo - type: number const: 51 description: Activity type for playing racquetball. title: Racquetball - type: number const: 52 description: Activity type for rock climbing. title: Rock Climbing - type: number const: 53 description: Activity type for rowing on water. title: Rowing - type: number const: 54 description: Activity type for exercising on a rowing machine. title: Rowing Machine - type: number const: 55 description: Activity type for playing rugby. title: Rugby - type: number const: 56 description: Activity type for jogging at a leisurely pace. title: Jogging - type: number const: 57 description: Activity type for running on beach or sandy surface. title: Running on Sand - type: number const: 58 description: Activity type for running on a treadmill. title: Treadmill Running - type: number const: 59 description: Activity type for sailing on water. title: Sailing - type: number const: 60 description: Activity type for scuba diving underwater. title: Scuba Diving - type: number const: 61 description: Activity type for skateboarding. title: Skateboarding - type: number const: 62 description: Activity type for general skating. title: Skating - type: number const: 63 description: Activity type for cross skating or nordic skating. title: Cross Skating - type: number const: 64 description: Activity type for rollerblading indoors. title: Indoor Rollerblading - type: number const: 65 description: Activity type for general skiing. title: Skiing - type: number const: 66 description: Activity type for backcountry or off-piste skiing. title: Back Country Skiing - type: number const: 67 description: Activity type for cross-country skiing. title: Cross Country Skiing - type: number const: 68 description: Activity type for alpine or downhill skiing. title: Downhill Skiing - type: number const: 69 description: Activity type for skiing with a kite for propulsion. title: Kite Skiing - type: number const: 70 description: Activity type for roller skiing on wheels. title: Roller Skiing - type: number const: 71 description: Activity type for sledding or tobogganing. title: Sledding - type: number const: 73 description: Activity type for snowboarding. title: Snowboarding - type: number const: 74 description: Activity type for riding a snowmobile. title: Snowmobile - type: number const: 75 description: Activity type for walking with snowshoes. title: Snowshoeing - type: number const: 76 description: Activity type for playing squash. title: Squash - type: number const: 77 description: Activity type for climbing stairs. title: Stair Climbing - type: number const: 78 description: Activity type for exercising on a stair climbing machine. title: Stair Climbing Machine - type: number const: 79 description: Activity type for stand-up paddleboarding. title: Stand Up Paddleboarding - type: number const: 80 description: Activity type for resistance training or weight lifting. title: Strength Training - type: number const: 81 description: Activity type for surfing on waves. title: Surfing - type: number const: 82 description: Activity type for general swimming. title: Swimming - type: number const: 83 description: Activity type for swimming in a swimming pool. title: Swimming in Pool - type: number const: 84 description: Activity type for swimming in open water like oceans, lakes or rivers. title: Open Water Swimming - type: number const: 85 description: Activity type for playing table tennis or ping pong. title: Table Tennis - type: number const: 86 description: Activity type for general team sports not otherwise classified. title: Team Sports - type: number const: 87 description: Activity type for playing tennis. title: Tennis - type: number const: 88 description: Activity type for exercising on a treadmill. title: Treadmill - type: number const: 89 description: Activity type for general volleyball. title: Volleyball - type: number const: 90 description: Activity type for playing volleyball on a beach. title: Beach Volleyball - type: number const: 91 description: Activity type for playing volleyball indoors. title: Indoor Volleyball - type: number const: 92 description: Activity type for wakeboarding on water. title: Wakeboarding - type: number const: 93 description: Activity type for walking specifically for exercise. title: Walking for Fitness - type: number const: 94 description: Activity type for walking with poles. title: Nordic Walking - type: number const: 95 description: Activity type for walking on a treadmill. title: Treadmill Walking - type: number const: 96 description: Activity type for playing water polo. title: Water Polo - type: number const: 97 description: Activity type for weightlifting exercises. title: Weightlifting - type: number const: 98 description: Activity type for wheelchair-based movement. title: Wheelchair - type: number const: 99 description: Activity type for windsurfing on water. title: Windsurfing - type: number const: 100 description: Activity type for practicing yoga. title: Yoga - type: number const: 101 description: Activity type for Zumba dance fitness. title: Zumba - type: number const: 102 description: Activity type for diving or jumping into water. title: Diving - type: number const: 103 description: Activity type for exercising on an ergometer. title: Ergometer - type: number const: 104 description: Activity type for skating on ice. title: Ice Skating - type: number const: 105 description: Activity type for skating indoors. title: Indoor Skating - type: number const: 106 description: Activity type for playing curling on ice. title: Curling - type: number const: 108 description: Activity type for activities that don't fit into other categories. title: Other - type: number const: 113 description: Activity type for CrossFit training. title: CrossFit - type: number const: 114 description: Activity type for high-intensity interval training. title: HIIT - type: number const: 115 description: Activity type for general interval training workouts. title: Interval Training - type: number const: 116 description: Activity type for walking while pushing a stroller. title: Walking with Stroller - type: number const: 117 description: Activity type for riding in an elevator. title: Elevator - type: number const: 118 description: Activity type for riding on an escalator. title: Escalator - type: number const: 119 description: Activity type for practicing archery. title: Archery - type: number const: 120 description: Activity type for playing softball. title: Softball - type: number const: 122 description: Activity type for practicing guided breathing exercises. title: Guided Breathing - type: number const: 123 description: Activity type for general cardiovascular exercise. title: Cardio Training - type: number const: 124 description: Activity type for playing lacrosse. title: Lacrosse - type: number const: 125 description: Activity type for stretching exercises. title: Stretching - type: number const: 126 description: Activity type for triathlon events combining swimming, cycling and running. title: Triathlon - type: number const: 127 description: Activity type for inline skating or rollerblading. title: Inline Skating - type: number const: 128 description: Activity type for sky diving or parachuting. title: Sky Diving - type: number const: 129 description: Activity type for general paddling activities. title: Paddling - type: number const: 130 description: Activity type for mountaineering or alpine climbing. title: Mountaineering - type: number const: 131 description: Activity type for fishing activities. title: Fishing - type: number const: 132 description: Activity type for water skiing. title: Water Skiing - type: number const: 133 description: Activity type for running indoors. title: Indoor Running - type: number const: 134 description: Activity type for playing padel tennis. title: Padel Tennis - type: number const: 135 description: Activity type for driving a vehicle. title: Driving - type: number const: 136 description: Activity type for driving off-road or on unpaved surfaces. title: Off-Road Driving - type: number const: 137 description: Activity type for riding a motorcycle. title: Motorbiking - type: number const: 138 description: Activity type for motorsport racing. title: Motor Racing - type: number const: 139 description: Activity type for enduro motorcycle racing. title: Enduro - type: number const: 140 description: Activity type for canoeing on water. title: Canoeing - type: number const: 141 description: Activity type for orienteering navigation sport. title: Orienteering - type: number const: 142 description: Activity type for hang gliding. title: Hang Gliding - type: number const: 143 description: Activity type for piloting an aircraft. title: Flying - type: number const: 144 description: Activity type for hot air balloon flying. title: Hot Air Ballooning - type: number const: 145 description: Activity type for riding a jet ski on water. title: Jet Skiing - type: number const: 146 description: Activity type for operating a motorized boat. title: Power Boating - type: number const: 147 description: Activity type for playing Gaelic football. title: Gaelic Football - type: number const: 148 description: Activity type for playing hurling. title: Hurling - type: number const: 149 description: Activity type for running on off-road or natural terrain trails. title: Trail Running - type: number const: 150 description: Activity type for cycling on gravel or mixed-surface roads. title: Gravel Cycling - type: number const: 151 description: Activity type for a multisport session combining more than one discipline. title: Multisport - type: number const: 152 description: Activity type for riding an electrically assisted bicycle. title: E-Biking - type: number const: 153 description: Activity type for riding an electrically assisted mountain bike. title: E-Mountain Biking - type: number const: 154 description: Activity type for a physical therapy or rehabilitation session. title: Physical Therapy examples: - 8 description: The type of activity performed for the associated workout. UploadType: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: The upload type is unknown or could not be determined. title: Unknown - type: number const: 1 description: The workout was automatically detected and recorded by a device or service. title: Automatic - type: number const: 2 description: The workout was manually entered by the user. title: Manual - type: number const: 3 description: The workout data represents an update to a previously recorded workout. title: Update - type: number const: 4 description: The workout was marked for deletion. title: Delete - type: number const: 5 description: The workout upload is pending processing or confirmation. title: Pending - type: number const: 6 description: The workout was uploaded or synced from a third-party service or application. title: Third party upload description: The type of upload for the associated workout, providing information on how the workout data was recorded or entered ActivityMetadata: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: city: anyOf: - type: string - type: 'null' examples: - San Francisco description: The City in which the workout was performed. country: anyOf: - type: string - type: 'null' examples: - United States description: The Country in which the workout was performed. end_time: type: string examples: - '2022-10-28T10:00:00.000000+01:00' description: The end time of the associated workout, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time. name: anyOf: - type: string - type: 'null' examples: - Morning Run description: The name - either user-entered or given by the fitness data provider - of the associated workout. start_time: type: string examples: - '1999-11-23T09:00:00.000000+02:00' description: The start time of the associated workout, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time. state: anyOf: - type: string - type: 'null' examples: - California description: The State in which the workout was performed. summary_id: type: string examples: - 123e4567-e89b-12d3-a456-426614174000 description: A unique identifier for the workout - note that this is unique for the given user, and may not be globally unique. timestamp_localization: anyOf: - $ref: '#/components/schemas/TimestampLocalization' - type: 'null' type: $ref: '#/components/schemas/ActivityType' description: The type of activity performed for the associated workout. upload_type: $ref: '#/components/schemas/UploadType' description: The upload type for the associated workout, providing information on whether this was an automatic workout or user-entered. required: - end_time - start_time - summary_id - type - upload_type CadenceSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. cadence_rpm: anyOf: - type: number - type: 'null' description: User's cadence at a given instant in time, in revolutions per minute timer_duration_seconds: anyOf: - type: number - type: 'null' description: Time elapsed since the start of the workout, subtracting time during which the recording was paused SpeedSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. speed_meters_per_second: anyOf: - type: number - type: 'null' description: Speed of the user at a given instant in time, in meters per second timer_duration_seconds: anyOf: - type: number - type: 'null' description: Time elapsed since the start of the workout, subtracting time during which the recording was paused TorqueSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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 timer_duration_seconds: anyOf: - type: number - type: 'null' examples: - 300 description: Time elapsed since the start of the workout, subtracting time during which the recording was paused torque_newton_meters: anyOf: - type: number - type: 'null' examples: - 45.5 description: Torque generated at a given instant in time, in Newton-meters MovementData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: adjusted_max_speed_meters_per_second: anyOf: - type: number - type: 'null' examples: - 4.2 description: Adjusted max speed of the user during the workout - generated using Terra's algorithms to remove potential affecting the user's actual max speed measurement. avg_cadence_rpm: anyOf: - type: number - type: 'null' examples: - 85 description: Average cadence of the user during the workout, in RPM. avg_pace_minutes_per_kilometer: anyOf: - type: number - type: 'null' examples: - 6.2 description: Average pace of the user during the workout. avg_speed_meters_per_second: anyOf: - type: number - type: 'null' examples: - 3.2 description: Average speed of the user during the workout. avg_torque_newton_meters: anyOf: - type: number - type: 'null' examples: - 40 description: Average torque generated by the user during the workout - mainly relevant for cycling activities. avg_velocity_meters_per_second: anyOf: - type: number - type: 'null' examples: - 3 description: Average velocity of the user during the workout - only calculated by certain providers, representing a separate quantity from speed. cadence_samples: anyOf: - type: array items: $ref: '#/components/schemas/CadenceSample' - type: 'null' description: Array of cadence values recorded throughout the workout, sampled at intervals determined by the fitness data provider. max_cadence_rpm: anyOf: - type: number - type: 'null' examples: - 110 description: Maximum cadence of the user during the workout - mainly relevant for cycling activities. max_pace_minutes_per_kilometer: anyOf: - type: number - type: 'null' examples: - 6.5 description: Maximum pace of the user during the workout. max_speed_meters_per_second: anyOf: - type: number - type: 'null' examples: - 4.5 description: Maximum speed of the user during the workout. max_torque_newton_meters: anyOf: - type: number - type: 'null' examples: - 55.5 description: Maximum torque generated by the user during the workout - mainly relevant for cycling activities. max_velocity_meters_per_second: anyOf: - type: number - type: 'null' examples: - 4.5 description: Maximum velocity of the user during the workout - only calculated by certain providers, representing a separate quantity from speed. normalized_speed_meters_per_second: anyOf: - type: number - type: 'null' examples: - 3.8 description: Average normalized speed of the user during the workout - only calculated by certain providers, representing a separate quantity from speed. speed_samples: anyOf: - type: array items: $ref: '#/components/schemas/SpeedSample' - type: 'null' description: Array of the datapoints for the user's speed sampled throughout the workout. torque_samples: anyOf: - type: array items: $ref: '#/components/schemas/TorqueSample' - type: 'null' description: Array of the datapoints for the user's torque sampled throughout the workout. OxygenSaturationType: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: Oxygen saturation measurement for blood. title: Blood - type: number const: 1 description: Oxygen saturation measurement for muscle. title: Muscle examples: - 0 description: Type of oxygen saturation measurement (i.e. blood vs muscle) OxygenSaturationSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. percentage: anyOf: - type: number - type: 'null' examples: - 98 description: User's oxygen saturation percentage - referring to either SpO2 or SmO2, based on the `type` field type: anyOf: - $ref: '#/components/schemas/OxygenSaturationType' - type: 'null' description: Type of oxygen saturation measurement (i.e. blood vs muscle) Vo2MaxSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. vo2max_ml_per_min_per_kg: anyOf: - type: number - type: 'null' examples: - 45.5 description: User's VO2Max - maximum amount of oxygen the user's body can utilize during exercise OxygenData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: avg_saturation_percentage: anyOf: - type: number - type: 'null' examples: - 98 description: Average Oxygen Saturation percentage of the user during the day (SpO2 or SmO2). saturation_samples: anyOf: - type: array items: $ref: '#/components/schemas/OxygenSaturationSample' - type: 'null' description: Array of Oxygen Saturation percentage datapoints sampled throughout the day. vo2_samples: anyOf: - type: array items: $ref: '#/components/schemas/Vo2MaxSample' - type: 'null' description: Array of VO2 datapoints sampled throughout the day. vo2max_ml_per_min_per_kg: anyOf: - type: number - type: 'null' examples: - 45.5 description: VO2Max for the given user. day_avg_vo2max_ml_per_min_per_kg: anyOf: - type: number - type: 'null' examples: - 44 description: Day-average VO2 max, in millilitres per minute per kilogram. PolylineMapData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: summary_polyline: anyOf: - type: string - type: 'null' examples: - '}_p~iF~ps|U_ulLnnqC_mqNvxq`@' description: The polyline representation of the user's trajectory throughout the workout PositionSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. coords_lat_lng_deg: anyOf: - type: array prefixItems: - type: number - type: number - type: 'null' examples: - - -18.4911 - 130.9123 description: Position of the user a given point in time, represented by a 2-value array of latitude, longitude, wherein each of the two numbers can be nullable timer_duration_seconds: anyOf: - type: number - type: 'null' examples: - 300 description: Time elapsed since the start of the workout, subtracting time during which the recording was paused PositionData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: center_pos_lat_lng_deg: anyOf: - type: array items: type: number - type: 'null' examples: - - -18.4911 - 130.9123 description: Position of the user at the midway point of the workout, represented by a 2-value array of latitude, longitude, wherein each of the two numbers can be nullable. end_pos_lat_lng_deg: anyOf: - type: array items: type: number - type: 'null' examples: - - -84.4911 - -150.9123 description: Position of the user at the end of the workout, represented by a 2-value array of latitude, longitude, wherein each of the two numbers can be nullable. position_samples: anyOf: - type: array items: $ref: '#/components/schemas/PositionSample' - type: 'null' description: Array of datapoints of the position of the user, sampled throughout the workout. start_pos_lat_lng_deg: anyOf: - type: array items: type: number - type: 'null' examples: - - 80.2394 - 102.931 description: Position of the user at the start of the workout, represented by a 2-value array of latitude, longitude, wherein each of the two numbers can be nullable. StrengthMovement: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: ab_rollout - type: string const: arm_circle - type: string const: around_the_world - type: string const: back_extension - type: string const: battle_rope_slam - type: string const: battle_rope_wave - type: string const: bear_crawl - type: string const: bicep_curl - type: string const: bicycle_crunch - type: string const: bike - type: string const: bird_dog - type: string const: body_saw - type: string const: bound - type: string const: box_jump - type: string const: broad_jump - type: string const: burpee - type: string const: butt_kick - type: string const: butt_scoot - type: string const: calf_raise - type: string const: carioca - type: string const: carry - type: string const: chest_fly - type: string const: chest_press - type: string const: chin_up - type: string const: clamshell - type: string const: clean - type: string const: clean_pull - type: string const: climb - type: string const: complex - type: string const: cossack_squat - type: string const: crunch - type: string const: dead_bug - type: string const: deadlift - type: string const: depth_jump - type: string const: diaphragmatic_breathing - type: string const: dip - type: string const: duck_walk - type: string const: elliptical - type: string const: face_pull - type: string const: farmers_carry - type: string const: fire_hydrant - type: string const: flutter_kick - type: string const: foam_roll - type: string const: frog_kick - type: string const: front_raise - type: string const: glute_bridge - type: string const: glute_ham_raise - type: string const: good_morning - type: string const: halo - type: string const: hand_walk - type: string const: handstand_hold - type: string const: handstand_push_up - type: string const: handstand_walk - type: string const: heel_slide - type: string const: heel_touch - type: string const: high_knee - type: string const: high_pull - type: string const: hike - type: string const: hip_abduction - type: string const: hip_adduction - type: string const: hip_circle - type: string const: hip_drop - type: string const: hip_extension - type: string const: hip_flexion - type: string const: hip_hinge - type: string const: hip_thrust - type: string const: hold - type: string const: hollow_hold - type: string const: hop - type: string const: i_raise - type: string const: inchworm - type: string const: jerk - type: string const: jump - type: string const: jump_rope - type: string const: jumping_jack - type: string const: kick - type: string const: knee_raise - type: string const: kneel_to_stand - type: string const: l_sit - type: string const: lat_pulldown - type: string const: lateral_raise - type: string const: lateral_walk - type: string const: leg_circle - type: string const: leg_curl - type: string const: leg_cycle - type: string const: leg_extension - type: string const: leg_press - type: string const: leg_raise - type: string const: leg_swing - type: string const: lunge - type: string const: march - type: string const: monster_walk - type: string const: mountain_climber - type: string const: muscle_up - type: string const: neck_extension - type: string const: neck_flexion - type: string const: neck_lateral_flexion - type: string const: oblique_crunch - type: string const: overhead_press - type: string const: pallof_press - type: string const: pike_up - type: string const: plank - type: string const: plate_flip - type: string const: plate_pinch - type: string const: pull_apart - type: string const: pull_through - type: string const: pull_up - type: string const: pullover - type: string const: punch - type: string const: push_press - type: string const: push_up - type: string const: rear_delt_fly - type: string const: reverse_crunch - type: string const: reverse_hyperextension - type: string const: romanian_deadlift - type: string const: rope_climb - type: string const: row - type: string const: row_erg - type: string const: run - type: string const: russian_twist - type: string const: scapular_pull_up - type: string const: scapular_push_up - type: string const: scapular_retraction - type: string const: scissor_kick - type: string const: shoulder_external_rotation - type: string const: shoulder_internal_rotation - type: string const: shrug - type: string const: shuffle - type: string const: sissy_squat - type: string const: sit_up - type: string const: ski_erg - type: string const: skip - type: string const: slam - type: string const: sled_drag - type: string const: sled_push - type: string const: snatch - type: string const: snatch_balance - type: string const: snatch_pull - type: string const: squat - type: string const: stair_climb - type: string const: star_jump - type: string const: step_down - type: string const: step_over - type: string const: step_up - type: string const: stiff_legged_deadlift - type: string const: stomach_vacuum - type: string const: straight_arm_pulldown - type: string const: stretch - type: string const: superman - type: string const: swim - type: string const: swimmer - type: string const: swing - type: string const: t_raise - type: string const: throw - type: string const: thruster - type: string const: tibialis_raise - type: string const: tire_flip - type: string const: toe_tap - type: string const: toe_walk - type: string const: tricep_extension - type: string const: trunk_lateral_flexion - type: string const: trunk_rotation - type: string const: turkish_get_up - type: string const: upright_row - type: string const: v_sit - type: string const: v_up - type: string const: w_raise - type: string const: walk - type: string const: walkout - type: string const: windmill - type: string const: windshield_wiper - type: string const: wood_chop - type: string const: wrist_curl - type: string const: y_raise - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - ab_rollout description: The joint action an exercise performs, stripped of implement, grip, stance, tempo and position. Terra's own vocabulary, not the source's wording. Open enum — handle unknown values gracefully. StrengthTarget: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: abs - type: string const: adductors - type: string const: ankle - type: string const: back - type: string const: biceps - type: string const: calves - type: string const: chest - type: string const: forearms - type: string const: glutes - type: string const: hamstrings - type: string const: hip - type: string const: hip_abductor - type: string const: hip_adductor - type: string const: hip_flexor - type: string const: lat - type: string const: lower_back - type: string const: neck - type: string const: obliques - type: string const: quadriceps - type: string const: shoulders - type: string const: spine - type: string const: thoracic_spine - type: string const: triceps - type: string const: upper_back - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - abs description: The body part a stretch or mobility drill acts on. For a stretch the body part IS the exercise, which is why it is reported separately from the muscles worked. Open enum — handle unknown values gracefully. StrengthImplement: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: band - type: string const: barbell - type: string const: battle_rope - type: string const: belt - type: string const: bodyweight - type: string const: cable - type: string const: dumbbell - type: string const: ez_bar - type: string const: handle_band - type: string const: kettlebell - type: string const: landmine - type: string const: loop_band - type: string const: machine - type: string const: machine_assisted - type: string const: medicine_ball - type: string const: mini_band - type: string const: partner - type: string const: pvc - type: string const: safety_bar - type: string const: sled - type: string const: smith_machine - type: string const: suspension - type: string const: trap_bar - type: string const: weight_plate - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - band description: What provides the load. Open enum — handle unknown values gracefully. StrengthSurface: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: bench - type: string const: bosu - type: string const: box - type: string const: floor - type: string const: foam_roller - type: string const: glute_ham_machine - type: string const: preacher_bench - type: string const: swiss_ball - type: string const: treadmill - type: string const: wall - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - bench description: What the body is supported on, when it is not the floor. Open enum — handle unknown values gracefully. StrengthGripWidth: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: close - type: string const: wide - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - close description: How far apart the hands are. Open enum — handle unknown values gracefully. StrengthGripOrientation: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: bottoms_up - type: string const: mixed - type: string const: neutral - type: string const: overhand - type: string const: pinch - type: string const: reverse - type: string const: underhand - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - bottoms_up description: Which way the hands face. Separate from grip_width because the two combine. Open enum — handle unknown values gracefully. StrengthLaterality: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: alternating - type: string const: bilateral - type: string const: unilateral - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - alternating description: Whether both limbs work together, alternately, or one at a time. Open enum — handle unknown values gracefully. StrengthStance: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: crossover - type: string const: curtsy - type: string const: split - type: string const: sumo - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - crossover description: Foot arrangement. Open enum — handle unknown values gracefully. StrengthPosition: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: bent_over - type: string const: decline - type: string const: elevated - type: string const: flat - type: string const: forearm - type: string const: half_kneeling - type: string const: hanging - type: string const: incline - type: string const: inverted - type: string const: kneeling - type: string const: lying - type: string const: pike - type: string const: prone - type: string const: quadruped - type: string const: seated - type: string const: side_lying - type: string const: standing - type: string const: supine - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - bent_over description: Orientation of the body or bench. Open enum — handle unknown values gracefully. StrengthBarPosition: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: behind_back - type: string const: behind_neck - type: string const: front_rack - type: string const: goblet - type: string const: overhead - type: string const: zercher - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - behind_back description: Where the implement is carried. Open enum — handle unknown values gracefully. StrengthTempo: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: eccentric - type: string const: explosive - type: string const: isometric - type: string const: kipping - type: string const: paused - type: string const: pulse - type: string const: tempo_slow - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - eccentric description: How the repetition is paced. Open enum — handle unknown values gracefully. StrengthRangeOfMotion: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: deficit - type: string const: from_blocks - type: string const: from_hang - type: string const: full - type: string const: partial - type: string const: to_bench - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - deficit description: How much of the movement is performed, or where it starts. Open enum — handle unknown values gracefully. StrengthProgramme: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: pregnancy - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - pregnancy description: A programme or population the variant belongs to. Descriptive only — it changes neither the movement nor the load. Open enum — handle unknown values gracefully. StrengthExerciseModifiers: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: implement: anyOf: - $ref: '#/components/schemas/StrengthImplement' - type: 'null' examples: - barbell description: What provides the load. Open enum — handle unknown values gracefully; the published vocabulary lists the values in use, and a value outside it must pass through rather than be rejected. surface: anyOf: - $ref: '#/components/schemas/StrengthSurface' - type: 'null' description: What the body is supported on, when it is not the floor. Open enum. grip_width: anyOf: - $ref: '#/components/schemas/StrengthGripWidth' - type: 'null' examples: - close description: How far apart the hands are. Open enum. grip_orientation: anyOf: - $ref: '#/components/schemas/StrengthGripOrientation' - type: 'null' description: Which way the hands face. Open enum. Separate from grip_width because the two combine — a close-grip underhand pulldown needs both. laterality: anyOf: - $ref: '#/components/schemas/StrengthLaterality' - type: 'null' description: Whether both limbs work together, alternately, or one at a time. Open enum. stance: anyOf: - $ref: '#/components/schemas/StrengthStance' - type: 'null' description: Foot arrangement. Open enum. position: anyOf: - $ref: '#/components/schemas/StrengthPosition' - type: 'null' examples: - incline description: Orientation of the body or bench. Open enum. bar_position: anyOf: - $ref: '#/components/schemas/StrengthBarPosition' - type: 'null' description: Where the implement is carried. Open enum. tempo: anyOf: - $ref: '#/components/schemas/StrengthTempo' - type: 'null' description: How the repetition is paced. Open enum. rom: anyOf: - $ref: '#/components/schemas/StrengthRangeOfMotion' - type: 'null' description: How much of the movement is performed, or where it starts. Open enum. accommodating_resistance: anyOf: - type: string - type: 'null' description: Bands or chains added to another implement — not a second implement. The reported weight_kg is the bar alone, since band tension is not expressed in kg, so this also signals that the recorded load understates the real resistance. Open enum. assistance: anyOf: - type: string - type: 'null' description: 'What makes the movement easier and how: machine, band, partner, balance_support. Names the source of assistance, not the fact of it. Open enum.' programme: anyOf: - $ref: '#/components/schemas/StrengthProgramme' - type: 'null' description: A programme or population the variant belongs to. Describes context, not a different movement, so it does not distinguish one exercise from another. Open enum. StrengthMuscle: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: abductors - type: string const: abs - type: string const: adductors - type: string const: back description: The back without a part named. Where a source distinguishes the lats or the upper back, `lat` or `upper_back` is reported instead. - type: string const: biceps - type: string const: calves - type: string const: chest - type: string const: forearms - type: string const: glutes - type: string const: hamstrings - type: string const: hip_flexor description: Iliopsoas and sartorius. Its own group — not part of the quadriceps. - type: string const: lat description: 'Latissimus dorsi. Reported separately from `back` and `upper_back`: a pulldown and a row are different work.' - type: string const: lower_back - type: string const: neck - type: string const: obliques - type: string const: quadriceps - type: string const: serratus description: Serratus anterior. Its own group — not part of the chest. - type: string const: shoulders - type: string const: tibialis description: Tibialis anterior. Its own group — not part of the calves, which it opposes. - type: string const: trapezius - type: string const: triceps - type: string const: upper_back description: The upper back — rhomboids and mid traps — as distinct from the lats. - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - abductors description: |- A muscle group an exercise works, used by both primary_muscles and secondary_muscles. Open enum — handle unknown values gracefully. Members are training groups rather than anatomy: a source naming a specific head reports the group it belongs to, so the same exercise groups the same way whichever app recorded it. Members are added over time, and a new one changes the total of the member it is most closely related to. If you aggregate per muscle, plan for that. Some members are parts of a broader one and can be summed with it for a coarse view that stays stable: `lat` + `upper_back` + `back` covers the whole back, and `obliques` + `abs` the whole midsection. Others are their own group and should not be folded into a neighbour — `serratus` is not part of the chest, `tibialis` is not part of the calves, and `hip_flexor` is not part of the quadriceps. StrengthSource: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: device_detected - type: string const: user_logged - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - user_logged description: How the exercise came to be recorded. Open enum — handle unknown values gracefully. StrengthLoadType: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: assisted - type: string const: bodyweight - type: string const: bodyweight_plus - type: string const: external - type: string const: unknown - type: string description: A value Terra has added since this schema was published. examples: - assisted description: How to read weight_kg for this set. Open enum — handle unknown values gracefully. StrengthSetType: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: amrap - type: string const: cooldown - type: string const: dropset - type: string const: failure - type: string const: normal - type: string const: warmup - type: string const: unknown description: The source reported a value here but it could not be resolved. Distinct from the field being absent, which means the source reported nothing at all. - type: string description: A value Terra has added since this schema was published. examples: - amrap description: What kind of set this was. Open enum — handle unknown values gracefully. StrengthSet: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: distance_meters: anyOf: - type: number - type: 'null' description: Distance covered, for loaded carries. duration_seconds: anyOf: - type: number - type: 'null' description: Duration of the set, for timed holds and carries. end_time: anyOf: - type: string - type: 'null' description: End of the set, ISO 8601. Null when the source does not timestamp sets. load_type: $ref: '#/components/schemas/StrengthLoadType' examples: - external description: 'How to read weight_kg. Always present: every set that happened was loaded somehow, so a set Terra could not classify reports `unknown` rather than omitting the field. Open enum — handle unknown values gracefully. Only external means weight_kg is load added to an otherwise unloaded body, so compute volume from external sets alone. Test for external rather than testing against the other values: a load type you do not recognise must be treated as unknown, because counting it as external overstates the load.' notes: anyOf: - type: string - type: 'null' description: The user's note on this specific set. reps: anyOf: - type: integer - type: 'null' examples: - 5 description: Repetitions performed, exactly as the source recorded them. For unilateral movements this is per side. rest_after_seconds: anyOf: - type: integer - type: 'null' examples: - 120 description: Rest taken after this set, within its exercise. Rest between exercises is not represented. rir: anyOf: - type: number - type: 'null' description: Reps in reserve. Never converted to or from rpe. rpe: anyOf: - type: number - type: 'null' examples: - 8.5 description: Rate of perceived exertion, on a 0-10 scale. set_type: anyOf: - $ref: '#/components/schemas/StrengthSetType' - type: 'null' examples: - normal description: The type of set as reported by the source, such as normal, warmup, dropset or failure. Open enum — handle unknown values gracefully. unknown when the source does not classify the set. start_time: anyOf: - type: string - type: 'null' description: Start of the set, ISO 8601. Null when the source does not timestamp sets. weight_kg: anyOf: - type: number - type: 'null' examples: - 100 description: 'Load as the source logged it: a barbell''s total, or one dumbbell. Never negative. Null when load_type is unknown, and may also be null for a load_type you do not recognise.' required: - load_type StrengthExercise: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: exercise_name: anyOf: - type: string - type: 'null' examples: - Close Grip Bench Press description: The source's own label for the exercise, passed through verbatim. Present whenever the source names the exercise, whether or not it resolved to a movement. Intended for display. movements: anyOf: - type: array items: $ref: '#/components/schemas/StrengthMovement' - type: 'null' description: 'The joint actions performed, in the order one repetition performs them, with implement, grip, stance, tempo and position all carried in modifiers. Usually one; a clean and jerk is [clean, jerk]. This is the rollup axis, and membership is what to test: a clean and jerk belongs in both clean volume and jerk volume, so ask whether movements contains the value rather than equals it. Open enum — handle unknown values gracefully. Empty when the exercise could not be resolved, in which case exercise_name still says what the source called it.' target: anyOf: - $ref: '#/components/schemas/StrengthTarget' - type: 'null' description: The body part a stretch or mobility drill targets. modifiers: anyOf: - $ref: '#/components/schemas/StrengthExerciseModifiers' - type: 'null' description: 'The axes that qualify the exercise. An axis that is absent was not reported by the source — it does NOT mean a default applies, so a squat with no implement is not the same as a bodyweight squat. Axes describe the exercise as performed rather than each movement separately: in a step up to a deficit reverse lunge only the lunge is at a deficit, but the axis describes the whole exercise and exercise_name carries the detail.' primary_muscles: anyOf: - type: array items: $ref: '#/components/schemas/StrengthMuscle' - type: 'null' description: 'The muscles the exercise primarily works, as reported by the source. A list because providers differ: some name exactly one, some name several for the same exercise, and some name none. Empty means the source did not say, not that no muscle is worked. Open enum — handle unknown values gracefully.' secondary_muscles: anyOf: - type: array items: $ref: '#/components/schemas/StrengthMuscle' - type: 'null' description: The muscles the exercise works without being the focus, as reported by the source. Kept apart from primary_muscles because the distinction drives recovery and volume-per-muscle, which merging the two would lose. Empty means the source did not say. Open enum — handle unknown values gracefully. group_id: anyOf: - type: integer - type: 'null' examples: - 1 description: Exercises sharing a value were performed together, as a superset or circuit. Unique within this activity only. notes: anyOf: - type: string - type: 'null' description: The user's note on the exercise. rpe: anyOf: - type: number - type: 'null' examples: - 8.5 description: Effort for the exercise as a whole, on a 0-10 scale, when the source records it once per exercise rather than per set. source: anyOf: - $ref: '#/components/schemas/StrengthSource' - type: 'null' description: 'Where the exercise came from. Open enum — handle unknown values gracefully; the values in use today are user_logged, device_detected and unknown. Only user_logged is user-confirmed. Test for user_logged rather than testing against device_detected, so that a value added later is not trusted by default: anything that is not user_logged may have been inferred by a wearable and may be wrong, rep counts included.' sets: anyOf: - type: array items: $ref: '#/components/schemas/StrengthSet' - type: 'null' description: The performed sets, in order. ActivityStrengthData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: body_weight_kg: anyOf: - type: number - type: 'null' examples: - 78.2 description: The user's bodyweight at the time of the workout, when the source records it. Needed to value bodyweight-based sets, and frequently absent. exercises: anyOf: - type: array items: $ref: '#/components/schemas/StrengthExercise' - type: 'null' description: The exercises performed, in the order they were started. PowerSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. watts: anyOf: - type: number - type: 'null' examples: - 250 description: Power generated at a given instant in time, in Watts timer_duration_seconds: anyOf: - type: number - type: 'null' examples: - 1800 description: Time elapsed since the start of the workout, subtracting time during which the recording was paused PowerData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: avg_watts: anyOf: - type: number - type: 'null' examples: - 185 description: Average power output of the user during the workout. max_watts: anyOf: - type: number - type: 'null' examples: - 350 description: Maximum power output of the user during the workout. power_samples: anyOf: - type: array items: $ref: '#/components/schemas/PowerSample' - type: 'null' description: Array containing datapoints of the power output of the user sampled throughout the workout. StrainData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: strain_level: anyOf: - type: number - type: 'null' examples: - 14.5 description: Level of cardiovascular strain imposed on the user during the day. TSSSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: planned: anyOf: - type: number - type: 'null' description: Planned Training Stress Score value actual: anyOf: - type: number - type: 'null' description: Actual Training Stress Score value achieved method: anyOf: - type: string - type: 'null' description: Method used to calculate the TSS intensity_factor_planned: anyOf: - type: number - type: 'null' description: Planned intensity factor for the training session intensity_factor_actual: anyOf: - type: number - type: 'null' description: Actual intensity factor achieved during the training session normalized_power_watts: anyOf: - type: number - type: 'null' description: Normalized power output in watts TSSData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: TSS_samples: anyOf: - type: array items: $ref: '#/components/schemas/TSSSample' - type: 'null' description: Array of TSS information sampled throughout the workout WorkData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: work_kilojoules: anyOf: - type: number - type: 'null' examples: - 450.5 description: Total work output of the user for the workout, in kilojoules. BloodPressureSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. diastolic_bp: anyOf: - type: number - type: 'null' examples: - 80.5 description: User's diastolic blood pressure, in mmHg systolic_bp: anyOf: - type: number - type: 'null' examples: - 120.5 description: User's systolic blood pressure, in mmHg BloodPressureData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: blood_pressure_samples: anyOf: - type: array items: $ref: '#/components/schemas/BloodPressureSample' - type: 'null' description: List of Blood Pressure measurements sampled throughout the day. day_avg_systolic_bp: anyOf: - type: number - type: 'null' examples: - 120 description: Day-average systolic blood pressure, in mmHg. day_avg_diastolic_bp: anyOf: - type: number - type: 'null' examples: - 80 description: Day-average diastolic blood pressure, in mmHg. AFibFlag: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: AFib was not detected in the heart rhythm analysis. title: Negative - type: number const: 1 description: AFib was detected in the heart rhythm analysis. title: Positive - type: number const: 2 description: The heart rhythm analysis couldn't determine whether AFib was present or absent. title: Inconclusive examples: - 1 description: Flag indicating the atrial fibrillation classification of the individual AFibClassificationSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. afib_classification: anyOf: - $ref: '#/components/schemas/AFibFlag' - type: 'null' description: Flag indicating the atrial fibrillation classification of the individual RawECGSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: potential_uV: anyOf: - type: number - type: 'null' examples: - 1250.5 description: Potential uV in the RawECG Sample timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. ECGReading: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: start_timestamp: anyOf: - type: string - type: 'null' description: 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. avg_hr_bpm: anyOf: - type: number - type: 'null' examples: - 72.5 description: User's average heart rate throughout the day, in beats per minute (bpm). afib_classification: anyOf: - $ref: '#/components/schemas/AFibFlag' - type: 'null' description: User's afib classification throught the day. raw_signal: anyOf: - type: array items: $ref: '#/components/schemas/RawECGSample' - type: 'null' description: List of raw ECG readings sampled through the day. PulseVelocitySample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. pulse_wave_velocity_meters_per_second: anyOf: - type: number - type: 'null' examples: - 7.2 description: User's Pulse Wave Velocity measurement - velocity at which the blood pressure pulse propagates through the circulatory system RRIntervalSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: rr_interval_ms: anyOf: - type: number - type: 'null' examples: - 850 description: User's RR Interval for a specific heart beat in milliseconds. timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. hr_bpm: anyOf: - type: number - type: 'null' examples: - 72 description: The heart beat value at that specific instance. HeartData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: afib_classification_samples: anyOf: - type: array items: $ref: '#/components/schemas/AFibClassificationSample' - type: 'null' description: List of Atrial Fibrillation classification measurements sampled through the day. ecg_signal: anyOf: - type: array items: $ref: '#/components/schemas/ECGReading' - type: 'null' description: List of ECGReadings sampled through the day. heart_rate_data: anyOf: - $ref: '#/components/schemas/HeartRateData' - type: 'null' description: Object containing heart rate data. pulse_wave_velocity_samples: anyOf: - type: array items: $ref: '#/components/schemas/PulseVelocitySample' - type: 'null' description: 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. rr_interval_samples: anyOf: - type: array items: $ref: '#/components/schemas/RRIntervalSample' - type: 'null' description: List of RR Interval samples throughout the day. HydrationMeasurementSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. hydration_kg: anyOf: - type: number - type: 'null' examples: - 40 description: Total body water composition of the user, in kilograms. HydrationData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: day_total_water_consumption_ml: anyOf: - type: number - type: 'null' examples: - 2500 description: User's total water consumption throughout the day. hydration_amount_samples: anyOf: - type: array items: $ref: '#/components/schemas/HydrationMeasurementSample' - type: 'null' description: User's hydration level samples throughout the day. day_avg_hydration_kg: anyOf: - type: number - type: 'null' examples: - 42 description: Day-average body hydration, in kilograms. KetoneSampleType: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: The type of ketone sample is unknown or not specified. title: Unknown - type: number const: 1 description: Ketone sample taken from blood. title: Blood - type: number const: 2 description: Ketone sample taken from urine. title: Urine - type: number const: 3 description: Ketone sample taken from breath. title: Breath examples: - 1 description: Flag indicating the ketone sample type (e.g. blood, breath, urine) KetoneSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. ketone_mg_per_dL: anyOf: - type: number - type: 'null' examples: - 1.5 description: Ketone in mg per dL sample_type: anyOf: - $ref: '#/components/schemas/KetoneSampleType' - type: 'null' description: Flag indicating the ketone sample type (e.g. blood, breath, urine) KetoneData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: ketone_samples: anyOf: - type: array items: $ref: '#/components/schemas/KetoneSample' - type: 'null' description: List of ketone data sampled through the day. day_avg_ketone_mg_per_dL: anyOf: - type: number - type: 'null' examples: - 1.2 description: Day-average ketone concentration, in mg/dL. MeasurementDataSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: measurement_time: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. BMI: anyOf: - type: number - type: 'null' examples: - 22.4 description: User's Body Mass Index (BMI). BMR: anyOf: - type: number - type: 'null' examples: - 1800 description: User's Basal Metabolic Rate - minimum amount of calories that a person's body needs to perform necessary functions. RMR: anyOf: - type: number - type: 'null' examples: - 2000 description: 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. estimated_fitness_age: anyOf: - type: integer - type: 'null' examples: - 25 description: Estimate of how fit the user is compared to their actual age, as measured by the device. skin_fold_mm: anyOf: - type: number - type: 'null' examples: - 12.5 description: User's skin fold measurement. bodyfat_percentage: anyOf: - type: number - type: 'null' examples: - 18.5 minimum: 0 maximum: 100 description: User's body fat percentage. weight_kg: anyOf: - type: number - type: 'null' examples: - 75.5 description: User's body weight. height_cm: anyOf: - type: number - type: 'null' examples: - 178 description: User's height. bone_mass_g: anyOf: - type: number - type: 'null' examples: - 3200 description: User's total bone mass. muscle_mass_g: anyOf: - type: number - type: 'null' examples: - 35000 description: User's total muscle mass (i.e. skeletal muscle mass). lean_mass_g: anyOf: - type: number - type: 'null' examples: - 61500 description: Total lean mass of the user - calculated as the difference between total body weight and body fat weight. water_percentage: anyOf: - type: number - type: 'null' examples: - 60.5 minimum: 0 maximum: 100 description: Total amount of fluid in the user's body. water_mass_g: anyOf: - type: number - type: 'null' examples: - 38600 minimum: 0 description: Mass of fluid in the user's body. Reported instead of water_percentage by sources that measure water as a mass; converting between the two needs a total body weight, which is a separate reading and often absent. waist_circumference_cm: anyOf: - type: number - type: 'null' examples: - 84.5 minimum: 0 description: Circumference of the user's waist. insulin_units: anyOf: - type: number - type: 'null' examples: - 10.5 description: Quantity of insulin administered to the user. insulin_type: anyOf: - type: string - type: 'null' examples: - rapid-acting description: Type of insulin administered to the user. urine_color: anyOf: - type: string - type: 'null' examples: - pale yellow description: Color of the user's urine. user_notes: anyOf: - type: string - type: 'null' description: User notes associated with the measurement. visceral_fat_level: anyOf: - type: number - type: 'null' examples: - 8 description: Visceral fat level of the user. visceral_fat_category: anyOf: - type: string - type: 'null' examples: - normal description: Categorical visceral fat rating of the user. MeasurementsData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: measurements: anyOf: - type: array items: $ref: '#/components/schemas/MeasurementDataSample' - type: 'null' description: List of body metrics & measurements taken throughout the associated day. day_avg_bmi: anyOf: - type: number - type: 'null' examples: - 22.5 description: Day-average body mass index (BMI). day_avg_bmr: anyOf: - type: number - type: 'null' examples: - 1600 description: Day-average basal metabolic rate (BMR), in kilocalories. day_avg_rmr: anyOf: - type: number - type: 'null' examples: - 1500 description: Day-average resting metabolic rate (RMR), in kilocalories. day_avg_estimated_fitness_age: anyOf: - type: number - type: 'null' examples: - 30 description: Day-average estimated fitness age, in years. day_avg_skin_fold_mm: anyOf: - type: number - type: 'null' examples: - 12.5 description: Day-average skin fold thickness, in millimetres. day_avg_bodyfat_percentage: anyOf: - type: number - type: 'null' examples: - 18.2 description: Day-average body-fat percentage. day_avg_weight_kg: anyOf: - type: number - type: 'null' examples: - 70.5 description: Day-average weight, in kilograms. day_avg_height_cm: anyOf: - type: number - type: 'null' examples: - 175 description: Day-average height, in centimetres. day_avg_bone_mass_g: anyOf: - type: number - type: 'null' examples: - 3200 description: Day-average bone mass, in grams. day_avg_muscle_mass_g: anyOf: - type: number - type: 'null' examples: - 32000 description: Day-average muscle mass, in grams. day_avg_lean_mass_g: anyOf: - type: number - type: 'null' examples: - 55000 description: Day-average lean mass, in grams. day_avg_water_percentage: anyOf: - type: number - type: 'null' examples: - 55 description: Day-average body-water percentage. day_avg_insulin_units: anyOf: - type: number - type: 'null' examples: - 0 description: Day-average insulin, in units. day_avg_visceral_fat_level: anyOf: - type: number - type: 'null' examples: - 8 description: Day-average visceral fat level. BodyMetadata: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: end_time: type: string examples: - '2022-10-28T10:00:00.000000+01:00' description: 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. start_time: type: string examples: - '1999-11-23T09:00:00.000000+02:00' description: 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. timestamp_localization: anyOf: - $ref: '#/components/schemas/TimestampLocalization' - type: 'null' required: - end_time - start_time TemperatureSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. temperature_celsius: anyOf: - type: number - type: 'null' examples: - 37.2 description: Temperature value in degrees Celsius. TemperatureData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: ambient_temperature_samples: anyOf: - type: array items: $ref: '#/components/schemas/TemperatureSample' - type: 'null' description: List of ambient temperature measurements sampled throughout the day. body_temperature_samples: anyOf: - type: array items: $ref: '#/components/schemas/TemperatureSample' - type: 'null' description: List of body temperature measurements sampled throughout the day. skin_temperature_samples: anyOf: - type: array items: $ref: '#/components/schemas/TemperatureSample' - type: 'null' description: List of skin temperature measurements sampled throughout the day. day_avg_ambient_temperature_celsius: anyOf: - type: number - type: 'null' examples: - 21.5 description: Day-average ambient temperature, in degrees Celsius. day_avg_body_temperature_celsius: anyOf: - type: number - type: 'null' examples: - 36.7 description: Day-average body temperature, in degrees Celsius. day_avg_skin_temperature_celsius: anyOf: - type: number - type: 'null' examples: - 33.2 description: Day-average skin temperature, in degrees Celsius. GlucoseFlag: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: Blood glucose level is within the normal/healthy range. title: Normal - type: number const: 1 description: Blood glucose level is above the normal range (hyperglycemia). title: High - type: number const: 2 description: Blood glucose level is below the normal range (hypoglycemia). title: Low examples: - 1 description: Flag indicating state of user's blood glucose level TrendArrow: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: Glucose trend cannot be determined. title: Unknown - type: number const: 1 description: Glucose level is decreasing rapidly. title: Falling Quickly - type: number const: 2 description: Glucose level is decreasing gradually. title: Falling - type: number const: 3 description: Glucose level is remaining stable. title: Flat - type: number const: 4 description: Glucose level is increasing gradually. title: Rising - type: number const: 5 description: Glucose level is increasing rapidly. title: Rising Quickly examples: - 4 description: Flag indicating the current trend in the user's blood glucose level (e.g. rising, constant, falling) GlucoseDataSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. blood_glucose_mg_per_dL: anyOf: - type: number - type: 'null' examples: - 95 description: User's blood glucose reading glucose_level_flag: anyOf: - $ref: '#/components/schemas/GlucoseFlag' - type: 'null' description: Flag indicating state of user's blood glucose level trend_arrow: anyOf: - $ref: '#/components/schemas/TrendArrow' - type: 'null' description: Flag indicating the current trend in the user's blood glucose level (e.g. rising, constant, falling) DailyPatternSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: time_from_midnight: anyOf: - type: integer - type: 'null' examples: - 9 minimum: 0 maximum: 23 description: 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. percentile_5: anyOf: - type: number - type: 'null' description: Percentile 5 of the glucose level at the given time of day. percentile_25: anyOf: - type: number - type: 'null' description: Percentile 25 of the glucose level at the given time of day. percentile_50: anyOf: - type: number - type: 'null' description: Percentile 50 of the glucose level at the given time of day. percentile_75: anyOf: - type: number - type: 'null' description: Percentile 75 of the glucose level at the given time of day. percentile_95: anyOf: - type: number - type: 'null' description: Percentile 95 of the glucose level at the given time of day. GlucoseData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: blood_glucose_samples: anyOf: - type: array items: $ref: '#/components/schemas/GlucoseDataSample' - type: 'null' description: List of blood glucose readings sampled throughout the day. detailed_blood_glucose_samples: anyOf: - type: array items: $ref: '#/components/schemas/GlucoseDataSample' - type: 'null' description: 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. day_avg_blood_glucose_mg_per_dL: anyOf: - type: number - type: 'null' examples: - 92.5 description: User's average glucose level throughout the day. day_avg_detailed_blood_glucose_mg_per_dL: anyOf: - type: number - type: 'null' examples: - 91 description: User's average glucose level throughout the day, computed from the higher-frequency detailed sample stream. day_avg_blood_glucose_mg_per_dl: anyOf: - type: number - type: 'null' examples: - 92.5 description: Deprecated lower-case alias of day_avg_blood_glucose_mg_per_dL, retained for backwards compatibility. Always carries the same value as that field. deprecated: true gmi: anyOf: - type: number - type: 'null' description: 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. time_in_range: anyOf: - type: number - type: 'null' description: Time that the user's glucose is within acceptable range (not hyper or hypoglycemic). sensor_usage: anyOf: - type: integer - type: 'null' description: Number of data points recorded by the sensor throughout the day. daily_patterns: anyOf: - type: array items: $ref: '#/components/schemas/DailyPatternSample' - type: 'null' description: List of glucose percentile samples throughout the day. DailyDataEnrichment: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: total_stress_score: anyOf: - type: number - type: 'null' examples: - 45 description: Total stress score for the day. stress_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the stress score. respiratory_score: anyOf: - type: number - type: 'null' examples: - 88 description: Respiratory health score for the day. respiratory_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the respiratory score. immune_index: anyOf: - type: integer - type: 'null' examples: - 72 description: Immune system health index for the day. immune_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the immune index. resilience_score: anyOf: - type: integer - type: 'null' examples: - 65 description: Resilience score for the day. resilience_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the resilience score. strain_index: anyOf: - type: number - type: 'null' examples: - 12.5 description: Strain index for the day. strain_traffic_light: anyOf: - type: string - type: 'null' examples: - GREEN description: Categorical strain rating for the day (e.g. GREEN, AMBER, RED). strain_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the strain index. total_stress_score_v2: anyOf: - type: number - type: 'null' examples: - 43 description: Total stress score for the day, computed by the v2 model. total_stress_score_v2_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the v2 total stress score. $defs: RecordFloat: type: object properties: {} unevaluatedProperties: type: number MetricTrend: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: baseline: anyOf: - type: number - type: 'null' examples: - 52 description: Median of the trailing window, in the metric's own units (bpm, ms, seconds). average: anyOf: - type: number - type: 'null' examples: - 53.5 description: Mean of the trailing window. previous_average: anyOf: - type: number - type: 'null' examples: - 50 description: Mean of the window immediately preceding the trailing window. delta: anyOf: - type: number - type: 'null' examples: - 3.5 description: average minus previous_average. Present only when both averages are. days_with_data: type: integer minimum: -2147483648 maximum: 2147483647 examples: - 28 description: Number of days with data in the trailing window. previous_days_with_data: type: integer minimum: -2147483648 maximum: 2147483647 examples: - 30 description: Number of days with data in the preceding window. required: - days_with_data - previous_days_with_data description: Personal trend for one metric, computed by Terra from the user's own stored daily values. Both windows are trailing calendar-day windows that end the day BEFORE the record's own local day, so the record's value is never inside its own baseline. Statistics are absent (null) when the window has no data; the day counts say how much history stands behind each number. TrendsData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: window_days: type: integer minimum: -2147483648 maximum: 2147483647 examples: - 30 description: Length of each window in days. window_end: type: string examples: - '2026-09-15' description: 'Inclusive ISO date (yyyy-mm-dd) the trailing window ends on: the last completed local day before the record''s own.' resting_heart_rate: anyOf: - $ref: '#/components/schemas/MetricTrend' - type: 'null' description: 'Resting heart rate trend, in bpm. Source: daily summaries.' hrv_rmssd: anyOf: - $ref: '#/components/schemas/MetricTrend' - type: 'null' description: 'Heart-rate variability (RMSSD) trend, in ms. Source: sleep sessions.' hrv_sdnn: anyOf: - $ref: '#/components/schemas/MetricTrend' - type: 'null' description: 'Heart-rate variability (SDNN) trend, in ms. Source: sleep sessions. Apple Health reports SDNN rather than RMSSD.' sleep_duration: anyOf: - $ref: '#/components/schemas/MetricTrend' - type: 'null' description: 'Time asleep per session trend, in seconds (matches sleep_durations_data.asleep_time). Source: sleep sessions.' required: - window_days - window_end description: Personal baselines and trends for the user, as of the record. Present on sleep and daily payloads for customers with the trends product enabled; null otherwise. DailyDistanceData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: detailed: anyOf: - $ref: '#/components/schemas/DistanceDataDetailed' - type: 'null' description: Object containing detailed distance information - this may include second-by-second samples. distance_meters: anyOf: - type: number - type: 'null' examples: - 8500.45 description: Total distance covered by the user throughout the day. elevation: anyOf: - $ref: '#/components/schemas/ElevationData' - type: 'null' description: Object containing information on the elevation of the user throughout the day. floors_climbed: anyOf: - type: integer - type: 'null' examples: - 15 minimum: 0 description: Total number of elevation gain in floors climbed equivalent throughout the day, as determined by the fitness data provider. steps: anyOf: - type: integer - type: 'null' examples: - 12000 description: Total number of steps performed during the day. swimming: anyOf: - $ref: '#/components/schemas/SwimmingData' - type: 'null' description: Summary information of the user's swimming statistics for the day, if applicable. DailyMetadata: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: end_time: type: string examples: - '2022-10-28T10:00:00.000000+01:00' description: 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. start_time: type: string examples: - '1999-11-23T09:00:00.000000+02:00' description: 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. timestamp_localization: anyOf: - $ref: '#/components/schemas/TimestampLocalization' - type: 'null' upload_type: $ref: '#/components/schemas/UploadType' description: The upload type for data in the associated day, providing information on whether data was automatically uploaded or user-entered. If any data point in a day is altered, the day should be classed as manual. required: - end_time - start_time - upload_type ScoresData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: activity: anyOf: - type: number - type: 'null' examples: - 92 minimum: 0 maximum: 100 description: Activity score for the given day. recovery: anyOf: - type: number - type: 'null' examples: - 78 minimum: 0 maximum: 100 description: Recovery score for the given day. sleep: anyOf: - type: number - type: 'null' examples: - 85 minimum: 0 maximum: 100 description: Sleep score for the given day, pertaining to the previous night's sleep. StressSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. level: anyOf: - type: number - type: 'null' description: Stress level measurement at the given timestamp StressLevel: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: Stress level is unknown or could not be determined. title: Unknown - type: number const: 1 description: Very low stress level (range 1-25). title: Rest - type: number const: 2 description: Low stress level (range 26-50). title: Low - type: number const: 3 description: Moderate stress level (range 51-75). title: Medium - type: number const: 4 description: High stress level (range 76-100). title: High examples: - 3 description: Represents stress level ranges. BodyBatterySample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. level: anyOf: - type: number - type: 'null' description: Body battery energy level at the given timestamp StressData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: avg_stress_level: anyOf: - type: number - type: 'null' examples: - 45.5 description: Average stress level for the day. activity_stress_duration_seconds: anyOf: - type: number - type: 'null' examples: - 3600 minimum: 0 description: Total number of seconds spent in a stressed state while active during the day. low_stress_duration_seconds: anyOf: - type: number - type: 'null' examples: - 28800 minimum: 0 description: Total number of seconds spent in a state of low stress during the day. max_stress_level: anyOf: - type: number - type: 'null' examples: - 85 description: Maximum stress level recorded during the day. medium_stress_duration_seconds: anyOf: - type: number - type: 'null' examples: - 7200 minimum: 0 description: Total number of seconds spent in a state of medium stress during the day. samples: anyOf: - type: array items: $ref: '#/components/schemas/StressSample' - type: 'null' description: Array of stress level data points sampled throughout the day. rest_stress_duration_seconds: anyOf: - type: number - type: 'null' examples: - 1800 minimum: 0 description: Total number of seconds spent in a stressed state while at rest during the day. high_stress_duration_seconds: anyOf: - type: number - type: 'null' examples: - 900 minimum: 0 description: Total number of seconds spent in a state of high stress during the day. stress_duration_seconds: anyOf: - type: number - type: 'null' examples: - 5400 minimum: 0 description: Total number of seconds spent in any stressed state during the day. stress_rating: anyOf: - $ref: '#/components/schemas/StressLevel' - type: 'null' description: Stress rating for the day. body_battery_samples: anyOf: - type: array items: $ref: '#/components/schemas/BodyBatterySample' - type: 'null' description: Array of Body Battery data points sampled throughout the day. TagEntry: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: type: string examples: - '1999-11-23T09:00:00.000000+02:00' description: Time with which the tag 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. tag_name: type: string examples: - hot_shower description: Tag name, representing a certain event associated with the user's day. notes: type: string examples: - Felt refreshed after description: User-input notes associated with the given tag. required: - timestamp - tag_name - notes TagData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: tags: anyOf: - type: array items: $ref: '#/components/schemas/TagEntry' - type: 'null' description: Array of user-entered tags for the day. MenstruationMetadata: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: end_time: type: string examples: - '2022-10-28T10:00:00.000000+01:00' description: 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. start_time: type: string examples: - '1999-11-23T09:00:00.000000+02:00' description: 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. timestamp_localization: anyOf: - $ref: '#/components/schemas/TimestampLocalization' - type: 'null' required: - end_time - start_time MenstruationInterval: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: Cycle phase is unknown or could not be determined. title: Unknown - type: number const: 1 description: Menstrual bleeding (period) phase. title: Period - type: number const: 2 description: Follicular phase, when ovarian follicles develop. title: Follicular - type: number const: 3 description: Fertile window, when conception is most likely. title: Fertile Window - type: number const: 4 description: Ovulation phase, when an egg is released. title: Ovulation - type: number const: 5 description: Luteal phase, following ovulation. title: Luteal - type: number const: 6 description: Premenstrual syndrome phase before menstruation begins. title: PMS - type: number const: 7 description: First third of pregnancy, weeks 1-12. title: First Trimester - type: number const: 8 description: Middle third of pregnancy, weeks 13-26. title: Second Trimester - type: number const: 9 description: Final third of pregnancy, weeks 27-40. title: Third Trimester examples: - 1 description: Represents menstrual cycle phases. MenstruationFlow: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: Flow status is unknown or not recorded. title: Unknown - type: number const: 1 description: No menstrual flow present. title: None - type: number const: 2 description: Light menstrual flow. title: Light - type: number const: 3 description: Moderate menstrual flow. title: Medium - type: number const: 4 description: Heavy menstrual flow. title: Heavy - type: number const: 5 description: Menstrual flow occurred but intensity not specified. title: Had examples: - 4 description: Flag indicating the strength of the user's menstrual flow MenstruationFlowSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. flow: anyOf: - $ref: '#/components/schemas/MenstruationFlow' - type: 'null' description: Flag indicating the strength of the user's menstrual flow. MenstruationIntervalSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: start_timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: Start of the cycle-phase interval, in ISO8601 format. end_timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-28T09:00:00.000000+02:00' description: End of the cycle-phase interval, in ISO8601 format. phase: anyOf: - $ref: '#/components/schemas/MenstruationInterval' - type: 'null' description: Cycle phase covered by this interval. MenstruationData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: period_length_days: anyOf: - type: integer - type: 'null' examples: - 5 description: Total length of period (i.e. menstrual bleeding). current_phase: anyOf: - $ref: '#/components/schemas/MenstruationInterval' - type: 'null' description: Phase in associated cycle, (i.e. menstruation, fertile etc). length_of_current_phase_days: anyOf: - type: integer - type: 'null' examples: - 5 description: Length of current phase. days_until_next_phase: anyOf: - type: integer - type: 'null' examples: - 23 description: Number of days to reach the next phase (predicted). period_start_date: anyOf: - type: string - type: 'null' examples: - '2022-11-28' description: Start date of menstrual cycle, in ISO8601 format. predicted_cycle_length_days: anyOf: - type: integer - type: 'null' examples: - 28 description: Prediction of the cycle's total length. day_in_cycle: anyOf: - type: integer - type: 'null' examples: - 24 description: Number of day in cycle this object is associated with. last_updated_time: anyOf: - type: string - type: 'null' examples: - '2022-12-12T14:03:05.000000-05:00' description: Last time when the user recorded information regarding their cycle, in ISO8601 format, with microseconds precision. cycle_length_days: anyOf: - type: integer - type: 'null' examples: - 28 description: Total cycle length in days. is_predicted_cycle: anyOf: - type: boolean - type: 'null' examples: - true description: Flag indicating whether associated object is a prediction or user-logged information. menstruation_flow: anyOf: - type: array items: $ref: '#/components/schemas/MenstruationFlowSample' - type: 'null' description: List of user logs of information related to the strength of user's menstrual flow. intervals: anyOf: - type: array items: $ref: '#/components/schemas/MenstruationIntervalSample' - type: 'null' description: List of cycle phase intervals, each spanning a contiguous date range within the cycle. fertility_window_start: anyOf: - type: string - type: 'null' examples: - '2022-11-12' description: Start of the fertility window, in ISO8601 format. fertility_window_end: anyOf: - type: string - type: 'null' examples: - '2022-11-17' description: End of the fertility window, in ISO8601 format. ovulation_day: anyOf: - type: string - type: 'null' examples: - '2022-11-15' description: Predicted ovulation day, in ISO8601 format. NutritionUnits: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: The unit of measurement is unknown or not specified. title: Unknown - type: number const: 1 description: Measurement in grams, a metric unit of mass. title: Gram - type: number const: 2 description: Measurement in teaspoons, approximately 5 milliliters. title: Teaspoon - type: number const: 3 description: Measurement in tablespoons, approximately 15 milliliters. title: Tablespoon - type: number const: 4 description: Measurement in cups, approximately 240 milliliters. title: Cup - type: number const: 5 description: Quantity measured in medium-sized eggs. title: Medium Egg - type: number const: 6 description: Quantity measured in large-sized eggs. title: Large Egg - type: number const: 7 description: Quantity measured in small-sized eggs. title: Small Egg - type: number const: 8 description: Measurement in milliliters, a metric unit of volume. title: Milliliter - type: number const: 9 description: Measurement in ounces, approximately 28 grams. title: Ounce - type: number const: 10 description: Quantity measured by individual count or number of items. title: Count - type: number const: 11 description: Quantity measured in scoops, typically used for protein powder or supplements. title: Scoop - type: number const: 12 description: Measurement in fluid ounces, approximately 30 milliliters. title: Fluid Ounce examples: - 4 description: Represents units used for nutrition measurements DrinkSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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 drink_volume: anyOf: - type: number - type: 'null' examples: - 250 description: Volume of drink consumed drink_unit: anyOf: - $ref: '#/components/schemas/NutritionUnits' - type: 'null' description: Unit of measurement for the drink volume. drink_name: anyOf: - type: string - type: 'null' examples: - Water description: Name of drink consumed. NutritionMicros: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: biotin_mg: anyOf: - type: number - type: 'null' examples: - 0.03 description: Biotin content of the associated food(s). caffeine_mg: anyOf: - type: number - type: 'null' examples: - 95 description: Caffeine content of the associated food(s). calcium_mg: anyOf: - type: number - type: 'null' examples: - 1000 description: Calcium content of the associated food(s). sodium_mg: anyOf: - type: number - type: 'null' examples: - 2300 description: Sodium content of the associated food(s). chloride_mg: anyOf: - type: number - type: 'null' examples: - 2300 description: Chloride content of the associated food(s). chromium_mg: anyOf: - type: number - type: 'null' examples: - 0.035 description: Chromium content of the associated food(s). copper_mg: anyOf: - type: number - type: 'null' examples: - 0.9 description: Copper content of the associated food(s). folate_mg: anyOf: - type: number - type: 'null' examples: - 0.4 description: Folate content of the associated food(s). folic_acid_mg: anyOf: - type: number - type: 'null' examples: - 0.4 description: Folic Acid content of the associated food(s). iodine_mg: anyOf: - type: number - type: 'null' examples: - 0.15 description: Iodine content of the associated food(s). iron_mg: anyOf: - type: number - type: 'null' examples: - 8.5 description: Iron content of the associated food(s). magnesium_mg: anyOf: - type: number - type: 'null' examples: - 320 description: Magnesium content of the associated food(s). manganese_mg: anyOf: - type: number - type: 'null' examples: - 2.3 description: Manganese content of the associated food(s). molybdenum_mg: anyOf: - type: number - type: 'null' examples: - 0.045 description: Molybdenum content of the associated food(s). niacin_mg: anyOf: - type: number - type: 'null' examples: - 16 description: Niacin content of the associated food(s). pantothenic_acid_mg: anyOf: - type: number - type: 'null' examples: - 5 description: Pantothenic content of the associated food(s). phosphorus_mg: anyOf: - type: number - type: 'null' examples: - 1000 description: Phosphorus content of the associated food(s). potassium_mg: anyOf: - type: number - type: 'null' examples: - 3500 description: Potassium content of the associated food(s). riboflavin_mg: anyOf: - type: number - type: 'null' examples: - 1.3 description: Riboflavin content of the associated food(s). selenium_mg: anyOf: - type: number - type: 'null' examples: - 0.055 description: Selenium content of the associated food(s). thiamin_mg: anyOf: - type: number - type: 'null' examples: - 1.2 description: Thiamin content of the associated food(s). vitamin_A_mg: anyOf: - type: number - type: 'null' examples: - 0.9 description: Vitamin A content of the associated food(s). vitamin_B12_mg: anyOf: - type: number - type: 'null' examples: - 0.0024 description: Vitamin B12 content of the associated food(s). vitamin_B6_mg: anyOf: - type: number - type: 'null' examples: - 1.7 description: Vitamin B6 content of the associated food(s). vitamin_C_mg: anyOf: - type: number - type: 'null' examples: - 90 description: Vitamin C content of the associated food(s). vitamin_D_mg: anyOf: - type: number - type: 'null' examples: - 0.02 description: Vitamin D content of the associated food(s). vitamin_D2_mg: anyOf: - type: number - type: 'null' examples: - 0.01 description: Vitamin D2 content of the associated food(s). vitamin_D3_mg: anyOf: - type: number - type: 'null' examples: - 0.015 description: Vitamin D3 content of the associated food(s). vitamin_E_mg: anyOf: - type: number - type: 'null' examples: - 15 description: Vitamin E content of the associated food(s). vitamin_K_mg: anyOf: - type: number - type: 'null' examples: - 0.12 description: Vitamin K content of the associated food(s). zinc_mg: anyOf: - type: number - type: 'null' examples: - 11 description: Zinc content of the associated food(s). cystine_g: anyOf: - type: number - type: 'null' examples: - 0.3 description: Cystine content of the associated food(s). histidine_g: anyOf: - type: number - type: 'null' examples: - 0.6 description: Histidine content of the associated food(s). isoleucine_g: anyOf: - type: number - type: 'null' examples: - 0.8 description: Isoleucine content of the associated food(s). leucine_g: anyOf: - type: number - type: 'null' examples: - 1.2 description: Leucine content of the associated food(s). lysine_g: anyOf: - type: number - type: 'null' examples: - 0.9 description: Lysine content of the associated food(s). methionine_g: anyOf: - type: number - type: 'null' examples: - 0.6 description: Methionine content of the associated food(s). phenylalanine_g: anyOf: - type: number - type: 'null' examples: - 0.9 description: Phenylalanine content of the associated food(s). threonine_g: anyOf: - type: number - type: 'null' examples: - 0.5 description: Threonine content of the associated food(s). tryptophan_g: anyOf: - type: number - type: 'null' examples: - 0.3 description: Tryptophan content of the associated food(s). tyrosine_g: anyOf: - type: number - type: 'null' examples: - 0.7 description: Tyrosine content of the associated food(s). valine_g: anyOf: - type: number - type: 'null' examples: - 0.8 description: Valine content of the associated food(s). monounsaturated_fat_g: anyOf: - type: number - type: 'null' examples: - 15 description: Monounsaturated fat content of the associated food(s). polyunsaturated_fat_g: anyOf: - type: number - type: 'null' examples: - 13 description: Polyunsaturated fat content of the associated food(s). omega3_g: anyOf: - type: number - type: 'null' examples: - 1.6 description: Omega3 content of the associated food(s). omega6_g: anyOf: - type: number - type: 'null' examples: - 17 description: Omega6 content of the associated food(s). starch_g: anyOf: - type: number - type: 'null' examples: - 25 description: Starch content of the associated food(s). MealType: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: Meal type is unknown or could not be determined. title: Unknown - type: number const: 1 description: Meal consumed in the morning, typically the first meal of the day. title: Breakfast - type: number const: 2 description: Light meal or snack consumed in the morning, between breakfast and lunch. title: Morning Snack - type: number const: 3 description: Meal consumed around midday, typically the second meal of the day. title: Lunch - type: number const: 4 description: Light meal or snack consumed in the afternoon, between lunch and dinner. title: Afternoon Snack - type: number const: 5 description: Meal consumed in the evening, typically the last main meal of the day. title: Dinner - type: number const: 6 description: Any light meal or snack consumed at any time, not fitting into main meal categories. title: Snack examples: - 1 description: Enum representing the category the consumed food/meal falls under (i.e. Breakfast/Lunch/Dinner etc) NutritionQuantity: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: unit: $ref: '#/components/schemas/NutritionUnits' amount: type: number required: - unit - amount NutritionMacros: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: alcohol_g: anyOf: - type: number - type: 'null' examples: - 14 description: Alcohol content of the associated food(s). calories: anyOf: - type: number - type: 'null' examples: - 2000 description: Calorie content of the associated food(s). carbohydrates_g: anyOf: - type: number - type: 'null' examples: - 300 description: Carbohydrates content of the associated food(s). cholesterol_mg: anyOf: - type: number - type: 'null' examples: - 300 description: Cholesterol content of the associated food(s). fat_g: anyOf: - type: number - type: 'null' examples: - 65 description: Fat content of the associated food(s). fiber_g: anyOf: - type: number - type: 'null' examples: - 25 description: Fiber content of the associated food(s). net_carbohydrates_g: anyOf: - type: number - type: 'null' examples: - 275 description: Net carbs content of the associated food(s). protein_g: anyOf: - type: number - type: 'null' examples: - 50 description: Protein content of the associated food(s). saturated_fat_g: anyOf: - type: number - type: 'null' examples: - 20 description: Saturated fat content of the associated food(s). sodium_mg: anyOf: - type: number - type: 'null' examples: - 2300 description: Sodium content of the associated food(s). sugar_g: anyOf: - type: number - type: 'null' examples: - 25 description: Sugar content of the associated food(s). trans_fat_g: anyOf: - type: number - type: 'null' examples: - 2 description: Trans fat content of the associated food(s). Meal: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: micros: $ref: '#/components/schemas/NutritionMicros' description: Micronutrient information for associated food. type: $ref: '#/components/schemas/MealType' description: Enum representing the category the consumed food/meal falls under (i.e. Breakfast/Lunch/Dinner etc). id: type: string examples: - food_123 description: Identifier for food logged by the user. timestamp: type: string examples: - '2022-12-12T08:53:00.000000+02:00' description: Timestamp the food is associated with, in ISO8601 format, with microsecond precision. quantity: $ref: '#/components/schemas/NutritionQuantity' description: Quantity of the food that was consumed, containing information on amount & units in which this was recorded. name: type: string examples: - Oatmeal description: Name of food logged by the user. macros: $ref: '#/components/schemas/NutritionMacros' description: Macronutrient information for associated food. required: - micros - type - id - timestamp - quantity - name - macros NutritionMetadata: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: end_time: type: string examples: - '2022-10-28T10:00:00.000000+01:00' description: 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. start_time: type: string examples: - '1999-11-23T09:00:00.000000+02:00' description: 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. timestamp_localization: anyOf: - $ref: '#/components/schemas/TimestampLocalization' - type: 'null' required: - end_time - start_time NutritionSummary: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: macros: anyOf: - $ref: '#/components/schemas/NutritionMacros' - type: 'null' description: Summary of macronutrient information for a given day. micros: anyOf: - $ref: '#/components/schemas/NutritionMicros' - type: 'null' description: Summary of micronutrient information for a given day. water_ml: anyOf: - type: number - type: 'null' examples: - 2000 description: Water consumption of the user for a given day. drink_ml: anyOf: - type: number - type: 'null' examples: - 500 description: Non-water drink consumption of the user for a given day. SleepDataEnrichment: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: sleep_score: anyOf: - type: number - type: 'null' examples: - 85 description: Sleep score for the session. sleep_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the sleep score. readiness_score: anyOf: - type: number - type: 'null' examples: - 82 description: Readiness score resulting from the sleep session. readiness_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the readiness score. sleep_score_v2: anyOf: - type: number - type: 'null' examples: - 84 description: Sleep score for the session, computed by the v2 model. sleep_score_v2_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the v2 sleep score. respiratory_score_v2: anyOf: - type: number - type: 'null' examples: - 90 description: Respiratory score for the session, computed by the v2 model. respiratory_score_v2_contributors: anyOf: - $ref: '#/components/schemas/RecordFloat' - type: 'null' description: Map of contributing factor name to its weighted contribution to the v2 respiratory score. $defs: RecordFloat: type: object properties: {} unevaluatedProperties: type: number SleepUploadType: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: The sleep data upload type is unknown or could not be determined. title: Unknown - type: number const: 1 description: The sleep data was manually entered by the user. title: Manual - type: number const: 2 description: The sleep data was automatically detected and recorded by a device or service. title: Automatic - type: number const: 3 description: The sleep data is preliminary or tentative and may be subject to change. title: Tentative - type: number const: 4 description: The sleep data upload type cannot be clearly categorized. title: Indeterminate examples: - 1 description: The upload type for the associated workout, providing information on whether this was an automatic workout or user-entered SleepMetadata: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: end_time: type: string examples: - '2022-11-24T08:00:00.000000+01:00' description: The end time of the associated sleep session, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time. is_nap: anyOf: - type: boolean - type: 'null' examples: - false description: Flag indicating whether the sleep session was a nap, or the user's main sleep session for the day. start_time: type: string examples: - '1999-11-23T22:00:00.000000+02:00' description: The start time of the associated sleep session, 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. summary_id: anyOf: - type: string - type: 'null' description: A unique identifier for the sleep session. timestamp_localization: anyOf: - $ref: '#/components/schemas/TimestampLocalization' - type: 'null' upload_type: $ref: '#/components/schemas/SleepUploadType' description: The upload type for the associated sleep session, providing information on whether this was an automatic sleep or user-entered. required: - end_time - start_time - upload_type ReadinessData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: readiness: anyOf: - type: number - type: 'null' examples: - 85 minimum: 0 maximum: 100 description: User's readiness score for a given day, resulting from the sleep session. recovery_level: anyOf: - type: number - type: 'null' description: User's recovery score for a given day, resulting from the sleep session. BreathSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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 breaths_per_min: anyOf: - type: number - type: 'null' examples: - 16 description: User's respiration rate BreathsData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: avg_breaths_per_min: anyOf: - type: number - type: 'null' examples: - 14 description: Average breathing rate of the user during the sleep session. max_breaths_per_min: anyOf: - type: number - type: 'null' examples: - 18 description: Maximum breathing rate of the user during the sleep session. min_breaths_per_min: anyOf: - type: number - type: 'null' examples: - 10 description: Minimum breathing rate of the user during the sleep session. on_demand_reading: anyOf: - type: boolean - type: 'null' examples: - false description: Flag indicating if the reading was performed on demand, or if it was automatically captured by the device. samples: anyOf: - type: array items: $ref: '#/components/schemas/BreathSample' - type: 'null' description: List of breathing rate information sampled throughout the sleep session. start_time: anyOf: - type: string - type: 'null' examples: - '1999-11-23T22:00:00.000000+02:00' description: The start time of the recording of breathing rate data, 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. end_time: anyOf: - type: string - type: 'null' examples: - '2022-11-24T08:00:00.000000+01:00' description: The end time of the recording of breathing rate data, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time. OxygenSaturationData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: avg_saturation_percentage: anyOf: - type: number - type: 'null' examples: - 97 description: Average Oxygen Saturation percentage of the user during the sleep session. end_time: anyOf: - type: string - type: 'null' examples: - '2022-11-24T08:00:00.000000+01:00' description: The end time of the recording of oxygen saturation, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time. samples: anyOf: - type: array items: $ref: '#/components/schemas/OxygenSaturationSample' - type: 'null' description: Array of Oxygen Saturation percentage datapoints sampled throughout the sleep session. start_time: anyOf: - type: string - type: 'null' examples: - '1999-11-23T22:00:00.000000+02:00' description: The start time of the recording of oxygen saturation, 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. SnoringSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. duration_seconds: anyOf: - type: number - type: 'null' examples: - 120 description: Duration of snoring episode, in seconds SnoringData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: start_time: anyOf: - type: string - type: 'null' examples: - '1999-11-23T22:00:00.000000+02:00' description: The start time of the recording of snoring data, 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. end_time: anyOf: - type: string - type: 'null' examples: - '2022-11-24T08:00:00.000000+01:00' description: The end time of the recording of snoring data, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time. num_snoring_events: anyOf: - type: integer - type: 'null' examples: - 12 description: Number of times over the sleep period when the user started snoring, as determined by the device. samples: anyOf: - type: array items: $ref: '#/components/schemas/SnoringSample' - type: 'null' description: List of snoring information data points sampled throughout the sleep session. total_snoring_duration_seconds: anyOf: - type: number - type: 'null' examples: - 3600 description: Total duration for which the user was snoring. RespirationData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: breaths_data: anyOf: - $ref: '#/components/schemas/BreathsData' - type: 'null' description: Object containing information on breathing rate for the sleep session. oxygen_saturation_data: anyOf: - $ref: '#/components/schemas/OxygenSaturationData' - type: 'null' description: Object containing information on saturation metrics for the sleep session. snoring_data: anyOf: - $ref: '#/components/schemas/SnoringData' - type: 'null' description: Object containing information on snoring metrics for the sleep session. SleepScores: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: sleep: anyOf: - type: number - type: 'null' examples: - 85 description: User's sleep score for the session. AsleepDurations: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: duration_asleep_state_seconds: anyOf: - type: number - type: 'null' examples: - 25200 description: Total duration for which the user was asleep, in any state. duration_deep_sleep_state_seconds: anyOf: - type: number - type: 'null' examples: - 5400 description: Total duration for which the user was in a state of deep sleep. duration_light_sleep_state_seconds: anyOf: - type: number - type: 'null' examples: - 14400 description: Total duration for which the user was in a state of light sleep. duration_REM_sleep_state_seconds: anyOf: - type: number - type: 'null' examples: - 5400 description: Total duration for which the user was in a state of REM sleep. num_REM_events: anyOf: - type: integer - type: 'null' examples: - 4 description: Number of periods of REM sleep captured during the sleep session. AwakeDurations: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: duration_awake_state_seconds: anyOf: - type: number - type: 'null' examples: - 1200 description: Total duration for which the user was awake during the sleep session. duration_long_interruption_seconds: anyOf: - type: number - type: 'null' examples: - 600 description: Total duration for which the user was awake during the sleep session, when the interruption of their sleep was greater than 90 seconds. duration_short_interruption_seconds: anyOf: - type: number - type: 'null' examples: - 180 description: Total duration for which the user was awake during the sleep session, when the interruption of their sleep was less than 90 seconds. num_out_of_bed_events: anyOf: - type: integer - type: 'null' examples: - 1 description: Number of times the user got out of bed during the sleep session. num_wakeup_events: anyOf: - type: integer - type: 'null' examples: - 3 description: Number of times the user woke up during the sleep session. sleep_latency_seconds: anyOf: - type: number - type: 'null' examples: - 900 description: Sleep latency, defined as time between the moment the user lays in bed with the intention to sleep and the moment they actually fall asleep. wake_up_latency_seconds: anyOf: - type: number - type: 'null' examples: - 300 description: Wake up latency, defined as time between the moment the user wakes up and the moment they get out of bed. SleepLevel: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: Sleep level is unknown or could not be determined. title: Unknown - type: number const: 1 description: User is awake during the sleep session. title: Awake - type: number const: 2 description: User is in a general sleep state. title: Sleeping - type: number const: 3 description: User has left the bed during a sleep session. title: Out of bed - type: number const: 4 description: User is in light sleep stage. title: Light sleep - type: number const: 5 description: User is in deep sleep stage. title: Deep sleep - type: number const: 6 description: User is in REM sleep stage. title: REM sleep examples: - 2 description: Represents the sleep level of the user during a sleep session, indicating the depth and quality of sleep SleepHypnogramSample: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: timestamp: anyOf: - type: string - type: 'null' examples: - '2022-11-23T09:00:00.000000+02:00' description: 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. level: anyOf: - $ref: '#/components/schemas/SleepLevel' - type: 'null' OtherSleepDurations: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: duration_in_bed_seconds: anyOf: - type: number - type: 'null' examples: - 28800 description: Total duration of time spent in bed. duration_unmeasurable_sleep_seconds: anyOf: - type: number - type: 'null' examples: - 300 description: Total duration during which the user's state (awake, asleep, REM, etc) was unmeasurable during the sleep session. SleepDurationsData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: asleep: anyOf: - $ref: '#/components/schemas/AsleepDurations' - type: 'null' description: Object containing information on the duration the user spent asleep during the sleep recording session. awake: anyOf: - $ref: '#/components/schemas/AwakeDurations' - type: 'null' description: Object containing information on the duration the user spent awake during the sleep recording session. hypnogram_samples: anyOf: - type: array items: $ref: '#/components/schemas/SleepHypnogramSample' - type: 'null' description: List of sleep stage (Hypnogram) samples recorded during the user's sleep session. other: anyOf: - $ref: '#/components/schemas/OtherSleepDurations' - type: 'null' description: Object containing information on the miscellaneous duration data for the sleep recording session. sleep_efficiency: anyOf: - type: number - type: 'null' examples: - 87.5 minimum: 0 maximum: 100 description: Sleep efficiency of the user given as a percentage, measured as time spent asleep divided by time spent in bed. SleepTemperatureData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: delta: anyOf: - type: number - type: 'null' examples: - 0.5 description: Variation in user's skin temperature from their baseline. avg_skin_temperature_celsius: anyOf: - type: number - type: 'null' examples: - 33.7 description: Mean absolute skin temperature in degrees Celsius over the sleep window. Null for providers that only report a baseline deviation. EnvironmentType: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: indoor - type: string const: outdoor - type: string const: pool description: Environment a workout takes place in CompletionConditionType: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: time - type: string const: distance - type: string const: hr - type: string const: calories - type: string const: open - type: string const: power - type: string const: reps - type: string const: hr_percentage - type: string const: power_percentage - type: string const: hr_less_than - type: string const: hr_greater_than - type: string const: hr_percentage_less_than - type: string const: hr_percentage_greater_than - type: string const: power_less_than - type: string const: power_greater_than - type: string const: power_percentage_less_than - type: string const: power_percentage_greater_than description: How a step or block is considered complete CompletionCondition: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: $ref: '#/components/schemas/CompletionConditionType' value: anyOf: - type: number - type: 'null' description: Single value for the condition (e.g. seconds for time, meters for distance) value_low: anyOf: - type: number - type: 'null' description: Lower bound when the condition is a range value_high: anyOf: - type: number - type: 'null' description: Upper bound when the condition is a range required: - type description: Condition that completes a step or repeats a step block WorkoutStepTargetType: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: speed - type: string const: heart_rate - type: string const: open - type: string const: cadence - type: string const: power - type: string const: swim_stroke - type: string const: speed_lap - type: string const: heart_rate_lap - type: string const: pace - type: string const: heart_rate_threshold_percentage - type: string const: heart_rate_max_percentage - type: string const: speed_percentage - type: string const: power_percentage - type: string const: repetition - type: string const: tss - type: string const: if - type: string const: rpe - type: string const: heart_rate_zone - type: string const: power_zone description: Quantity an intensity target constrains IntensityTarget: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: target_type: $ref: '#/components/schemas/WorkoutStepTargetType' value: anyOf: - type: number - type: 'null' description: Single target value value_low: anyOf: - type: number - type: 'null' description: Lower bound of the target range value_high: anyOf: - type: number - type: 'null' description: Upper bound of the target range required: - target_type description: Target intensity range for a step (e.g. heart-rate or power zone) WorkoutStepIntensity: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: rest - type: string const: warmup - type: string const: cooldown - type: string const: recovery - type: string const: active description: Intensity classification of a workout step StepControlType: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: grade - type: string const: resistance description: Equipment control adjusted during a step (e.g. treadmill incline) StepControl: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: $ref: '#/components/schemas/StepControlType' value: type: number description: Control value (e.g. 0.02 for a 2% treadmill grade) required: - type - value description: Equipment control applied during a step WeightUnit: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: kg - type: string const: lbs description: Weight display unit for strength exercises StrengthData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: exercise_name: anyOf: - type: string - type: 'null' description: Display name of the exercise weight: anyOf: - type: number - type: 'null' description: Weight to lift weight_display_unit: anyOf: - $ref: '#/components/schemas/WeightUnit' - type: 'null' exercise_category: anyOf: - type: string - type: 'null' description: Garmin Training API exerciseCategory string (e.g. BENCH_PRESS, SQUAT) description: Strength-exercise details for a step SwimStrokeType: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: backstroke - type: string const: breaststroke - type: string const: drill - type: string const: butterfly - type: string const: freestyle - type: string const: mixed - type: string const: im description: Swim stroke for a swimming step DrillType: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: kick - type: string const: pull - type: string const: drill description: Swim drill type SwimEquipmentType: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: none - type: string const: swim_fins - type: string const: swim_kickboard - type: string const: swim_paddles - type: string const: swim_pull_buoy - type: string const: swim_snorkel description: Swim equipment used during a step SwimStepData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: stroke_type: anyOf: - $ref: '#/components/schemas/SwimStrokeType' - type: 'null' drill_type: anyOf: - $ref: '#/components/schemas/DrillType' - type: 'null' equipment: anyOf: - type: array items: $ref: '#/components/schemas/SwimEquipmentType' - type: 'null' description: Swimming details for a step WorkoutStep: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: completion_condition: $ref: '#/components/schemas/CompletionCondition' description: When this step completes intensity_targets: anyOf: - type: array items: $ref: '#/components/schemas/IntensityTarget' - type: 'null' description: Intensity targets to hold during the step intensity_type: $ref: '#/components/schemas/WorkoutStepIntensity' notes: anyOf: - type: string - type: 'null' description: Free-text coaching notes shown to the athlete controls: anyOf: - type: array items: $ref: '#/components/schemas/StepControl' - type: 'null' description: Equipment controls applied during the step strength: anyOf: - $ref: '#/components/schemas/StrengthData' - type: 'null' swimming: anyOf: - $ref: '#/components/schemas/SwimStepData' - type: 'null' required: - completion_condition - intensity_type description: A single step within a step block StepBlock: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: completion_condition: $ref: '#/components/schemas/CompletionCondition' description: When this block completes (e.g. repeat count via reps) steps: type: array items: $ref: '#/components/schemas/WorkoutStep' required: - completion_condition - steps description: A block of steps, repeated until its completion condition is met WorkoutSport: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - type: string const: running - type: string const: cycling - type: string const: swimming - type: string const: strength - type: string const: rowing - type: string const: yoga - type: string const: pilates - type: string const: cardio - type: string const: trail_running - type: string const: mountain_biking - type: string const: backcountry_skiing - type: string const: hiking - type: string const: walking - type: string const: elliptical - type: string const: stair_climbing description: Sport a workout template targets. Indoor/outdoor is expressed separately via environment. AthleteMetrics: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: threshold_heart_rate: anyOf: - type: number - type: 'null' description: Threshold heart rate in BPM max_heart_rate: anyOf: - type: number - type: 'null' description: Maximum heart rate in BPM threshold_speed: anyOf: - type: number - type: 'null' description: Threshold speed in m/s ftp: anyOf: - type: number - type: 'null' description: Functional Threshold Power in watts pool_length_meters: anyOf: - type: number - type: 'null' description: Pool length in meters (overrides the template value) description: Athlete-specific metrics used to personalise workout targets for one planned workout PlannedWorkoutSport: $schema: https://json-schema.org/draft/2020-12/schema anyOf: - $ref: '#/components/schemas/WorkoutSport' - type: string const: unspecified description: 'Sport of a provider-created workout: a WorkoutSport, or `unspecified` when the provider''s sport has no Terra equivalent (rejected on create).' PlannedWorkoutDetailsMetadata: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: id: anyOf: - type: string - type: 'null' description: Identifier of the workout on the provider's side provider: anyOf: - type: string - type: 'null' description: Provider the workout was fetched from name: anyOf: - type: string - type: 'null' description: Workout title description: anyOf: - type: string - type: 'null' description: Workout description, when the provider exposes one type: anyOf: - type: integer minimum: -2147483648 maximum: 2147483647 - type: 'null' description: Numeric activity type of the workout planned_date: anyOf: - type: string - type: 'null' description: Scheduled date (YYYY-MM-DD), matching the list item's planned_date created_date: anyOf: - type: string - type: 'null' description: Creation time on the provider's side (RFC 3339) estimated_tss: anyOf: - type: number - type: 'null' description: Planned Training Stress Score estimated_if: anyOf: - type: number - type: 'null' description: Planned Intensity Factor estimated_duration_seconds: anyOf: - type: number - type: 'null' estimated_distance_meters: anyOf: - type: number - type: 'null' estimated_calories: anyOf: - type: number - type: 'null' estimated_elevation_gain_meters: anyOf: - type: number - type: 'null' estimated_energy_kj: anyOf: - type: number - type: 'null' estimated_speed_meters_per_second: anyOf: - type: number - type: 'null' pool_length_meters: anyOf: - type: number - type: 'null' description: Summary metadata of a provider-side planned workout PlannedWorkoutDetailsStepDuration: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: duration_type: type: integer minimum: -2147483648 maximum: 2147483647 seconds: anyOf: - type: number - type: 'null' distance_meters: anyOf: - type: number - type: 'null' hr_below_bpm: anyOf: - type: number - type: 'null' hr_above_bpm: anyOf: - type: number - type: 'null' calories: anyOf: - type: number - type: 'null' power_below_watts: anyOf: - type: number - type: 'null' power_above_watts: anyOf: - type: number - type: 'null' reps: anyOf: - type: number - type: 'null' rest_seconds: anyOf: - type: number - type: 'null' steps: anyOf: - type: number - type: 'null' required: - duration_type description: Completion condition of a provider planned-workout step PlannedWorkoutDetailsStepTarget: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: target_type: type: integer minimum: -2147483648 maximum: 2147483647 hr_bpm_high: anyOf: - type: number - type: 'null' hr_bpm_low: anyOf: - type: number - type: 'null' cadence: anyOf: - type: number - type: 'null' cadence_high: anyOf: - type: number - type: 'null' cadence_low: anyOf: - type: number - type: 'null' power_watt: anyOf: - type: number - type: 'null' power_watt_high: anyOf: - type: number - type: 'null' power_watt_low: anyOf: - type: number - type: 'null' swim_strokes: anyOf: - type: number - type: 'null' hr_percentage: anyOf: - type: number - type: 'null' hr_percentage_high: anyOf: - type: number - type: 'null' hr_percentage_low: anyOf: - type: number - type: 'null' speed_percentage: anyOf: - type: number - type: 'null' speed_percentage_high: anyOf: - type: number - type: 'null' speed_percentage_low: anyOf: - type: number - type: 'null' power_percentage: anyOf: - type: number - type: 'null' power_percentage_high: anyOf: - type: number - type: 'null' power_percentage_low: anyOf: - type: number - type: 'null' repetitions: anyOf: - type: integer minimum: -2147483648 maximum: 2147483647 - type: 'null' speed_meters_per_second: anyOf: - type: number - type: 'null' speed_meters_per_second_low: anyOf: - type: number - type: 'null' speed_meters_per_second_high: anyOf: - type: number - type: 'null' required: - target_type description: Intensity target of a provider planned-workout step PlannedWorkoutDetailsStep: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: order: anyOf: - type: integer minimum: -2147483648 maximum: 2147483647 - type: 'null' name: anyOf: - type: string - type: 'null' description: anyOf: - type: string - type: 'null' intensity: anyOf: - type: integer minimum: -2147483648 maximum: 2147483647 - type: 'null' description: Numeric step intensity class type: anyOf: - type: integer minimum: -2147483648 maximum: 2147483647 - type: 'null' description: 0 = step, 1 = repetition block durations: anyOf: - type: array items: $ref: '#/components/schemas/PlannedWorkoutDetailsStepDuration' - type: 'null' targets: anyOf: - type: array items: $ref: '#/components/schemas/PlannedWorkoutDetailsStepTarget' - type: 'null' stroke_type: anyOf: - type: integer minimum: -2147483648 maximum: 2147483647 - type: 'null' equipment_type: anyOf: - type: array items: type: integer minimum: -2147483648 maximum: 2147483647 - type: 'null' exercise_name: anyOf: - type: string - type: 'null' exercise_category: anyOf: - type: integer minimum: -2147483648 maximum: 2147483647 - type: 'null' weight_kg: anyOf: - type: number - type: 'null' steps: anyOf: - type: array items: $ref: '#/components/schemas/PlannedWorkoutDetailsStep' - type: 'null' description: Child steps of a repetition block description: A step of a provider-side planned workout PlannedWorkoutDetails: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: metadata: anyOf: - $ref: '#/components/schemas/PlannedWorkoutDetailsMetadata' - type: 'null' steps: anyOf: - type: array items: $ref: '#/components/schemas/PlannedWorkoutDetailsStep' - type: 'null' description: Structured steps of the workout, when the provider exposes them description: Full body of a provider-side planned workout, fetched live from the provider. Present only on external planned workouts (is_external true), which have no Terra workout template. PlannedWorkout: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: planned_workout_id: anyOf: - type: string - type: 'null' description: Terra identifier of the planned workout. Null for workouts created on the provider side. workout_id: anyOf: - type: string - type: 'null' description: Identifier of the workout template this was planned from. Null for workouts created on the provider side; a non-null value means the workout is managed through Terra and can be rescheduled or deleted. planned_date: type: string description: Scheduled date (YYYY-MM-DD) provider_workout_id: anyOf: - type: string - type: 'null' description: Identifier of the workout on the provider's side, in the form the provider's own API uses for it coercion_warnings: anyOf: - type: string - type: 'null' description: 'Deprecated: the stored JSON text of the adjustments made when the template was pushed to the provider; use `warnings`. Null when there were none or the workout was created on the provider side.' deprecated: true warnings: type: array items: $ref: '#/components/schemas/CoercionWarning' description: Adjustments made while converting between Terra's template and the provider's format. On Terra-created workouts these come from the push to the provider; on external workouts, from reading the provider's workout into a template. Empty when the conversion was exact. created_at: anyOf: - type: string - type: 'null' description: Creation time (RFC 3339). Null for external workouts. last_updated_at: anyOf: - type: string - type: 'null' description: Last update time (RFC 3339). Null for external workouts. is_external: type: boolean description: True when the workout was created on the provider side rather than through Terra completed_at: anyOf: - type: string - type: 'null' description: Time the session was reported complete by the user's device (RFC 3339, whole seconds, UTC). Null until a device reports it. athlete_metrics: anyOf: - $ref: '#/components/schemas/AthleteMetrics' - type: 'null' workout: anyOf: - $ref: '#/components/schemas/PlannedWorkoutBody' - type: 'null' description: The workout body, in the same shape for Terra-created and external workouts. Null when a Terra-created workout's body could not be loaded (a warning at path `workout` says why); for an external workout whose steps could not be fetched from the provider, the header fields are present, `step_blocks` is empty and a warning at path `step_blocks` says why. details: anyOf: - $ref: '#/components/schemas/PlannedWorkoutDetails' - type: 'null' description: Deprecated. The provider body of an external workout in its pre-template shape; use `workout`. Null on Terra-created workouts. Removed in the next major SDK release. deprecated: true required: - planned_workout_id - workout_id - planned_date - provider_workout_id - coercion_warnings - warnings - created_at - last_updated_at - is_external - completed_at - athlete_metrics - workout - details description: A workout scheduled onto a user's calendar, whether created through Terra or on the provider side ReportType: $schema: https://json-schema.org/draft/2020-12/schema type: string enum: - lab - dexa - unspecified description: Returned by the upload endpoint. A single upload may fan out to multiple sessions. AnatomicalRegion: $schema: https://json-schema.org/draft/2020-12/schema type: string enum: - head - arms - arm_left - arm_right - legs - leg_left - leg_right - trunk - trunk_left - trunk_right - android - gynoid - vat - ribs - ribs_left - ribs_right - spine - spine_thoracic - spine_lumbar - pelvis - subtotal - total - total_left - total_right - whole_body - l1 - l2 - l3 - l4 - l1_l2 - l1_l3 - l1_l4 - l2_l3 - l2_l4 - l3_l4 - femur_neck - femur_neck_left - femur_neck_right - femur_trochanter - femur_trochanter_left - femur_trochanter_right - femur_intertrochanter - femur_intertrochanter_left - femur_intertrochanter_right - femur_wards - femur_wards_left - femur_wards_right - femur_total - femur_total_left - femur_total_right - femur_dual_total - radius_ultradistal - radius_ultradistal_left - radius_ultradistal_right - radius_mid - radius_mid_left - radius_mid_right - radius_33 - radius_33_left - radius_33_right - forearm_total - forearm_total_left - forearm_total_right description: 'Canonical anatomical site keys for site-scoped (DXA) results. Closed vocabulary: the extractor may only emit a member of this set, and anything else is discarded before storage. Ordered anatomy-first, laterality-last, so a prefix match ("femur_neck") is a valid family query.' WebhookEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string description: The type of event status: anyOf: - type: string - type: 'null' description: Status of the event required: - type description: Base webhook event structure that all events extend from AuthSuccessEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: auth status: type: string const: success description: Status of authentication user: $ref: '#/components/schemas/TerraUser' description: User who authenticated message: anyOf: - type: string - type: 'null' description: Human-readable confirmation message flow_id: anyOf: - type: string - type: 'null' description: Identifier of the authentication flow that completed widget_session_id: anyOf: - type: string - type: 'null' description: Widget session identifier required: - type - status - user allOf: - $ref: '#/components/schemas/WebhookEvent' description: Authentication success event AuthErrorEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: auth_cancelled status: type: string const: error description: Status of authentication flow_id: anyOf: - type: string - type: 'null' description: Identifier of the authentication flow that failed reason: anyOf: - type: string - type: 'null' description: Reason for the error reference_id: anyOf: - type: string - type: 'null' description: Client-provided reference ID required: - type - status allOf: - $ref: '#/components/schemas/WebhookEvent' description: Authentication error event, sent when an authentication flow fails or is cancelled DeauthEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: deauth user: $ref: '#/components/schemas/TerraUser' description: User who deauthenticated status: type: string const: success description: Status of deauthentication message: type: string description: Confirmation message required: - type - user - status - message allOf: - $ref: '#/components/schemas/WebhookEvent' description: User deauthentication event UserReauthEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: user_reauth new_user: $ref: '#/components/schemas/TerraUser' description: The new user record old_user: anyOf: - $ref: '#/components/schemas/TerraUser' - type: 'null' description: The old user record that will be deleted, when available status: type: string const: warning description: Status of the re-authentication message: type: string description: Information about the re-authentication version: type: string examples: - '2022-03-16' description: Payload schema version required: - type - new_user - status - message allOf: - $ref: '#/components/schemas/WebhookEvent' description: User re-authentication event AccessRevokedEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: access_revoked user: $ref: '#/components/schemas/TerraUser' description: User who revoked access status: type: string const: warning description: Status of the event message: type: string description: Information about the access revocation required: - type - user - status - message allOf: - $ref: '#/components/schemas/WebhookEvent' description: Access revoked event when a user revokes access through the provider PermissionChangeEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: permission_change user: $ref: '#/components/schemas/TerraUser' description: User who changed permissions status: type: string const: warning description: Status of the event message: type: string description: Information about the permission change version: type: string description: API version scopes_added: type: string description: Newly added scopes scopes_removed: type: string description: Removed scopes required: - type - user - status - message - version - scopes_added - scopes_removed allOf: - $ref: '#/components/schemas/WebhookEvent' description: Permission change event ConnectionErrorEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: connection_error user: $ref: '#/components/schemas/TerraUser' description: User with connection issues status: type: string const: warning description: Status of the event message: type: string description: Information about the connection issue required: - type - user - status - message allOf: - $ref: '#/components/schemas/WebhookEvent' description: Connection error event LargeRequestSendingEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: large_request_sending user: $ref: '#/components/schemas/TerraUser' description: User whose data is being sent reference: type: string description: Reference ID for tracking this request message: type: string description: Information about the request expected_payloads: type: integer description: Number of expected payload events required: - type - user - reference - message - expected_payloads allOf: - $ref: '#/components/schemas/WebhookEvent' description: Large request sending event LargeRequestProcessingEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: large_request_processing status: type: string const: processing description: Status of the processing message: type: string description: Information about the processing user: $ref: '#/components/schemas/TerraUser' description: User whose data is being processed reference: type: string description: Reference ID for tracking this request required: - type - status - message - user - reference allOf: - $ref: '#/components/schemas/WebhookEvent' description: Large request processing event S3PayloadEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: s3_payload status: type: string const: success description: Status of the upload url: type: string description: URL to download the data expires_in: type: integer description: Time in seconds until URL expiration required: - type - status - url - expires_in allOf: - $ref: '#/components/schemas/WebhookEvent' description: S3 Upload event with data download URL ActivityEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: activity data: type: array items: $ref: '#/components/schemas/Activity' description: Array of activity data user: $ref: '#/components/schemas/TerraUser' description: User whose data is being provided version: type: string description: API version required: - type - data - user - version allOf: - $ref: '#/components/schemas/WebhookEvent' description: Activity data event AthleteEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: athlete athlete: $ref: '#/components/schemas/Athlete' description: Athlete data user: $ref: '#/components/schemas/TerraUser' description: User whose data is being provided version: type: string description: API version required: - type - athlete - user - version allOf: - $ref: '#/components/schemas/WebhookEvent' description: Athlete data event NutritionEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: nutrition data: type: array items: $ref: '#/components/schemas/Nutrition' description: Array of nutrition data user: $ref: '#/components/schemas/TerraUser' description: User whose data is being provided version: type: string description: API version required: - type - data - user - version allOf: - $ref: '#/components/schemas/WebhookEvent' description: Nutrition data event DailyEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: daily data: type: array items: $ref: '#/components/schemas/Daily' description: Array of daily data user: $ref: '#/components/schemas/TerraUser' description: User whose data is being provided version: type: string description: API version required: - type - data - user - version allOf: - $ref: '#/components/schemas/WebhookEvent' description: Daily data event SleepEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: sleep data: type: array items: $ref: '#/components/schemas/Sleep' description: Array of sleep data user: $ref: '#/components/schemas/TerraUser' description: User whose data is being provided version: type: string description: API version required: - type - data - user - version allOf: - $ref: '#/components/schemas/WebhookEvent' description: Sleep data event MenstruationEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: menstruation data: type: array items: $ref: '#/components/schemas/Menstruation' description: Array of menstruation data user: $ref: '#/components/schemas/TerraUser' description: User whose data is being provided version: type: string description: API version required: - type - data - user - version allOf: - $ref: '#/components/schemas/WebhookEvent' description: Menstruation data event BodyEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: body data: type: array items: $ref: '#/components/schemas/Body' description: Array of body data user: $ref: '#/components/schemas/TerraUser' description: User whose data is being provided version: type: string description: API version required: - type - data - user - version allOf: - $ref: '#/components/schemas/WebhookEvent' description: Body data event LabReportEventResultSource: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: {} allOf: - $ref: '#/components/schemas/LabReportResultSource' description: The webhook source layer. Identical to the retrieve source layer — per-result collection date/time and region_name moved onto the shared base type, so the two cannot drift. Retained as a named type because it is published in the SDK. LabReportEventResult: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: source: $ref: '#/components/schemas/LabReportEventResultSource' required: - source allOf: - $ref: '#/components/schemas/LabReportResult' description: One layered webhook result. Byte-identical to the retrieve result — same source, biomarker, measurement, interpretation and reference_ranges. LabReportEventData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: session_id: type: string examples: - '297405620317847552' reference_id: type: string description: Your external reference; omitted if not set. report_type: $ref: '#/components/schemas/ReportType' examples: - dexa description: 'What kind of report this is, as a clean lowercase string (open enum — handle unknown values gracefully). "lab" for a clinical lab report, "dexa" for a DXA body-composition or bone-density scan. Switch on this to know the result shape: dexa results carry biomarker.region and source.region_name, lab results carry biomarker.specimen. Always present on a delivered event; optional in the schema only so consumers that validate strictly against the previous contract do not reject the addition.' report_date: type: string description: Date printed on the report (YYYY-MM-DD); omitted if not extracted. report_time: type: string description: Time printed on the report (HH:MM, 24-hour); omitted if not extracted. report_locale: type: string examples: - en-GB results_count: type: integer results: type: array items: $ref: '#/components/schemas/LabReportEventResult' panels: type: array items: $ref: '#/components/schemas/LabReportPanel' description: Report-level panels that results reference by panel_id. Omitted if the report has no panel grouping. report_notes: type: string required: - session_id - results_count - results description: The completed lab report resource. Shares the layered result/panel shapes with the retrieve endpoint, minus the session-lifecycle fields (status, byte counts, timestamps). LabReportCompletedEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: lab_report.completed event_id: type: string examples: - evt_4a2b8c1d-3f9e-4c0a-8b21-9d6e5f2a1c7b description: Stable event id; identical across redeliveries of the same event — dedup on it. occurred_at: type: string format: date-time description: RFC3339 UTC instant the event occurred. upload_id: type: string description: Correlates every event produced from one upload (a multi-report upload fans out to several); omitted for sessions minted before the upload contract. data: $ref: '#/components/schemas/LabReportEventData' required: - type - event_id - occurred_at - data description: 'Lab report completed event: a report finished processing; its normalized results are delivered under `data`.' LabReportEventError: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: code: type: string examples: - extraction_failed description: 'Finite code: file_unreadable, extraction_failed, standardization_failed, internal.' message: type: string retriable: type: boolean required: - code - message - retriable description: Structured failure reason. retriable tells you whether re-submitting the same input could succeed (a transient internal fault) or the input must change first (e.g. an unreadable file). LabReportFailureData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: session_id: type: string examples: - '297405620317847552' reference_id: type: string description: Your external reference; omitted if not set. error: $ref: '#/components/schemas/LabReportEventError' required: - session_id - error description: The failed lab report resource. LabReportFailedEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: lab_report.failed event_id: type: string examples: - evt_7c1f0a92-52c8-4a63-9082-7e50e2f5a1cd description: Stable event id; identical across redeliveries of the same event — dedup on it. occurred_at: type: string format: date-time description: RFC3339 UTC instant the event occurred. upload_id: type: string description: Correlates every event produced from one upload (a multi-report upload fans out to several); omitted for sessions minted before the upload contract. data: $ref: '#/components/schemas/LabReportFailureData' required: - type - event_id - occurred_at - data description: 'Lab report failed event: a report terminally failed processing; `data` carries the structured reason.' PlannedWorkoutEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: planned_workout data: type: array items: $ref: '#/components/schemas/PlannedWorkout' description: Array of planned workouts user: $ref: '#/components/schemas/TerraUser' description: User whose data is being provided version: type: string description: API version required: - type - data - user - version allOf: - $ref: '#/components/schemas/WebhookEvent' description: Planned workout data event HormoneEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: hormone data: type: array items: $ref: '#/components/schemas/HormoneSample' description: Array of hormone samples user: $ref: '#/components/schemas/TerraUser' description: User whose data is being provided version: type: string description: API version required: - type - data - user - version allOf: - $ref: '#/components/schemas/WebhookEvent' description: Hormone data event HealthObservationMetadata: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: start_time: type: string examples: - '2022-10-28T10:00:00.000000+01:00' description: When the observation occurred (or began), in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time. end_time: anyOf: - type: string - type: 'null' examples: - '2022-10-28T10:05:00.000000+01:00' description: When the observation ended, in ISO8601 format, for interval observations. Absent for point-in-time observations. summary_id: type: string examples: - 7C3A5D9E-1F42-4B5A-9C1D-2E8F0A6B4C3D description: Stable identifier for the source record (e.g. the HealthKit sample UUID). Re-deliveries and amendments reuse the same summary_id — treat it as the upsert key. timestamp_localization: anyOf: - $ref: '#/components/schemas/TimestampLocalization' - type: 'null' required: - start_time - summary_id HealthObservationCategory: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: Category is unknown or has not been mapped yet. Observations from source identifiers Terra has not yet catalogued ingest with this category rather than being dropped. title: Unspecified - type: number const: 1 description: A logged symptom, such as headache, fever or nausea. Symptom observations carry a severity. title: Symptom - type: number const: 2 description: A reproductive-health event, such as intermenstrual bleeding, an ovulation test result, or contraceptive use. title: Reproductive Health - type: number const: 3 description: A self-care event, such as toothbrushing or handwashing. title: Self Care - type: number const: 4 description: A medication event, such as a logged dose. title: Medication - type: number const: 5 description: A discrete health metric or lab-style measurement, such as inhaler usage, blood alcohol content or insulin delivery. title: Lab & Health Metrics - type: number const: 6 description: A logged mental-wellbeing observation, such as a momentary emotion or daily mood. title: State of Mind - type: number const: 7 description: A device-detected event, such as an irregular-rhythm or sleep-apnea notification. title: Device Event - type: number const: 8 description: A record originating from a clinical/EHR source. title: Clinical examples: - 1 ObservationCode: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: system: type: string examples: - healthkit description: 'The vocabulary the code belongs to: the source platform''s identifier system (e.g. healthkit) or a standard terminology URI (e.g. http://snomed.info/sct, http://loinc.org).' code: type: string examples: - HKCategoryTypeIdentifierIntermenstrualBleeding description: The code identifying the observation within the system. display: anyOf: - type: string - type: 'null' description: Human-readable display name for the code, where the system provides one. required: - system - code ObservationValueType: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: 'Presence-only: the event having occurred is the datum, and no value member is set.' title: None - type: number const: 1 description: A numeric value; the quantity and unit members are set. title: Quantity - type: number const: 2 description: A boolean finding; the boolean member is set. title: Boolean - type: number const: 3 description: A free-text value; the text member is set. title: String - type: number const: 4 description: A coded value from a bounded set; the code member is set. title: Code examples: - 1 ObservationValue: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: value_type: $ref: '#/components/schemas/ObservationValueType' description: Which member of this value union is set. quantity: anyOf: - type: number - type: 'null' examples: - 2 description: Numeric value, set when value_type is QUANTITY. unit: anyOf: - type: string - type: 'null' examples: - count description: Unit for the quantity, set when value_type is QUANTITY. boolean: anyOf: - type: boolean - type: 'null' description: Boolean finding, set when value_type is BOOLEAN. text: anyOf: - type: string - type: 'null' description: Free-text value, set when value_type is STRING. code: anyOf: - type: string - type: 'null' examples: - luteinizing_hormone_surge description: Coded value, set when value_type is CODE. required: - value_type ObservationSeverity: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: No severity was recorded. title: Unspecified - type: number const: 1 description: The user explicitly recorded the symptom as not present. title: Not Present - type: number const: 2 title: Mild - type: number const: 3 title: Moderate - type: number const: 4 title: Severe examples: - 3 ObservationComponent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: code: type: string examples: - valence description: Identity of this sub-value, scoped to the observation_type (e.g. valence for a state-of-mind observation). value: anyOf: - $ref: '#/components/schemas/ObservationValue' - type: 'null' description: The component's value. required: - code ObservationStatus: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - type: number const: 0 description: No lifecycle status was provided; treat as final. title: Unspecified - type: number const: 1 description: A complete record. title: Final - type: number const: 2 description: A correction to a previously delivered record with the same summary_id; replace the stored copy. title: Amended - type: number const: 3 description: The source retracted the record; delete the stored copy for this summary_id. title: Entered In Error examples: - 1 HealthObservationData: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: category: anyOf: - $ref: '#/components/schemas/HealthObservationCategory' - type: 'null' description: Coarse grouping of the observation, usable for filtering and permissioning. observation_type: type: string examples: - intermenstrual_bleeding description: Normalized snake_case observation identifier. codes: anyOf: - type: array items: $ref: '#/components/schemas/ObservationCode' - type: 'null' description: (system, code) tuples identifying the observation in the source platform's vocabulary and, where mapped, standard terminologies (SNOMED CT, LOINC). value: anyOf: - $ref: '#/components/schemas/ObservationValue' - type: 'null' description: The observation's value. Absent or NONE-typed for presence-only events. severity: anyOf: - $ref: '#/components/schemas/ObservationSeverity' - type: 'null' description: Severity, for symptom observations. Mirrors HealthKit severity semantics. components: anyOf: - type: array items: $ref: '#/components/schemas/ObservationComponent' - type: 'null' description: Coded sub-values of a multi-part observation (e.g. State of Mind valence and labels). status: anyOf: - $ref: '#/components/schemas/ObservationStatus' - type: 'null' description: Record lifecycle. ENTERED_IN_ERROR retracts the record with this summary_id. notes: anyOf: - type: string - type: 'null' description: Free-text note attached to the observation by the user or source platform. required: - observation_type HealthObservation: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: metadata: $ref: '#/components/schemas/HealthObservationMetadata' description: Object containing metadata for this observation record. observation_data: $ref: '#/components/schemas/HealthObservationData' description: Object containing the observation itself. required: - metadata - observation_data HealthObservationEvent: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: type: type: string const: health_observation data: type: array items: $ref: '#/components/schemas/HealthObservation' description: Array of health observations user: $ref: '#/components/schemas/TerraUser' description: User whose data is being provided version: type: string description: API version required: - type - data - user - version allOf: - $ref: '#/components/schemas/WebhookEvent' description: Health observation data event WebhookEventType: $schema: https://json-schema.org/draft/2020-12/schema oneOf: - $ref: '#/components/schemas/AuthSuccessEvent' - $ref: '#/components/schemas/AuthErrorEvent' - $ref: '#/components/schemas/DeauthEvent' - $ref: '#/components/schemas/UserReauthEvent' - $ref: '#/components/schemas/AccessRevokedEvent' - $ref: '#/components/schemas/ConnectionErrorEvent' - $ref: '#/components/schemas/PermissionChangeEvent' - $ref: '#/components/schemas/LargeRequestProcessingEvent' - $ref: '#/components/schemas/LargeRequestSendingEvent' - $ref: '#/components/schemas/ActivityEvent' - $ref: '#/components/schemas/AthleteEvent' - $ref: '#/components/schemas/BodyEvent' - $ref: '#/components/schemas/DailyEvent' - $ref: '#/components/schemas/MenstruationEvent' - $ref: '#/components/schemas/NutritionEvent' - $ref: '#/components/schemas/SleepEvent' - $ref: '#/components/schemas/PlannedWorkoutEvent' - $ref: '#/components/schemas/HormoneEvent' - $ref: '#/components/schemas/HealthObservationEvent' - $ref: '#/components/schemas/LabReportCompletedEvent' - $ref: '#/components/schemas/LabReportFailedEvent' - $ref: '#/components/schemas/S3PayloadEvent' description: Union of all possible webhook event types