openapi: 3.1.0 info: description: The Terra API title: TerraAPI version: 2022.03.16 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://api.tryterra.co/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 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': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '404': description: Returned when a parameter does not exist on Terra's end (e.g. resource) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - success - error description: indicates that an error happened (value is error) /auth/generateWidgetSession: post: summary: Generate an authentication link, using the Terra Authentication Widget description: Generates a link to redirect an end user to for them to select an integration and log in with their fitness data provider 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': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) /users/{user_id}: patch: summary: Modify user description: Update a Terra user's reference_id or active status tags: - User operationId: User_ModifyUser parameters: - name: user_id in: path description: Terra user ID to update required: true schema: type: string requestBody: required: false content: application/json: schema: type: object properties: reference_id: type: string description: Identifier on your system to associate with this user example: updatedUser123 active: type: boolean description: Whether the user should remain active responses: '200': description: Returned upon successful user modification content: application/json: schema: type: object properties: user: $ref: '#/components/schemas/TerraUser' status: type: string enum: - success - error description: Indicates that the request was successful example: success '400': description: Returned if the parameters are malformed or no user is found content: application/json: schema: type: object properties: message: description: A detailed message describing the error type: string status: type: string enum: - success - error description: Indicates an error happened /auth/deauthenticateUser: delete: summary: Deauthenticates a user and deletes any cached data for them description: Deletes all records of the user on Terra's end, revoking Terra's access to their 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': description: Returned when the user_id is not existent content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - success - error description: indicates that an error happened (value is error) /auth/generateAuthToken: post: tags: - Authentication summary: Generates an authentication token for the Terra mobile SDKs 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_GenerateAuthToken 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 '404': description: '404' content: application/json: examples: Result: value: status: error message: Invalid dev-id was provided schema: type: object properties: status: type: string example: error message: type: string example: Invalid dev-id was provided deprecated: false /activity: get: summary: Retrieve activity data for a given user ID description: Fetches completed workout sessions, with a defined start and end time and activity type (e.g. running, cycling, etc.) tags: - Activity operationId: Activity_Fetch 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/NoDataReturned' - $ref: '#/components/schemas/DataSentToWebhook' - $ref: '#/components/schemas/RequestProcessing' - $ref: '#/components/schemas/RateLimitRequestProcessing' - $ref: '#/components/schemas/LargeRequestProcessingEvent' '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '401': description: Returned when credentials (dev ID and API key) are invalid content: application/json: schema: type: object properties: message: description: An error message type: string example: unauthorized '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) post: tags: - Activity operationId: Activity_Write description: Used to post activity data to a provider. This endpoint only works for users connected via Wahoo. Returns error for other providers. summary: Post activity data to a provider requestBody: content: application/json: schema: type: object properties: data: description: List of user-tracked workouts to post to data provider type: array items: $ref: '#/components/schemas/Activity' required: - data required: true responses: '201': description: Returned when activity was successfully created on the provider content: application/json: schema: type: object properties: user: $ref: '#/components/schemas/TerraUser' log_ids: description: List of identifiers for the objects created, returned in the same order they were posted. I.e. Posting [ObjectA, ObjectB] will return [IdentifierA, IdentifierB] type: array items: type: string message: type: string default: Activity successfully logged '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) /athlete: get: summary: Retrieve user profile info for a given user ID description: Fetches relevant profile info such as first & last name, birth date etc. for a given user ID tags: - Athlete operationId: Athlete_Fetch 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/NoDataReturned' - $ref: '#/components/schemas/DataSentToWebhook' '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '401': description: Returned when credentials (dev ID and API key) are invalid content: application/json: schema: type: object properties: message: description: An error message type: string example: unauthorized '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) /body: get: summary: Retrieve body metrics for a given user ID description: Fetches body metrics such as weight, height, body fat percentage etc. for a given user ID tags: - Body operationId: Body_Fetch 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/NoDataReturned' - $ref: '#/components/schemas/DataSentToWebhook' - $ref: '#/components/schemas/RequestProcessing' - $ref: '#/components/schemas/RateLimitRequestProcessing' - $ref: '#/components/schemas/LargeRequestProcessingEvent' '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '401': description: Returned when credentials (dev ID and API key) are invalid content: application/json: schema: type: object properties: message: description: An error message type: string example: unauthorized '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) post: tags: - Body operationId: Body_Write description: Used to post body data to a provider. This endpoint only works for users connected via Google Fit. Returns error for other providers. summary: Post body data to a provider requestBody: content: application/json: schema: type: object properties: data: description: Body measurement metrics to post to data provider type: array items: $ref: '#/components/schemas/Body' required: - data required: true responses: '201': description: Returned when activity was successfully created on the provider content: application/json: schema: type: object properties: user: $ref: '#/components/schemas/TerraUser' log_ids: description: List of identifiers for the objects created, returned in the same order they were posted. I.e. Posting [ObjectA, ObjectB] will return [IdentifierA, IdentifierB] type: array items: type: string message: type: string default: Body data successfully logged '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) delete: tags: - Body operationId: Body_Delete description: Used to delete Body metrics the user has registered on their account summary: Delete body metrics for a given user ID parameters: - name: user_id in: query description: Terra user ID (UUID format) to retrieve data for schema: type: string required: true requestBody: content: application/json: schema: type: object properties: log_ids: type: array description: List of identifiers for body metrics entries to be deleted items: type: string required: - data required: true responses: '200': description: Returned when all records were deleted successfully content: application/json: schema: type: object properties: user: $ref: '#/components/schemas/TerraUser' processed_data: type: array items: type: object properties: id: type: string description: Identifier of the body metric entries whose deletion was attempted response_code: type: integer description: Response code from the provider when attempting to delete the body metric entries '207': description: Returned when multiple status codes were obtained from attempting to delete the requested records content: application/json: schema: type: object properties: user: $ref: '#/components/schemas/TerraUser' processed_data: type: array items: type: object properties: id: type: string description: Identifier of the body metric entry whose deletion was attempted response_code: type: integer description: Response code from the provider when attempting to delete the body metric entry '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '401': description: Returned when credentials (dev ID and API key) are invalid content: application/json: schema: type: object properties: message: description: An error message type: string example: unauthorized '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) /daily: get: summary: Retrieve daily activity summaries for a given user ID description: Fetches daily summaries of activity metrics such as steps, distance, calories burned etc. for a given user ID tags: - Daily operationId: Daily_Fetch 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/NoDataReturned' - $ref: '#/components/schemas/DataSentToWebhook' - $ref: '#/components/schemas/RequestProcessing' - $ref: '#/components/schemas/RateLimitRequestProcessing' - $ref: '#/components/schemas/LargeRequestProcessingEvent' '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '401': description: Returned when credentials (dev ID and API key) are invalid content: application/json: schema: type: object properties: message: description: An error message type: string example: unauthorized '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) /menstruation: get: summary: Retrieve menstruation data for a given user ID description: Fetches menstruation data such as cycle length, period length, ovulation date etc. for a given user ID tags: - Menstruation operationId: Menstruation_Fetch 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/NoDataReturned' - $ref: '#/components/schemas/DataSentToWebhook' - $ref: '#/components/schemas/RequestProcessing' - $ref: '#/components/schemas/RateLimitRequestProcessing' - $ref: '#/components/schemas/LargeRequestProcessingEvent' '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '401': description: Returned when credentials (dev ID and API key) are invalid content: application/json: schema: type: object properties: message: description: An error message type: string example: unauthorized '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) /nutrition: get: summary: Retrieve nutrition log data for a given user ID description: Fetches nutrition log data such as meal type, calories, macronutrients etc. for a given user ID tags: - Nutrition operationId: Nutrition_Fetch 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/NoDataReturned' - $ref: '#/components/schemas/DataSentToWebhook' - $ref: '#/components/schemas/RequestProcessing' - $ref: '#/components/schemas/RateLimitRequestProcessing' - $ref: '#/components/schemas/LargeRequestProcessingEvent' '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '401': description: Returned when credentials (dev ID and API key) are invalid content: application/json: schema: type: object properties: message: description: An error message type: string example: unauthorized '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) post: tags: - Nutrition operationId: Nutrition_Write description: Used to post nutrition logs to a provider. This endpoint only works for users connected via Fitbit. Returns error for other providers. summary: Post nutrition logs to a provider requestBody: content: application/json: schema: type: object properties: data: description: Nutrition entry to post to data provider type: array items: $ref: '#/components/schemas/Nutrition' required: - data required: true responses: '201': description: Returned when activity was successfully created on the provider content: application/json: schema: type: object properties: user: $ref: '#/components/schemas/TerraUser' log_ids: description: List of identifiers for the objects created, returned in the same order they were posted. I.e. Posting [ObjectA, ObjectB] will return [IdentifierA, IdentifierB] type: array items: type: string message: type: string default: Nutrition successfully logged '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) delete: tags: - Nutrition operationId: Nutrition_Delete description: Used to delete nutrition logs the user has registered on their account summary: Delete nutrition logs for a given user ID parameters: - name: user_id in: query description: Terra user ID (UUID format) to retrieve data for schema: type: string required: true requestBody: content: application/json: schema: type: object properties: data: type: array description: List of identifiers for nutrition entries to be deleted items: type: string required: - data required: true responses: '200': description: Returned when all records were deleted successfully content: application/json: schema: type: object properties: user: $ref: '#/components/schemas/TerraUser' processed_data: type: array items: type: object properties: id: type: string description: Identifier of the nutrition log whose deletion was attempted response_code: type: integer description: Response code from the provider when attempting to delete the nutrition log '207': description: Returned when multiple status codes were obtained from attempting to delete the requested records content: application/json: schema: type: object properties: user: $ref: '#/components/schemas/TerraUser' processed_data: type: array items: type: object properties: id: type: string description: Identifier of the nutrition log whose deletion was attempted response_code: type: integer description: Response code from the provider when attempting to delete the nutrition log '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '401': description: Returned when credentials (dev ID and API key) are invalid content: application/json: schema: type: object properties: message: description: An error message type: string example: unauthorized '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: enum: - success - error type: string description: indicates that an error happened (value is error) /sleep: get: summary: Retrieve sleep sessions for a given user ID description: Fetches sleep data such as sleep duration, sleep stages, sleep quality etc. for a given user ID, for sleep sessions with a defined start and end time tags: - Sleep operationId: Sleep_Fetch 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/NoDataReturned' - $ref: '#/components/schemas/DataSentToWebhook' - $ref: '#/components/schemas/RequestProcessing' - $ref: '#/components/schemas/RateLimitRequestProcessing' - $ref: '#/components/schemas/LargeRequestProcessingEvent' '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '401': description: Returned when credentials (dev ID and API key) are invalid content: application/json: schema: type: object properties: message: description: An error message type: string example: unauthorized '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) /plannedWorkout: post: tags: - PlannedWorkout operationId: PlannedWorkout_Write description: Used to post workout plans users can follow on their wearable. This can be strength workouts (sets, reps, weight lifted) or cardio workouts (warmup, intervals of different intensities, cooldown etc) summary: Post workout plans to a provider parameters: - name: user_id in: query description: Terra user ID (UUID format) to retrieve data for schema: type: string required: true requestBody: content: application/json: schema: type: object properties: data: description: PlannedWorkout entry to post to data provider type: array items: $ref: '#/components/schemas/PlannedWorkout' required: - data required: true responses: '201': description: Returned when activity was successfully created on the provider content: application/json: schema: type: object properties: user: $ref: '#/components/schemas/TerraUser' log_ids: description: List of identifiers for the objects created, returned in the same order they were posted. I.e. Posting [ObjectA, ObjectB] will return [IdentifierA, IdentifierB] type: array items: type: string message: type: string default: Planned workout successfully created '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) get: summary: Retrieve workout plans for a given user ID description: Used to get workout plans the user has registered on their account. This can be strength workouts (sets, reps, weight lifted) or cardio workouts (warmup, intervals of different intensities, cooldown etc) tags: - PlannedWorkout operationId: PlannedWorkout_Fetch 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 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/PlannedWorkout' type: type: - string - 'null' - $ref: '#/components/schemas/NoDataReturned' - $ref: '#/components/schemas/DataSentToWebhook' '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '401': description: Returned when credentials (dev ID and API key) are invalid content: application/json: schema: type: object properties: message: description: An error message type: string example: unauthorized '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) delete: tags: - PlannedWorkout operationId: PlannedWorkout_Delete description: Used to delete workout plans the user has registered on their account. This can be strength workouts (sets, reps, weight lifted) or cardio workouts (warmup, intervals of different intensities, cooldown etc) summary: Delete workout plans for a given user ID parameters: - name: user_id in: query description: Terra user ID (UUID format) to retrieve data for schema: type: string required: true requestBody: content: application/json: schema: type: object properties: data: type: array description: List of identifiers for planned workout entries to be deleted items: type: string required: - data required: true responses: '200': description: Returned when all records were deleted successfully content: application/json: schema: type: object properties: user: $ref: '#/components/schemas/TerraUser' processed_data: type: array items: type: object properties: id: type: string description: Identifier of the planned workout whose deletion was attempted response_code: type: integer description: Response code from the provider when attempting to delete the planned workout '207': description: Returned when multiple status codes were obtained from attempting to delete the requested records content: application/json: schema: type: object properties: user: $ref: '#/components/schemas/TerraUser' processed_data: type: object properties: id: type: string description: Identifier of the planned workout whose deletion was attempted response_code: type: integer description: Response code from the provider when attempting to delete the planned workout '400': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '401': description: Returned when authorization with a data provider has failed content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: enum: - success - error type: string description: indicates that an error happened (value is error) '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) /userInfo: get: tags: - User operationId: User_GetInfoForUserID description: Used to query for information on one Terra user ID, or to query for all registered Terra User objects under one reference ID summary: Get information for a single user ID or multiple users by 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: $ref: '#/components/schemas/TerraUser' 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': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) /subscriptions: get: tags: - User operationId: User_GetAllUserIDs description: Used to query for information for all Terra User IDs. Supports optional pagination via `page` and `per_page`. If `page` is not provided, it returns all users in one go (backwards compatibility). summary: Get all Terra 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: oneOf: - type: object properties: users: type: array items: $ref: '#/components/schemas/TerraUser' - type: object properties: data: type: object properties: next: type: - integer - 'null' description: The next page number, or null if there is no next page max_page: type: integer description: The maximum page index results: type: array items: $ref: '#/components/schemas/TerraUser' '400': description: Returned when one or more parameters are malformed content: application/json: schema: type: object properties: message: description: A detailed message describing the error type: string status: type: string enum: - error description: Indicates that an error occurred (value is `error`) /bulkUserInfo: post: tags: - User operationId: User_GetInfoForMultipleUserIDs description: Used to query for information for multiple Terra User IDs summary: Get information for multiple user IDs 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': description: Returned when one or more parameters is malformed - an appropriate error message will be returned content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) '404': description: Returned when a parameter does not exist on Terra's end (e.g. user_id) content: application/json: schema: type: object properties: message: description: a detailed message describing the error type: string status: type: string enum: - error description: indicates that an error happened (value is error) /integrations: get: summary: Get list of available integrations tags: - Integrations operationId: Integrations_Fetch description: Retrieve a list of all available provider integrations 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_resource: type: array items: type: string example: APPLE status: enum: - success - error type: string default: success /integrations/detailed: get: tags: - Integrations operationId: Integrations_DetailedFetch summary: Get detailed list of integrations description: Retrieve a detailed list of supported integrations, optionally filtered by the developer's enabled integrations and the requirement for SDK usage. 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: [] webhooks: healthcheck: post: description: Healthcheck event sent periodically to verify your event is functional summary: Healthcheck webhook operationId: healthcheckWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/HealthcheckEvent' responses: '200': description: Successful healthcheck response auth: post: description: Occurs when a user attempts to authenticate summary: User authentication webhook operationId: userAuthWebhook requestBody: content: application/json: schema: oneOf: - $ref: '#/components/schemas/AuthSuccessEvent' - $ref: '#/components/schemas/AuthErrorEvent' responses: '200': description: Successful authentication response deauth: post: description: Occurs when a user deauthenticates through the Terra summary: User deauthentication webhook operationId: userDeauthWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/DeauthEvent' responses: '200': description: Successful deauthentication response user_reauth: post: description: Occurs when a user successfully authenticates for a second time, with the same account. You will receive a successful auth and a user_reauth payload summary: User reauthentication webhook operationId: userReauthWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/UserReauthEvent' responses: '200': description: Successful reauthentication response access_revoked: post: description: Occurs when a user revokes Terra's access from the provider's end summary: Access revoked webhook operationId: accessRevokedWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/AccessRevokedEvent' responses: '200': description: Successful access revocation response connection_error: post: description: Occurs when a request to a provider returns an HTTP response of 401, 403 or 412 summary: Connection error webhook operationId: connectionErrorWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/ConnectionErrorEvent' responses: '200': description: Successful connection error response google_no_datasource: post: description: Occurs when a Google Fit user doesn't have a data source linked to their account. All data requests for the user will be empty unless they link a data source summary: Google no data source webhook operationId: googleNoDataSourceWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/GoogleNoDatasourceEvent' responses: '200': description: Successful no data source response processing: post: description: Occurs when data is being fetched asynchronously from the provider. The data will be sent through automatically via your Destination, and you can also safely request for it after the time in the retry_after_seconds field. summary: Data processing webhook operationId: dataProcessingWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/ProcessingEvent' responses: '200': description: Successful processing response large_request_sending: post: description: Occurs when more than one month of data has been requested and all data has been successfully submitted summary: Large request sending webhook operationId: largeRequestSendingWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/LargeRequestSendingEvent' responses: '200': description: Successful large request sending response large_request_processing: post: description: Occurs when more a request for over one month of data has been submitted to Terra. Data will be sent in chunks with the same reference field after this request. Each chunk will be at most 10 objects in the data field or 10 MB in size, whichever limit gets hit first summary: Large request processing webhook operationId: largeRequestProcessingWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/LargeRequestProcessingEvent' responses: '200': description: Successful large request processing response rate_limit_hit: post: description: Occurs when an asynchronous request has failed due to rate limiting and is going to be retried. summary: Rate limit hit webhook operationId: rateLimitHitWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/RateLimitHitEvent' responses: '200': description: Successful rate limit hit response s3_upload: post: description: Data event sent as a download link. summary: S3 upload webhook operationId: s3UploadWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/S3PayloadEvent' responses: '200': description: Successful S3 upload response activity: post: description: 'activity data event: activity updates when new activity is completed' summary: Activity webhook operationId: activityWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/ActivityEvent' responses: '200': description: Successful activity response athlete: post: description: 'athlete data event: Occurs throughout the day as users use their wearables.' summary: Athlete webhook operationId: athleteWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/AthleteEvent' responses: '200': description: Successful athlete response nutrition: post: description: 'nutrition data event: occurs throughout the day as users use their wearables.' summary: Nutrition webhook operationId: nutritionWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/NutritionEvent' responses: '200': description: Successful nutrition response daily: post: description: 'daily data event: occurs throughout the day as users use their wearables.' summary: Daily webhook operationId: dailyWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/DailyEvent' responses: '200': description: Successful daily response sleep: post: description: 'sleep data event: occurs throughout the day as users use their wearables.' summary: Sleep webhook operationId: sleepWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/SleepEvent' responses: '200': description: Successful sleep response menstruation: post: description: 'menstruation data event: occurs throughout the day as users use their wearables.' summary: Menstruation webhook operationId: menstruationWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/MenstruationEvent' responses: '200': description: Successful menstruation response body: post: description: 'body data event: occurs throughout the day as users use their wearables.' summary: Body webhook operationId: bodyWebhook requestBody: content: application/json: schema: $ref: '#/components/schemas/BodyEvent' responses: '200': description: Successful body response 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 schemas: 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' NoDataReturned: type: object properties: status: type: string enum: - success - error example: error message: type: string example: No data available for specified time range type: type: - string - 'null' example: no_data user: description: Terra User object type: object allOf: - $ref: '#/components/schemas/TerraUser' RequestProcessing: type: object properties: retry_after_seconds: type: number description: Recommended time after which the request may be retried nullable: true example: 30 message: type: string nullable: false example: Request is being processed type: type: string nullable: false example: processing user: description: Terra User object type: object allOf: - $ref: '#/components/schemas/TerraUser' RateLimitRequestProcessing: type: object properties: message: type: string nullable: false example: Rate limit exceeded type: type: string nullable: false example: rate_limit user: $ref: '#/components/schemas/TerraUser' required: - user DataSentToWebhook: type: object properties: reference: type: string description: Payload reference, tying the request to the webhook payload which will be received nullable: true example: webhook_ref_123 message: type: string nullable: false example: Data will be sent to webhook type: type: string nullable: false example: webhook user: description: Terra User object type: object allOf: - $ref: '#/components/schemas/TerraUser' Activity: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/Activity.yaml type: object properties: active_durations_data: $ref: '#/components/schemas/ActiveDurationsData' description: Number of minutes spent at various intensities during the workout, as reported by the Fitness Data provider. calories_data: $ref: '#/components/schemas/CaloriesData' description: Object containing calorie-related information for the user during the specific workout. cheat_detection: type: number examples: - 0 description: Cheat detection flag. data_enrichment: $ref: '#/components/schemas/DataEnrichment' description: Object containing Terra Scores. device_data: $ref: '#/components/schemas/DeviceData' description: Object containing information on the device which recorded the specific workout. distance_data: $ref: '#/components/schemas/DistanceData' description: Object containing information related to distance covered during the associated workout. energy_data: $ref: '#/components/schemas/EnergyData' description: Object containing information on the energy expended by the user during the workout. heart_rate_data: $ref: '#/components/schemas/HeartRateData' description: Object containing heartrate-related information for the workout. lap_data: $ref: '#/components/schemas/LapData' 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: $ref: '#/components/schemas/METData' 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: $ref: '#/components/schemas/MovementData' description: Object containing information on the user's movement throughout the workout. oxygen_data: $ref: '#/components/schemas/OxygenData' description: Object containing information on oxygen-related metrics for the workout. polyline_map_data: $ref: '#/components/schemas/PolylineMapData' description: Object containing polyline-representation map data, plotting the user's trajectory throughout the workout. position_data: $ref: '#/components/schemas/PositionData' description: Object containing information on the user's position throughout the workout. power_data: $ref: '#/components/schemas/PowerData' description: Object containing information on the power generated by the user during the workout. strain_data: $ref: '#/components/schemas/StrainData' description: Object containing information on the cardiovascular strain imposed on the user during the workout. TSS_data: $ref: '#/components/schemas/TSSData' description: Object containing information on the stress put on the user's body from a workout. work_data: $ref: '#/components/schemas/WorkData' 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/Athlete.yaml type: object properties: age: type: integer examples: - 28 description: User's age. country: type: string examples: - United States description: User's country of residence. bio: type: string examples: - Passionate runner and cyclist description: User's bio - a short description they display on their profile. state: type: string examples: - California description: User's state of residence. last_name: type: string examples: - Smith description: User's last name. sex: type: string examples: - male description: User's sex. city: type: string examples: - San Francisco description: User's city of residence. email: type: string examples: - user@example.com description: User's email. date_of_birth: type: string examples: - '1999-11-23' description: User's date of birth, in ISO8601 format. first_name: type: string examples: - John description: User's first name. gender: type: string examples: - male description: User's gender. joined_provider: type: string examples: - '2023-01-15' description: User's account creation date. devices: type: array items: $ref: '#/components/schemas/DeviceData' description: Array of devices associated with the user's account. AthleteCollection: type: object properties: athlete: description: Object containing the user's information type: object allOf: - $ref: '#/components/schemas/Athlete' type: type: string nullable: true example: athlete user: description: Terra User object type: object allOf: - $ref: '#/components/schemas/TerraUser' Body: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/Body.yaml type: object properties: blood_pressure_data: $ref: '#/components/schemas/BloodPressureData' description: Object containing information on user's Blood Pressure. device_data: $ref: '#/components/schemas/DeviceData' description: Object containing information on the device which recorded data for the payload. heart_data: $ref: '#/components/schemas/HeartData' description: Object containing information on user's heart metrics. hydration_data: $ref: '#/components/schemas/HydrationData' description: Object containing information on user's hydration (both internal & consumption of water) for the day. ketone_data: $ref: '#/components/schemas/KetoneData' description: Object containing information on user's ketone data for the day. measurements_data: $ref: '#/components/schemas/MeasurementsData' description: Object containing information on body measurements for the day. metadata: $ref: '#/components/schemas/BodyMetadata' description: Object containing daily summary metadata. oxygen_data: $ref: '#/components/schemas/OxygenData' description: Object containing information on user's oxygen-related data. temperature_data: $ref: '#/components/schemas/TemperatureData' description: Object containing temperature information (core, skin, ambient) during the day. glucose_data: $ref: '#/components/schemas/GlucoseData' description: Object containing information on user's blood glucose for the day. required: - metadata Daily: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/Daily.yaml type: object properties: active_durations_data: $ref: '#/components/schemas/ActiveDurationsData' description: Object containing information related to the time spent in different activity intensities during over the day. calories_data: $ref: '#/components/schemas/CaloriesData' description: Object containing calorie-related information for the user during the specific day. data_enrichment: $ref: '#/components/schemas/DailyDataEnrichment' description: Object containing additional enrichment data for the day. device_data: $ref: '#/components/schemas/DeviceData' description: Object containing information on the device which recorded data for the day. distance_data: $ref: '#/components/schemas/DailyDistanceData' description: Object containing information related to distance covered during the associated day. heart_rate_data: $ref: '#/components/schemas/HeartRateData' description: Object containing heartrate-related information for the day. MET_data: $ref: '#/components/schemas/METData' 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: $ref: '#/components/schemas/OxygenData' description: Object containing information on oxygen-related metrics for the day. scores: $ref: '#/components/schemas/ScoresData' description: Scores for the user's performance on different metrics for the given day, as calculated by the fitness data provider. strain_data: $ref: '#/components/schemas/StrainData' description: Object containing information on the strain put on the user's body over a day. stress_data: $ref: '#/components/schemas/StressData' description: Object containing information on the stress put on the user over a day. tag_data: $ref: '#/components/schemas/TagData' 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/Menstruation.yaml type: object properties: metadata: $ref: '#/components/schemas/MenstruationMetadata' description: Object containing daily summary metadata. menstruation_data: $ref: '#/components/schemas/MenstruationData' description: Object containing information on user's menstruation for a given day. required: - metadata Nutrition: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/Nutrition.yaml type: object properties: drink_samples: type: array items: $ref: '#/components/schemas/DrinkSample' description: Information on drinks the user consumed throughout the day. meals: type: array items: $ref: '#/components/schemas/Meal' description: Information on individual foods consumed throughout a given day. metadata: $ref: '#/components/schemas/NutritionMetadata' description: Object containing daily summary metadata. summary: $ref: '#/components/schemas/NutritionSummary' description: Summative nutritional information for a given day. required: - metadata Sleep: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/Sleep.yaml type: object properties: data_enrichment: $ref: '#/components/schemas/SleepDataEnrichment' description: Object containing additional enrichment data for the sleep session. device_data: $ref: '#/components/schemas/DeviceData' description: Object containing information on the device which recorded data for the payload. heart_rate_data: $ref: '#/components/schemas/HeartRateData' 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: $ref: '#/components/schemas/ReadinessData' description: Object containing information on the user's readiness for the day, based off the quality and duration of their sleep. respiration_data: $ref: '#/components/schemas/RespirationData' description: Object containing information on the user's respiration throughout the sleep session. scores: type: object properties: sleep: type: number description: User's sleep score. description: User's sleep score sleep_durations_data: $ref: '#/components/schemas/SleepDurationsData' description: Object containing information on the user's duration spent in various sleep stages. temperature_data: $ref: '#/components/schemas/SleepTemperatureData' description: Object containing body temperature information of the user during the sleep recording session. required: - metadata PlannedWorkoutStepTarget: type: object properties: target_type: description: Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed nullable: false type: string enum: - SPEED - HEART_RATE - OPEN - CADENCE - POWER - GRADE - RESISTANCE - POWER_LAP - SWIM_STROKE - SPEED_LAP - HEART_RATE_LAP - PACE - HEART_RATE_THRESHOLD_PERCENTAGE - HEART_RATE_MAX_PERCENTAGE - SPEED_PERCENTAGE - POWER_PERCENTAGE - REPETITION - TSS - IF example: HEART_RATE CadencePlannedWorkoutStepTarget: type: object properties: cadence: type: integer description: Ideal cadence value to be maintained for the workout step nullable: true example: 90 target_type: description: Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed nullable: false type: string enum: - SPEED - HEART_RATE - OPEN - CADENCE - POWER - GRADE - RESISTANCE - POWER_LAP - SWIM_STROKE - SPEED_LAP - HEART_RATE_LAP - PACE - HEART_RATE_THRESHOLD_PERCENTAGE - HEART_RATE_MAX_PERCENTAGE - SPEED_PERCENTAGE - POWER_PERCENTAGE - REPETITION - TSS - IF example: CADENCE cadence_low: type: integer description: Minimum cadence threshold for the workout step - i.e. the user is to stay above this value during the workout nullable: true example: 85 cadence_high: type: integer description: Maximum cadence threshold for the workout step - i.e. the user is to stay under this value during the workout step nullable: true example: 95 HRPlannedWorkoutStepTarget: type: object properties: hr_percentage_low: type: number description: Maximum max heart rate percentage threshold for the workout step - i.e. the user is to stay under this value during the workout step nullable: true example: 65.5 target_type: description: Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed nullable: false type: string enum: - SPEED - HEART_RATE - OPEN - CADENCE - POWER - GRADE - RESISTANCE - POWER_LAP - SWIM_STROKE - SPEED_LAP - HEART_RATE_LAP - PACE - HEART_RATE_THRESHOLD_PERCENTAGE - HEART_RATE_MAX_PERCENTAGE - SPEED_PERCENTAGE - POWER_PERCENTAGE - REPETITION - TSS - IF example: HEART_RATE hr_percentage_high: type: number description: Minimum heart rate percentage threshold for the workout step - i.e. the user is to stay above this value during the workout nullable: true example: 85.5 hr_percentage: type: number description: Ideal percentage of user's maximum HR to be maintained workout step nullable: true example: 75.5 hr_bpm_high: type: integer description: Maximum heart rate threshold for the workout step - i.e. the user is to stay under this value during the workout step nullable: true example: 175 hr_bpm_low: type: integer description: Minimum heart rate threshold for the workout step - i.e. the user is to stay above this value during the workout nullable: true example: 130 PowerPlannedWorkoutStepTarget: type: object properties: target_type: description: Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed nullable: false type: string enum: - SPEED - HEART_RATE - OPEN - CADENCE - POWER - GRADE - RESISTANCE - POWER_LAP - SWIM_STROKE - SPEED_LAP - HEART_RATE_LAP - PACE - HEART_RATE_THRESHOLD_PERCENTAGE - HEART_RATE_MAX_PERCENTAGE - SPEED_PERCENTAGE - POWER_PERCENTAGE - REPETITION - TSS - IF example: POWER power_percentage_low: type: number description: Maximum percentage of Functional Threshold Power for the workout step - i.e. the user is to stay under this value during the workout step nullable: true example: 65.5 power_percentage_high: type: number description: Minimum percentage of Functional Threshold Power for the workout step - i.e. the user is to stay above this value during the workout nullable: true example: 85.5 power_watt_high: type: integer description: Maximum power threshold for the workout step - i.e. the user is to stay under this value during the workout step nullable: true example: 300 power_watt_low: type: integer description: Minimum power threshold for the workout step - i.e. the user is to stay above this value during the workout nullable: true example: 200 power_watt: type: integer default: null nullable: true example: 250 power_percentage: type: number description: Ideal percentage of user's Functional Threshold Power to be maintained workout step nullable: true example: 75.5 SpeedPlannedWorkoutStepTarget: type: object properties: target_type: description: Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed nullable: false type: string enum: - SPEED - HEART_RATE - OPEN - CADENCE - POWER - GRADE - RESISTANCE - POWER_LAP - SWIM_STROKE - SPEED_LAP - HEART_RATE_LAP - PACE - HEART_RATE_THRESHOLD_PERCENTAGE - HEART_RATE_MAX_PERCENTAGE - SPEED_PERCENTAGE - POWER_PERCENTAGE - REPETITION - TSS - IF example: SPEED speed_percentage_high: type: number description: Maximum speed threshold for the workout step - i.e. the user is to stay under this value during the workout step nullable: true example: 85.5 speed_percentage_low: type: number description: Minimum speed threshold for the workout step - i.e. the user is to stay above this value during the workout step nullable: true example: 65.5 speed_percentage: type: number description: Ideal percentage of user's Threshold Speed, based off their Threshold Pace, to be maintained workout step. Usually, the Threshold Pace is defined as the pace one could race at for 50 to 60 minutes nullable: true example: 75.5 speed_meters_per_second: type: number description: Ideal speed value to be maintained for the workout step nullable: true example: 4.2 PacePlannedWorkoutStepTarget: type: object properties: target_type: description: Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed nullable: false type: string enum: - SPEED - HEART_RATE - OPEN - CADENCE - POWER - GRADE - RESISTANCE - POWER_LAP - SWIM_STROKE - SPEED_LAP - HEART_RATE_LAP - PACE - HEART_RATE_THRESHOLD_PERCENTAGE - HEART_RATE_MAX_PERCENTAGE - SPEED_PERCENTAGE - POWER_PERCENTAGE - REPETITION - TSS - IF example: PACE pace_minutes_per_kilometer: type: number description: Ideal pace value to be maintained for the workout step nullable: true example: 5.5 TSSPlannedWorkoutStepTarget: type: object properties: target_type: description: Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed nullable: false type: string enum: - SPEED - HEART_RATE - OPEN - CADENCE - POWER - GRADE - RESISTANCE - POWER_LAP - SWIM_STROKE - SPEED_LAP - HEART_RATE_LAP - PACE - HEART_RATE_THRESHOLD_PERCENTAGE - HEART_RATE_MAX_PERCENTAGE - SPEED_PERCENTAGE - POWER_PERCENTAGE - REPETITION - TSS - IF example: TSS tss: type: number description: Planned Training Stress Score to be achieved for the workout step nullable: true example: 100.5 IFPlannedWorkoutStepTarget: type: object properties: if_high: type: number description: Maximum Intensity Factor to be achieved for the workout step nullable: true example: 1.2 target_type: description: Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed nullable: false type: string enum: - SPEED - HEART_RATE - OPEN - CADENCE - POWER - GRADE - RESISTANCE - POWER_LAP - SWIM_STROKE - SPEED_LAP - HEART_RATE_LAP - PACE - HEART_RATE_THRESHOLD_PERCENTAGE - HEART_RATE_MAX_PERCENTAGE - SPEED_PERCENTAGE - POWER_PERCENTAGE - REPETITION - TSS - IF example: IF if_low: type: number description: Minimum Intensity Factor to be achieved for the workout step nullable: true example: 0.8 RepetitionPlannedWorkoutStepTarget: type: object properties: target_type: description: Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed nullable: false type: string enum: - SPEED - HEART_RATE - OPEN - CADENCE - POWER - GRADE - RESISTANCE - POWER_LAP - SWIM_STROKE - SPEED_LAP - HEART_RATE_LAP - PACE - HEART_RATE_THRESHOLD_PERCENTAGE - HEART_RATE_MAX_PERCENTAGE - SPEED_PERCENTAGE - POWER_PERCENTAGE - REPETITION - TSS - IF example: REPETITION repetitions: type: number description: Number of repetitions of the workout step to be performed nullable: true example: 10 SwimStrokePlannedWorkoutStepTarget: type: object properties: target_type: description: Type of target for the workout - i.e. metric type for which a criterion must be met for the workout to be completed nullable: false type: string enum: - SPEED - HEART_RATE - OPEN - CADENCE - POWER - GRADE - RESISTANCE - POWER_LAP - SWIM_STROKE - SPEED_LAP - HEART_RATE_LAP - PACE - HEART_RATE_THRESHOLD_PERCENTAGE - HEART_RATE_MAX_PERCENTAGE - SPEED_PERCENTAGE - POWER_PERCENTAGE - REPETITION - TSS - IF example: SWIM_STROKE swim_strokes: type: integer description: Number of swim strokes to be performed during the workout step nullable: true example: 50 PlannedWorkoutStepTargets: type: object properties: {} oneOf: - $ref: '#/components/schemas/PlannedWorkoutStepTarget' - $ref: '#/components/schemas/CadencePlannedWorkoutStepTarget' - $ref: '#/components/schemas/HRPlannedWorkoutStepTarget' - $ref: '#/components/schemas/PowerPlannedWorkoutStepTarget' - $ref: '#/components/schemas/SpeedPlannedWorkoutStepTarget' - $ref: '#/components/schemas/PacePlannedWorkoutStepTarget' - $ref: '#/components/schemas/TSSPlannedWorkoutStepTarget' - $ref: '#/components/schemas/IFPlannedWorkoutStepTarget' - $ref: '#/components/schemas/RepetitionPlannedWorkoutStepTarget' - $ref: '#/components/schemas/SwimStrokePlannedWorkoutStepTarget' discriminator: propertyName: type mapping: PlannedWorkoutStepTarget: '#/components/schemas/PlannedWorkoutStepTarget' CadencePlannedWorkoutStepTarget: '#/components/schemas/CadencePlannedWorkoutStepTarget' HRPlannedWorkoutStepTarget: '#/components/schemas/HRPlannedWorkoutStepTarget' PowerPlannedWorkoutStepTarget: '#/components/schemas/PowerPlannedWorkoutStepTarget' SpeedPlannedWorkoutStepTarget: '#/components/schemas/SpeedPlannedWorkoutStepTarget' PacePlannedWorkoutStepTarget: '#/components/schemas/PacePlannedWorkoutStepTarget' TSSPlannedWorkoutStepTarget: '#/components/schemas/TSSPlannedWorkoutStepTarget' IFPlannedWorkoutStepTarget: '#/components/schemas/IFPlannedWorkoutStepTarget' RepetitionPlannedWorkoutStepTarget: '#/components/schemas/RepetitionPlannedWorkoutStepTarget' SwimStrokePlannedWorkoutStepTarget: '#/components/schemas/SwimStrokePlannedWorkoutStepTarget' PlannedWorkoutStepDuration: type: object properties: duration_type: description: Type of condition that must be fulfilled to consider the workout step complete nullable: false type: string enum: - TIME - DISTANCE_METERS - HR_LESS_THAN - HR_GREATER_THAN - CALORIES - OPEN - POWER_LESS_THAN - POWER_GREATER_THAN - REPETITION_TIME - REPS - FIXED_REST - TIME_AT_VALID_CDA - STEPS TimePlannedWorkoutStepDuration: type: object properties: seconds: type: integer description: Time duration to be elapsed for the workout step nullable: true duration_type: description: Type of condition that must be fulfilled to consider the workout step complete nullable: false type: string enum: - TIME - DISTANCE_METERS - HR_LESS_THAN - HR_GREATER_THAN - CALORIES - OPEN - POWER_LESS_THAN - POWER_GREATER_THAN - REPETITION_TIME - REPS - FIXED_REST - TIME_AT_VALID_CDA - STEPS PowerAbovePlannedWorkoutStepDuration: type: object properties: power_above_watts: type: integer description: Threshold power goal to complete the workout step - once the user reaches above this power level, the step will be completed nullable: true duration_type: description: Type of condition that must be fulfilled to consider the workout step complete nullable: false type: string enum: - TIME - DISTANCE_METERS - HR_LESS_THAN - HR_GREATER_THAN - CALORIES - OPEN - POWER_LESS_THAN - POWER_GREATER_THAN - REPETITION_TIME - REPS - FIXED_REST - TIME_AT_VALID_CDA - STEPS PowerBelowPlannedWorkoutStepDuration: type: object properties: power_below_watts: type: integer description: Threshold power goal to complete the workout step - once the user reaches below this power level, the step will be completed nullable: true duration_type: description: Type of condition that must be fulfilled to consider the workout step complete nullable: false type: string enum: - TIME - DISTANCE_METERS - HR_LESS_THAN - HR_GREATER_THAN - CALORIES - OPEN - POWER_LESS_THAN - POWER_GREATER_THAN - REPETITION_TIME - REPS - FIXED_REST - TIME_AT_VALID_CDA - STEPS FixedRestPlannedWorkoutStepDuration: type: object properties: duration_type: description: Type of condition that must be fulfilled to consider the workout step complete nullable: false type: string enum: - TIME - DISTANCE_METERS - HR_LESS_THAN - HR_GREATER_THAN - CALORIES - OPEN - POWER_LESS_THAN - POWER_GREATER_THAN - REPETITION_TIME - REPS - FIXED_REST - TIME_AT_VALID_CDA - STEPS rest_seconds: type: integer description: Time duration to be elapsed for the rest period nullable: true CaloriesPlannedWorkoutStepDuration: type: object properties: calories: type: integer description: Calorie burn target for the workout step - once the user reaches the target, the step will be completed nullable: true duration_type: description: Type of condition that must be fulfilled to consider the workout step complete nullable: false type: string enum: - TIME - DISTANCE_METERS - HR_LESS_THAN - HR_GREATER_THAN - CALORIES - OPEN - POWER_LESS_THAN - POWER_GREATER_THAN - REPETITION_TIME - REPS - FIXED_REST - TIME_AT_VALID_CDA - STEPS HRAbovePlannedWorkoutStepDuration: type: object properties: duration_type: description: Type of condition that must be fulfilled to consider the workout step complete nullable: false type: string enum: - TIME - DISTANCE_METERS - HR_LESS_THAN - HR_GREATER_THAN - CALORIES - OPEN - POWER_LESS_THAN - POWER_GREATER_THAN - REPETITION_TIME - REPS - FIXED_REST - TIME_AT_VALID_CDA - STEPS hr_above_bpm: type: integer description: Threshold heart rate goal to complete the workout step - once the user's heart rate reaches above below this value, the step will be completed nullable: true HRBelowPlannedWorkoutStepDuration: type: object properties: hr_below_bpm: type: integer description: Threshold heart rate goal to complete the workout step - once the user's heart rate reaches below this value, the step will be completed nullable: true duration_type: description: Type of condition that must be fulfilled to consider the workout step complete nullable: false type: string enum: - TIME - DISTANCE_METERS - HR_LESS_THAN - HR_GREATER_THAN - CALORIES - OPEN - POWER_LESS_THAN - POWER_GREATER_THAN - REPETITION_TIME - REPS - FIXED_REST - TIME_AT_VALID_CDA - STEPS RepsPlannedWorkoutStepDuration: type: object properties: reps: type: integer description: Target number of reps for the workout step - once the user completes this rep target, the step will be completed nullable: true duration_type: description: Type of condition that must be fulfilled to consider the workout step complete nullable: false type: string enum: - TIME - DISTANCE_METERS - HR_LESS_THAN - HR_GREATER_THAN - CALORIES - OPEN - POWER_LESS_THAN - POWER_GREATER_THAN - REPETITION_TIME - REPS - FIXED_REST - TIME_AT_VALID_CDA - STEPS DistancePlannedWorkoutStepDuration: type: object properties: duration_type: description: Type of condition that must be fulfilled to consider the workout step complete nullable: false type: string enum: - TIME - DISTANCE_METERS - HR_LESS_THAN - HR_GREATER_THAN - CALORIES - OPEN - POWER_LESS_THAN - POWER_GREATER_THAN - REPETITION_TIME - REPS - FIXED_REST - TIME_AT_VALID_CDA - STEPS distance_meters: type: integer description: Target distance for the workout step - once the user covers this distance, the step will be completed nullable: true StepsPlannedWorkoutStepDuration: type: object properties: steps: type: integer description: Target number of steps for the workout step - once the user performs this number of steps, the step will be completed nullable: true duration_type: description: Type of condition that must be fulfilled to consider the workout step complete nullable: false type: string enum: - TIME - DISTANCE_METERS - HR_LESS_THAN - HR_GREATER_THAN - CALORIES - OPEN - POWER_LESS_THAN - POWER_GREATER_THAN - REPETITION_TIME - REPS - FIXED_REST - TIME_AT_VALID_CDA - STEPS PlannedWorkoutStepDurations: type: object properties: {} oneOf: - $ref: '#/components/schemas/PlannedWorkoutStepDuration' - $ref: '#/components/schemas/TimePlannedWorkoutStepDuration' - $ref: '#/components/schemas/PowerAbovePlannedWorkoutStepDuration' - $ref: '#/components/schemas/PowerBelowPlannedWorkoutStepDuration' - $ref: '#/components/schemas/FixedRestPlannedWorkoutStepDuration' - $ref: '#/components/schemas/CaloriesPlannedWorkoutStepDuration' - $ref: '#/components/schemas/HRAbovePlannedWorkoutStepDuration' - $ref: '#/components/schemas/HRBelowPlannedWorkoutStepDuration' - $ref: '#/components/schemas/RepsPlannedWorkoutStepDuration' - $ref: '#/components/schemas/DistancePlannedWorkoutStepDuration' - $ref: '#/components/schemas/StepsPlannedWorkoutStepDuration' discriminator: propertyName: type mapping: PlannedWorkoutStepDuration: '#/components/schemas/PlannedWorkoutStepDuration' TimePlannedWorkoutStepDuration: '#/components/schemas/TimePlannedWorkoutStepDuration' PowerAbovePlannedWorkoutStepDuration: '#/components/schemas/PowerAbovePlannedWorkoutStepDuration' PowerBelowPlannedWorkoutStepDuration: '#/components/schemas/PowerBelowPlannedWorkoutStepDuration' FixedRestPlannedWorkoutStepDuration: '#/components/schemas/FixedRestPlannedWorkoutStepDuration' CaloriesPlannedWorkoutStepDuration: '#/components/schemas/CaloriesPlannedWorkoutStepDuration' HRAbovePlannedWorkoutStepDuration: '#/components/schemas/HRAbovePlannedWorkoutStepDuration' HRBelowPlannedWorkoutStepDuration: '#/components/schemas/HRBelowPlannedWorkoutStepDuration' RepsPlannedWorkoutStepDuration: '#/components/schemas/RepsPlannedWorkoutStepDuration' DistancePlannedWorkoutStepDuration: '#/components/schemas/DistancePlannedWorkoutStepDuration' StepsPlannedWorkoutStepDuration: '#/components/schemas/StepsPlannedWorkoutStepDuration' PlannedWorkoutStep: type: object properties: targets: type: array description: List of targets for the workout items: $ref: '#/components/schemas/PlannedWorkoutStepTargets' type: description: Type of workout step - either repeat or one-off type: string enum: - STEP - REPEAT_STEP intensity: description: Planned intensity for the workout step type: string enum: - REST - WARMUP - COOLDOWN - RECOVERY - INTERVAL - ACTIVE order: type: integer description: Position of the workout step in the overall workout description: type: string description: Description of workout step durations: type: array description: List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed items: $ref: '#/components/schemas/PlannedWorkoutStepDurations' name: type: string description: Name of workout step PlannedWorkoutRepeatStep: type: object properties: targets: type: array description: List of targets for the workout items: $ref: '#/components/schemas/PlannedWorkoutStepTarget' type: description: Type of workout step - either repeat or one-off nullable: false type: string enum: - STEP - REPEAT_STEP steps: type: array description: List of steps to be repeated for this workout step - e.g. if a user wants to schedule 5 repetitions of 100m sprints plus 20s rest in between items: $ref: '#/components/schemas/PlannedWorkoutStep' intensity: type: integer description: Planned intensity for the workout step nullable: true order: type: integer description: Position of the workout step in the overall workout nullable: true description: type: string description: Description of workout step nullable: true durations: type: array description: List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed items: $ref: '#/components/schemas/PlannedWorkoutStepDuration' name: type: string description: Name of workout step nullable: true SwimmingPlannedWorkoutStep: type: object properties: targets: type: array description: List of targets for the workout items: $ref: '#/components/schemas/PlannedWorkoutStepTarget' type: description: Type of workout step - either repeat or one-off nullable: false type: string enum: - STEP - REPEAT_STEP intensity: type: integer description: Planned intensity for the workout step nullable: true order: type: integer description: Position of the workout step in the overall workout nullable: true equipment_type: description: Workout equipment to be used during the workout step nullable: false type: string enum: - NONE - SWIM_FINS - SWIM_KICKBOARD - SWIM_PADDLES - SWIM_PULL_BUOY - SWIM_SNORKEL description: type: string description: Description of workout step nullable: true durations: type: array description: List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed items: $ref: '#/components/schemas/PlannedWorkoutStepDuration' name: type: string description: Name of workout step nullable: true stroke_type: description: Stroke type used for the workout step (e.g. breaststroke) nullable: false type: string enum: - OTHER - FREESTYLE - BACKSTROKE - BREASTSTROKE - BUTTERFLY - REST CardioPlannedWorkoutStep: type: object properties: targets: type: array description: List of targets for the workout items: $ref: '#/components/schemas/PlannedWorkoutStepTarget' type: description: Type of workout step - either repeat or one-off nullable: false type: string enum: - STEP - REPEAT_STEP intensity: type: integer description: Planned intensity for the workout step nullable: true order: type: integer description: Position of the workout step in the overall workout nullable: true exercise_name: type: string description: Name of exercise to be performed for the workout step nullable: true description: type: string description: Description of workout step nullable: true durations: type: array description: List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed items: $ref: '#/components/schemas/PlannedWorkoutStepDuration' exercise_category: description: Type of exercise to be performed for the workout step nullable: false type: string enum: - UNKNOWN - BENCH_PRESS - CALF_RAISE - CARDIO - CARRY - CHOP - CORE - CRUNCH - CURL - DEADLIFT - FLYE - HIP_RAISE - HIP_STABILITY - HIP_SWING - HYPEREXTENSION - LATERAL_RAISE - LEG_CURL - LEG_RAISE - LUNGE - OLYMPIC_LIFT - PLANK - PLYO - PULL_UP - PUSH_UP - ROW - SHOULDER_PRESS - SHOULDER_STABILITY - SHRUG - SIT_UP - SQUAT - TOTAL_BODY - TRICEPS_EXTENSION - WARM_UP - RUN - BIKE - CARDIO_SENSORS name: type: string description: Name of workout step nullable: true StrengthPlannedWorkoutStep: type: object properties: weight_kg: type: number description: Weight to be lifted for the exercise nullable: true targets: type: array description: List of targets for the workout items: $ref: '#/components/schemas/PlannedWorkoutStepTarget' type: description: Type of workout step - either repeat or one-off nullable: false type: string enum: - STEP - REPEAT_STEP intensity: type: integer description: Planned intensity for the workout step nullable: true order: type: integer description: Position of the workout step in the overall workout nullable: true exercise_name: type: string description: Name of strength exercise to be performed for the workout step nullable: true description: type: string description: Description of workout step nullable: true durations: type: array description: List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed items: $ref: '#/components/schemas/PlannedWorkoutStepDuration' exercise_category: description: Type of strength exercise to be performed for the workout step nullable: false type: string enum: - UNKNOWN - BENCH_PRESS - CALF_RAISE - CARDIO - CARRY - CHOP - CORE - CRUNCH - CURL - DEADLIFT - FLYE - HIP_RAISE - HIP_STABILITY - HIP_SWING - HYPEREXTENSION - LATERAL_RAISE - LEG_CURL - LEG_RAISE - LUNGE - OLYMPIC_LIFT - PLANK - PLYO - PULL_UP - PUSH_UP - ROW - SHOULDER_PRESS - SHOULDER_STABILITY - SHRUG - SIT_UP - SQUAT - TOTAL_BODY - TRICEPS_EXTENSION - WARM_UP - RUN - BIKE - CARDIO_SENSORS name: type: string description: Name of workout step nullable: true YogaPlannedWorkoutStep: type: object properties: targets: type: array description: List of targets for the workout items: $ref: '#/components/schemas/PlannedWorkoutStepTarget' type: description: Type of workout step - either repeat or one-off nullable: false type: string enum: - STEP - REPEAT_STEP intensity: type: integer description: Planned intensity for the workout step nullable: true order: type: integer description: Position of the workout step in the overall workout nullable: true description: type: string description: Description of workout step nullable: true durations: type: array description: List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed items: $ref: '#/components/schemas/PlannedWorkoutStepDuration' name: type: string description: Name of workout step nullable: true PilatesPlannedWorkoutStep: type: object properties: targets: type: array description: List of targets for the workout items: $ref: '#/components/schemas/PlannedWorkoutStepTarget' type: description: Type of workout step - either repeat or one-off nullable: false type: string enum: - STEP - REPEAT_STEP intensity: type: integer description: Planned intensity for the workout step nullable: true order: type: integer description: Position of the workout step in the overall workout nullable: true description: type: string description: Description of workout step nullable: true durations: type: array description: List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed items: $ref: '#/components/schemas/PlannedWorkoutStepDuration' name: type: string description: Name of workout step nullable: true RunningPlannedWorkoutStep: type: object properties: targets: type: array description: List of targets for the workout items: $ref: '#/components/schemas/PlannedWorkoutStepTarget' type: description: Type of workout step - either repeat or one-off nullable: false type: string enum: - STEP - REPEAT_STEP intensity: type: integer description: Planned intensity for the workout step nullable: true order: type: integer description: Position of the workout step in the overall workout nullable: true description: type: string description: Description of workout step nullable: true durations: type: array description: List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed items: $ref: '#/components/schemas/PlannedWorkoutStepDuration' name: type: string description: Name of workout step nullable: true CyclingPlannedWorkoutStep: type: object properties: targets: type: array description: List of targets for the workout items: $ref: '#/components/schemas/PlannedWorkoutStepTarget' type: description: Type of workout step - either repeat or one-off nullable: false type: string enum: - STEP - REPEAT_STEP intensity: type: integer description: Planned intensity for the workout step nullable: true order: type: integer description: Position of the workout step in the overall workout nullable: true description: type: string description: Description of workout step nullable: true durations: type: array description: List of conditions to be fulfilled for the workout step to be completed - all of the conditions must be completed items: $ref: '#/components/schemas/PlannedWorkoutStepDuration' name: type: string description: Name of workout step nullable: true PlannedWorkoutSteps: type: object properties: {} oneOf: - $ref: '#/components/schemas/PlannedWorkoutStep' - $ref: '#/components/schemas/PlannedWorkoutRepeatStep' - $ref: '#/components/schemas/SwimmingPlannedWorkoutStep' - $ref: '#/components/schemas/CardioPlannedWorkoutStep' - $ref: '#/components/schemas/StrengthPlannedWorkoutStep' - $ref: '#/components/schemas/YogaPlannedWorkoutStep' - $ref: '#/components/schemas/PilatesPlannedWorkoutStep' - $ref: '#/components/schemas/RunningPlannedWorkoutStep' - $ref: '#/components/schemas/CyclingPlannedWorkoutStep' discriminator: propertyName: type mapping: PlannedWorkoutStep: '#/components/schemas/PlannedWorkoutStep' PlannedWorkoutRepeatStep: '#/components/schemas/PlannedWorkoutRepeatStep' SwimmingPlannedWorkoutStep: '#/components/schemas/SwimmingPlannedWorkoutStep' CardioPlannedWorkoutStep: '#/components/schemas/CardioPlannedWorkoutStep' StrengthPlannedWorkoutStep: '#/components/schemas/StrengthPlannedWorkoutStep' YogaPlannedWorkoutStep: '#/components/schemas/YogaPlannedWorkoutStep' PilatesPlannedWorkoutStep: '#/components/schemas/PilatesPlannedWorkoutStep' RunningPlannedWorkoutStep: '#/components/schemas/RunningPlannedWorkoutStep' CyclingPlannedWorkoutStep: '#/components/schemas/CyclingPlannedWorkoutStep' PlannedWorkoutMetadata: type: object properties: estimated_energy_kj: type: - number - 'null' description: Estimated energy expenditure for the workout estimated_speed_meters_per_second: type: - number - 'null' description: Estimated speed for the workout estimated_elevation_gain_meters: type: - number - 'null' description: Estimated elevation gain for the workout estimated_tss: type: - number - 'null' description: Estimated Training Stress Score for the workout estimated_calories: type: - integer - 'null' description: Estimated calorie burn for the workout created_date: type: - string - 'null' description: The creation datetime 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 example: '2022-11-23T09:00:00.000000+02:00' format: date-time planned_date: type: string description: The planned start datetime, in ISO8601 format with microsecond precision. TimeZone info will be provided whenever possible. If absent, the time corresponds to the user's local time example: '2022-11-24T09:00:00.000000+02:00' format: date-time nullable: true type: description: The name - either user-entered or given by the fitness data provider - of the associated workout plan nullable: false type: string enum: - IN_VEHICLE - BIKING - STILL - UNKNOWN - TILTING - WALKING - RUNNING - AEROBICS - BADMINTON - BASEBALL - BASKETBALL - BIATHLON - HANDBIKING - MOUNTAIN_BIKING - ROAD_BIKING - SPINNING - STATIONARY_BIKING - UTILITY_BIKING - BOXING - CALISTHENICS - CIRCUIT_TRAINING - CRICKET - DANCING - ELLIPTICAL - FENCING - AMERICAN_FOOTBALL - AUSTRALIAN_FOOTBALL - ENGLISH_FOOTBALL - FRISBEE - GARDENING - GOLF - GYMNASTICS - HANDBALL - HIKING - HOCKEY - HORSEBACK_RIDING - HOUSEWORK - JUMPING_ROPE - KAYAKING - KETTLEBELL_TRAINING - KICKBOXING - KITESURFING - MARTIAL_ARTS - MEDITATION - MIXED_MARTIAL_ARTS - P90X_EXERCISES - PARAGLIDING - PILATES - POLO - RACQUETBALL - ROCK_CLIMBING - ROWING - ROWING_MACHINE - RUGBY - JOGGING - RUNNING_ON_SAND - TREADMILL_RUNNING - SAILING - SCUBA_DIVING - SKATEBOARDING - SKATING - CROSS_SKATING - INDOOR_ROLLERBLADING - SKIING - BACK_COUNTRY_SKIING - CROSS_COUNTRY_SKIING - DOWNHILL_SKIING - KITE_SKIING - ROLLER_SKIING - SLEDDING - SNOWBOARDING - SNOWMOBILE - SNOWSHOEING - SQUASH - STAIR_CLIMBING - STAIR_CLIMBING_MACHINE - STAND_UP_PADDLEBOARDING - STRENGTH_TRAINING - SURFING - SWIMMING - SWIMMING_SWIMMING_POOL - SWIMMING_OPEN_WATER - TABLE_TENNIS - TEAM_SPORTS - TENNIS - TREADMILL - VOLLEYBALL - VOLLEYBALL_BEACH - VOLLEYBALL_INDOOR - WAKEBOARDING - WALKING_FITNESS - NORDIC_WALKING - WALKING_TREADMILL - WATERPOLO - WEIGHTLIFTING - WHEELCHAIR - WINDSURFING - YOGA - ZUMBA - DIVING - ERGOMETER - ICE_SKATING - INDOOR_SKATING - CURLING - OTHER - CROSSFIT - HIIT - INTERVAL_TRAINING - WALKING_STROLLER - ELEVATOR - ESCALATOR - ARCHERY - SOFTBALL - GUIDED_BREATHING - CARDIO_TRAINING - LACROSSE - STRETCHING - TRIATHLON - INLINE_SKATING - SKY_DIVING - PADDLING - MOUNTAINEERING - FISHING - WATER_SKIING - INDOOR_RUNNING id: type: - string - 'null' default: null estimated_duration_seconds: type: - integer - 'null' description: Estimated workout duration estimated_pace_minutes_per_kilometer: type: - number - 'null' description: Estimated pace for the workout provider: type: string description: Name of the original source of the workout plan estimated_tscore: type: - number - 'null' description: Estimated training stress score for the workout (normalized power-based metric) description: type: - string - 'null' description: Description of the workout name: type: - string - 'null' description: Name of the workout plan estimated_distance_meters: type: - integer - 'null' description: Estimated distance for the workout estimated_if: type: - number - 'null' description: Estimated Intensity Factor for the workout pool_length_meters: type: - integer - 'null' description: Pool length of the pool used for the workout - only relevant for swimming activity types PlannedWorkout: type: object properties: steps: type: array description: List of exercises/steps/intervals for the workout plan items: $ref: '#/components/schemas/PlannedWorkoutSteps' metadata: description: Metadata for the workout plan type: object allOf: - $ref: '#/components/schemas/PlannedWorkoutMetadata' DataProcessingWebhook: $ref: '#/components/schemas/ProcessingEvent' 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' GoogleNoDataSourceWebhook: $ref: '#/components/schemas/GoogleNoDatasourceEvent' ConnectionErrorWebhook: $ref: '#/components/schemas/ConnectionErrorEvent' LargeRequestSendingWebhook: $ref: '#/components/schemas/LargeRequestSendingEvent' LargeRequestProcessingResponse: $ref: '#/components/schemas/LargeRequestProcessingEvent' AuthenticationFailedWebhook: $ref: '#/components/schemas/AuthErrorEvent' HealthCheckWebhook: $ref: '#/components/schemas/HealthcheckEvent' RateLimitHitWebhook: $ref: '#/components/schemas/RateLimitHitEvent' 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' 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://api.tryterra.co/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' TerraUser: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/TerraUser.yaml 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 last_webhook_update: type: string examples: - '2022-12-12T10:00:00.000000+00:00' description: Last time at which a webhook update was sent for the connection scopes: type: string examples: - activity:read,sleep:read description: (when available) Permissions granted by the user during authentication - to be used as debugging metadata reference_id: type: string 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: type: boolean 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ActivityLevel.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ActivityLevelSample.yaml type: object properties: timestamp: type: string 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: $ref: '#/components/schemas/ActivityLevel' ActiveDurationsData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ActiveDurationsData.yaml type: object properties: activity_levels_samples: type: array items: $ref: '#/components/schemas/ActivityLevelSample' description: Array of detailed samples of the intensity the user was in at various points during the workout. activity_seconds: type: number examples: - 1800 minimum: 0 description: Total number of seconds spent in an active state during the workout. inactivity_seconds: type: number examples: - 600 minimum: 0 description: Total number of seconds spent in an inactive state during the workout. low_intensity_seconds: type: number examples: - 900 minimum: 0 description: Total number of seconds spent in a low intensity state during the workout. moderate_intensity_seconds: type: number examples: - 600 minimum: 0 description: Total number of seconds spent in a moderate intensity state during the workout. num_continuous_inactive_periods: type: integer examples: - 3 minimum: 0 description: Maximum number of continuous periods spent in an inactive state during the workout. rest_seconds: type: number examples: - 120 minimum: 0 description: Total number of seconds spent resting during the workout. vigorous_intensity_seconds: type: number examples: - 300 minimum: 0 description: Total number of seconds spent in a state of vigorous intensity during the workout. standing_hours_count: type: number standing_seconds: type: number CalorieSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/CalorieSample.yaml type: object properties: timestamp: type: string 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: type: number description: Number of calories burned at the given timestamp. timer_duration_seconds: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/CaloriesData.yaml type: object properties: BMR_calories: type: number description: Basal Metabolic Rate calories - calories burned at rest. calorie_samples: type: array items: $ref: '#/components/schemas/CalorieSample' description: Array of calorie data samples recorded throughout the time period. net_activity_calories: type: number description: Net calories burned through activity (excluding BMR). net_intake_calories: type: number description: Net calories consumed through food and drink intake. total_burned_calories: type: number description: Total calories burned including BMR and activity. DataEnrichment: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DataEnrichment.yaml type: object properties: stress_score: type: integer description: User's stress score. DeviceDataType: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DeviceDataType.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/OtherDeviceData.yaml type: object properties: manufacturer: type: string examples: - Garmin description: Device manufacturer name. hardware_version: type: string examples: - v2.1 description: Hardware version of the device. serial_number: type: string examples: - GR123456789 description: Device Serial Number. name: type: string 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: type: string examples: - 5.2.1 description: Device Software Version. activation_timestamp: type: string description: Activation timestamp of the device, if applicable. data_provided: type: array items: $ref: '#/components/schemas/DeviceDataType' description: Data provided by the device, as enumerated types. last_upload_date: type: string description: Last upload date from the device. DeviceData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DeviceData.yaml type: object properties: activation_timestamp: type: string examples: - '2022-12-25T00:00:00.000000+05:00' description: Activation timestamp of the device, if applicable. data_provided: type: array items: $ref: '#/components/schemas/DeviceDataType' description: Data provided by the device, as enumerated types. hardware_version: type: string examples: - v2.1 description: Hardware version of the device. last_upload_date: type: string description: Last upload date from the device. manufacturer: type: string examples: - Garmin description: Device manufacturer name. name: type: string 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: type: array items: $ref: '#/components/schemas/OtherDeviceData' description: Data pertaining to other devices which may have contributed data for this workout. sensor_state: type: string description: Sensor state of the device. serial_number: type: string examples: - GR123456789 description: Device Serial Number. software_version: type: string examples: - 5.2.1 description: Device Software Version. DistanceSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DistanceSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 2500 description: Cumulative distance covered up to associated timestamp, since the start of the payload timer_duration_seconds: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ElevationSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 925 description: User's altitude at a given point in time, in meters above sea level. timer_duration_seconds: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/FloorsClimbedSample.yaml type: object properties: timestamp: type: string 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: type: integer 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: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/StepSample.yaml type: object properties: timestamp: type: string 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: type: integer description: Cumulative number of steps taken up to associated timestamp, since the start of the payload timer_duration_seconds: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DistanceDataDetailed.yaml type: object properties: distance_samples: type: array items: $ref: '#/components/schemas/DistanceSample' description: Array of detailed samples of distance covered throughout the workout. elevation_samples: type: array items: $ref: '#/components/schemas/ElevationSample' description: Array of detailed samples of elevation throughout the workout. floors_climbed_samples: type: array items: $ref: '#/components/schemas/FloorsClimbedSample' description: Array of detailed samples of floors climbed throughout the workout, as determined by the fitness data provider. step_samples: type: array items: $ref: '#/components/schemas/StepSample' description: Array of detailed samples of steps performed throughout the workout. ElevationData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ElevationData.yaml type: object properties: avg_meters: type: number examples: - 950 description: Average elevation of the user throughout the workout. gain_actual_meters: type: number 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: type: number examples: - 500 minimum: 0 description: Planned elevation gain for the workout. loss_actual_meters: type: number examples: - 450 minimum: 0 description: Elevation loss of the user throughout the workout. max_meters: type: number examples: - 1200 description: Maximum elevation of the user during the workout. min_meters: type: number examples: - 800 description: Minimum elevation of the user during the workout. SwimmingData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/SwimmingData.yaml type: object properties: num_laps: type: integer examples: - 20 minimum: 0 description: Total number of swimming laps performed during the day. num_strokes: type: integer examples: - 500 minimum: 0 description: Total number of swimming strokes performed during the day. pool_length_meters: type: integer examples: - 25 minimum: 0 description: Pool length for associated with the day. DistanceDataSummary: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DistanceDataSummary.yaml type: object properties: distance_meters: type: integer description: Total distance covered by the user throughout the workout. elevation: $ref: '#/components/schemas/ElevationData' description: Object containing information on the elevation of the user throughout the workout. floors_climbed: type: integer description: Total number of elevation gain in floors climbed equivalent throughout the workout, as determined by the fitness data provider. steps: type: integer description: Total number of steps performed during the workout. swimming: $ref: '#/components/schemas/SwimmingData' description: Summary information of the user's swimming statistics for the workout, if applicable. DistanceData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DistanceData.yaml type: object properties: detailed: $ref: '#/components/schemas/DistanceDataDetailed' description: Object containing detailed distance information - this may included second-by-second samples. summary: $ref: '#/components/schemas/DistanceDataSummary' description: Object containing summary information related to distance covered throughout the workout. EnergyData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/EnergyData.yaml type: object properties: energy_kilojoules: type: number examples: - 1200 description: Total number of kiloJoules expended during the workout energy_planned_kilojoules: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HeartRateContext.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HeartRateDataSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 142 description: User's heart rate in bpm timer_duration_seconds: type: number examples: - 600 description: Time elapsed since the start of the workout, subtracting time during which the recording was paused context: $ref: '#/components/schemas/HeartRateContext' description: Represents the context in which heart rate was measured. HeartRateVariabilityDataSampleRMSSD: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HeartRateVariabilityDataSampleRMSSD.yaml type: object properties: timestamp: type: string 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: type: number examples: - 42.1 description: User's Heart Rate Variability, computed using RMSSD HeartRateVariabilityDataSampleSDNN: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HeartRateVariabilityDataSampleSDNN.yaml type: object properties: timestamp: type: string 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: type: number examples: - 48.3 description: User's Heart Rate Variability, computed using SDNN HeartRateDataDetailed: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HeartRateDataDetailed.yaml type: object properties: hr_samples: type: array items: $ref: '#/components/schemas/HeartRateDataSample' description: Array of HeartRate data samples recorded for the user during the workout. hrv_samples_rmssd: type: array items: $ref: '#/components/schemas/HeartRateVariabilityDataSampleRMSSD' description: Array of HeartRate Variability data samples recorded for the user during the workout, computed using RMSSD. hrv_samples_sdnn: type: array items: $ref: '#/components/schemas/HeartRateVariabilityDataSampleSDNN' description: Array of HeartRate Variability data samples recorded for the user during the workout, computed using SDNN. HeartRateZone: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HeartRateZone.yaml oneOf: - type: number const: 0 description: Resting heart rate zone. title: Zone 0 - type: number const: 1 description: Very light activity zone. title: Zone 1 - type: number const: 2 description: Light activity zone. title: Zone 2 - type: number const: 3 description: Moderate activity zone. title: Zone 3 - type: number const: 4 description: Hard activity zone. title: Zone 4 - type: number const: 5 description: Maximum effort zone. title: Zone 5 - type: number const: 6 description: Heart rate zone that doesn't fit into the standard zones or couldn't be classified. title: Other examples: - 2 description: Represents the heart rate zone the user is currently in during a workout or activity HeartRateZoneData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HeartRateZoneData.yaml type: object properties: zone: $ref: '#/components/schemas/HeartRateZone' description: Heart rate zone designation start_percentage: type: number examples: - 60 minimum: 0 maximum: 100 description: Start percentage (based off user's max HR) of the HR zone end_percentage: type: number examples: - 70 minimum: 0 maximum: 100 description: End percentage (based off user's max HR) of the HR zone name: type: string examples: - Aerobic description: Name of the associated heart rate zone duration_seconds: type: number examples: - 300 description: Duration spent in the heart rate zone HeartRateDataSummary: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HeartRateDataSummary.yaml type: object properties: avg_hr_bpm: type: number examples: - 145 minimum: 0 description: Average HeartRate of the user during the workout. avg_hrv_rmssd: type: number examples: - 35.2 description: Average HeartRate Variability of the user during the workout, computed using RMSSD. avg_hrv_sdnn: type: number examples: - 45.5 description: Average HeartRate Variability of the user during the workout, computed using SDNN. hr_zone_data: type: array items: $ref: '#/components/schemas/HeartRateZoneData' description: Array of time spent in various HR zones throughout the workout. max_hr_bpm: type: number examples: - 180 minimum: 0 description: Maximum HeartRate of the user during the workout. min_hr_bpm: type: number examples: - 85 minimum: 0 description: Minimum HeartRate of the user during the workout. resting_hr_bpm: type: number examples: - 65 minimum: 0 description: Resting HeartRate of the user, as determined by the fitness data provider. user_max_hr_bpm: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HeartRateData.yaml type: object properties: detailed: $ref: '#/components/schemas/HeartRateDataDetailed' description: Object containing detailed heart rate information for the associated workout. summary: $ref: '#/components/schemas/HeartRateDataSummary' description: Object containing summary heart rate information for the associated workout. StrokeType: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/StrokeType.yaml oneOf: - type: string const: other description: Any swimming stroke style that doesn't fit the standard categories. title: Other - type: string const: freestyle description: Front crawl stroke where swimmers alternate arm movements with face in water. title: Freestyle - type: string const: backstroke description: Swimming stroke performed on the back with alternating arm movements. title: Backstroke - type: string const: breaststroke description: Swimming stroke where arms move simultaneously in a heart-shaped pattern with a frog kick. title: Breaststroke - type: string const: butterfly description: Swimming stroke with simultaneous overhead arm movements and dolphin kick. title: Butterfly examples: - backstroke description: Stroke type used for the workout step (e.g. breaststroke) LapSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/LapSample.yaml type: object properties: calories: type: number examples: - 50 description: Calories burned during the lap avg_hr_bpm: type: number examples: - 145 description: Average heart rate in bpm, for the Lap sample start_time: type: string 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: type: number examples: - 3.5 description: Average speed of the user during the lap distance_meters: type: number examples: - 400 description: Distance covered during the lap total_strokes: type: integer examples: - 20 description: Total strokes performed during the lap - only relevant for swimming activities end_time: type: string 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: $ref: '#/components/schemas/StrokeType' examples: - freestyle description: Stroke type - only relevant for swimming activities LapData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/LapData.yaml type: object properties: laps: type: array items: $ref: '#/components/schemas/LapSample' description: Array of datapoints for each lap performed by the user during the workout. METSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/METSample.yaml type: object properties: timestamp: type: string 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: type: number description: Metabolic Equivalent of Task (MET) level at the given timestamp METData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/METData.yaml type: object properties: MET_samples: type: array items: $ref: '#/components/schemas/METSample' description: An array of Metabolic Equivalent Time samples, as calculated by the user's wearable. avg_level: type: number examples: - 3.8 description: The average MET level of the activity. num_high_intensity_minutes: type: number examples: - 10 minimum: 0 description: Number of minutes spent in High Intensity during the workout - based off MET scale. num_inactive_minutes: type: number examples: - 5 minimum: 0 description: Number of minutes spent in state of Inactivity during the workout - based off MET scale. num_low_intensity_minutes: type: number examples: - 15 minimum: 0 description: Number of minutes spent in Low Intensity during the workout - based off MET scale. num_moderate_intensity_minutes: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/TimestampLocalization.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ActivityType.yaml 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 examples: - 8 description: The type of activity performed for the associated workout. UploadType: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/UploadType.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ActivityMetadata.yaml type: object properties: city: type: string examples: - San Francisco description: The City in which the workout was performed. country: type: string 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: type: string 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: type: string 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: $ref: '#/components/schemas/TimestampLocalization' 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/CadenceSample.yaml type: object properties: timestamp: type: string 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: type: number description: User's cadence at a given instant in time, in revolutions per minute timer_duration_seconds: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/SpeedSample.yaml type: object properties: timestamp: type: string 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: type: number description: Speed of the user at a given instant in time, in meters per second timer_duration_seconds: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/TorqueSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 300 description: Time elapsed since the start of the workout, subtracting time during which the recording was paused torque_newton_meters: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/MovementData.yaml type: object properties: adjusted_max_speed_meters_per_second: type: number 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: type: number examples: - 85 description: Average cadence of the user during the workout, in RPM. avg_pace_minutes_per_kilometer: type: number examples: - 6.2 description: Average pace of the user during the workout. avg_speed_meters_per_second: type: number examples: - 3.2 description: Average speed of the user during the workout. avg_torque_newton_meters: type: number examples: - 40 description: Average torque generated by the user during the workout - mainly relevant for cycling activities. avg_velocity_meters_per_second: type: number examples: - 3 description: Average velocity of the user during the workout - only calculated by certain providers, representing a separate quantity from speed. cadence_samples: type: array items: $ref: '#/components/schemas/CadenceSample' description: Array of cadence values recorded throughout the workout, sampled at intervals determined by the fitness data provider. max_cadence_rpm: type: number examples: - 110 description: Maximum cadence of the user during the workout - mainly relevant for cycling activities. max_pace_minutes_per_kilometer: type: number examples: - 6.5 description: Maximum pace of the user during the workout. max_speed_meters_per_second: type: number examples: - 4.5 description: Maximum speed of the user during the workout. max_torque_newton_meters: type: number examples: - 55.5 description: Maximum torque generated by the user during the workout - mainly relevant for cycling activities. max_velocity_meters_per_second: type: number 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: type: number 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: type: array items: $ref: '#/components/schemas/SpeedSample' description: Array of the datapoints for the user's speed sampled throughout the workout. torque_samples: type: array items: $ref: '#/components/schemas/TorqueSample' description: Array of the datapoints for the user's torque sampled throughout the workout. OxygenSaturationType: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/OxygenSaturationType.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/OxygenSaturationSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 98 description: User's oxygen saturation percentage - referring to either SpO2 or SmO2, based on the `type` field type: $ref: '#/components/schemas/OxygenSaturationType' description: Type of oxygen saturation measurement (i.e. blood vs muscle) Vo2MaxSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/Vo2MaxSample.yaml type: object properties: timestamp: type: string 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: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/OxygenData.yaml type: object properties: avg_saturation_percentage: type: number examples: - 98 description: Average Oxygen Saturation percentage of the user during the day (SpO2 or SmO2). saturation_samples: type: array items: $ref: '#/components/schemas/OxygenSaturationSample' description: Array of Oxygen Saturation percentage datapoints sampled throughout the day. vo2_samples: type: array items: $ref: '#/components/schemas/Vo2MaxSample' description: Array of VO2 datapoints sampled throughout the day. vo2max_ml_per_min_per_kg: type: number examples: - 45.5 description: VO2Max for the given user. PolylineMapData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/PolylineMapData.yaml type: object properties: summary_polyline: type: string 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/PositionSample.yaml type: object properties: timestamp: type: string 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: type: array prefixItems: - type: number - type: number 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: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/PositionData.yaml type: object properties: center_pos_lat_lng_deg: type: array items: type: number 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: type: array items: type: number 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: type: array items: $ref: '#/components/schemas/PositionSample' description: Array of datapoints of the position of the user, sampled throughout the workout. start_pos_lat_lng_deg: type: array items: type: number 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. PowerSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/PowerSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 250 description: Power generated at a given instant in time, in Watts timer_duration_seconds: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/PowerData.yaml type: object properties: avg_watts: type: number examples: - 185 description: Average power output of the user during the workout. max_watts: type: number examples: - 350 description: Maximum power output of the user during the workout. power_samples: type: array items: $ref: '#/components/schemas/PowerSample' 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/StrainData.yaml type: object properties: strain_level: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/TSSSample.yaml type: object properties: planned: type: number description: Planned Training Stress Score value actual: type: number description: Actual Training Stress Score value achieved method: type: string description: Method used to calculate the TSS intensity_factor_planned: type: number description: Planned intensity factor for the training session intensity_factor_actual: type: number description: Actual intensity factor achieved during the training session normalized_power_watts: type: number description: Normalized power output in watts TSSData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/TSSData.yaml type: object properties: TSS_samples: type: array items: $ref: '#/components/schemas/TSSSample' description: Array of TSS information sampled throughout the workout WorkData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/WorkData.yaml type: object properties: work_kilojoules: type: number examples: - 450.5 description: Total work output of the user for the workout, in kilojoules. WebhookEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/WebhookEvent.yaml type: object properties: type: type: string description: The type of event status: type: string description: Status of the event required: - type description: Base webhook event structure that all events extend from LargeRequestProcessingEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/LargeRequestProcessingEvent.yaml 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 BloodPressureSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/BloodPressureSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 80.5 description: User's diastolic blood pressure, in mmHg systolic_bp: type: number examples: - 120.5 description: User's systolic blood pressure, in mmHg BloodPressureData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/BloodPressureData.yaml type: object properties: blood_pressure_samples: type: array items: $ref: '#/components/schemas/BloodPressureSample' description: List of Blood Pressure measurements sampled throughout the day. AFibFlag: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/AFibFlag.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/AFibClassificationSample.yaml type: object properties: timestamp: type: string 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: $ref: '#/components/schemas/AFibFlag' description: Flag indicating the atrial fibrillation classification of the individual RawECGSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/RawECGSample.yaml type: object properties: potential_uV: type: number examples: - 1250.5 description: Potential uV in the RawECG Sample timestamp: type: string 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ECGReading.yaml type: object properties: start_timestamp: type: string 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: type: number examples: - 72.5 description: User's average heart rate throughout the day, in beats per minute (bpm). afib_classification: $ref: '#/components/schemas/AFibFlag' description: User's afib classification throught the day. raw_signal: type: array items: $ref: '#/components/schemas/RawECGSample' description: List of raw ECG readings sampled through the day. PulseVelocitySample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/PulseVelocitySample.yaml type: object properties: timestamp: type: string 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: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/RRIntervalSample.yaml type: object properties: rr_interval_ms: type: number examples: - 850 description: User's RR Interval for a specific heart beat in milliseconds. timestamp: type: string 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: type: number examples: - 72 description: The heart beat value at that specific instance. HeartData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HeartData.yaml type: object properties: afib_classification_samples: type: array items: $ref: '#/components/schemas/AFibClassificationSample' description: List of Atrial Fibrillation classification measurements sampled through the day. ecg_signal: type: array items: $ref: '#/components/schemas/ECGReading' description: List of ECGReadings sampled through the day. heart_rate_data: $ref: '#/components/schemas/HeartRateData' description: Object containing heart rate data. pulse_wave_velocity_samples: type: array items: $ref: '#/components/schemas/PulseVelocitySample' 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: type: array items: $ref: '#/components/schemas/RRIntervalSample' description: List of RR Interval samples throughout the day. HydrationMeasurementSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HydrationMeasurementSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 40 description: Total body water composition of the user, in kilograms. HydrationData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HydrationData.yaml type: object properties: day_total_water_consumption_ml: type: number examples: - 2500 description: User's total water consumption throughout the day. hydration_amount_samples: type: array items: $ref: '#/components/schemas/HydrationMeasurementSample' description: User's hydration level samples throughout the day. KetoneSampleType: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/KetoneSampleType.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/KetoneSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 1.5 description: Ketone in mg per dL sample_type: $ref: '#/components/schemas/KetoneSampleType' description: Flag indicating the ketone sample type (e.g. blood, breath, urine) KetoneData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/KetoneData.yaml type: object properties: ketone_samples: type: array items: $ref: '#/components/schemas/KetoneSample' description: List of ketone data sampled through the day. MeasurementDataSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/MeasurementDataSample.yaml type: object properties: measurement_time: type: string 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: type: number examples: - 22.4 description: User's Body Mass Index (BMI). BMR: type: number examples: - 1800 description: User's Basal Metabolic Rate - minimum amount of calories that a person's body needs to perform necessary functions. RMR: type: number 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: type: string examples: - '25' description: Estimate of how fit the user is compared to their actual age, as measured by the device. skin_fold_mm: type: number examples: - 12.5 description: User's skin fold measurement. bodyfat_percentage: type: number examples: - 18.5 minimum: 0 maximum: 100 description: User's body fat percentage. weight_kg: type: number examples: - 75.5 description: User's body weight. height_cm: type: number examples: - 178 description: User's height. bone_mass_g: type: number examples: - 3200 description: User's total bone mass. muscle_mass_g: type: number examples: - 35000 description: User's total muscle mass (i.e. skeletal muscle mass). lean_mass_g: type: number examples: - 61500 description: Total lean mass of the user - calculated as the difference between total body weight and body fat weight. water_percentage: type: number examples: - 60.5 minimum: 0 maximum: 100 description: Total amount of fluid in the user's body. insulin_units: type: number examples: - 10.5 description: Quantity of insulin administered to the user. insulin_type: type: string examples: - rapid-acting description: Type of insulin administered to the user. urine_color: type: string examples: - pale yellow description: Color of the user's urine. user_notes: type: string description: User notes associated with the measurement. MeasurementsData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/MeasurementsData.yaml type: object properties: measurements: type: array items: $ref: '#/components/schemas/MeasurementDataSample' description: List of body metrics & measurements taken throughout the associated day. BodyMetadata: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/BodyMetadata.yaml 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: $ref: '#/components/schemas/TimestampLocalization' required: - end_time - start_time TemperatureSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/TemperatureSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 37.2 description: Temperature value in degrees Celsius. TemperatureData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/TemperatureData.yaml type: object properties: ambient_temperature_samples: type: array items: $ref: '#/components/schemas/TemperatureSample' description: List of ambient temperature measurements sampled throughout the day. body_temperature_samples: type: array items: $ref: '#/components/schemas/TemperatureSample' description: List of body temperature measurements sampled throughout the day. skin_temperature_samples: type: array items: $ref: '#/components/schemas/TemperatureSample' description: List of skin temperature measurements sampled throughout the day. GlucoseFlag: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/GlucoseFlag.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/TrendArrow.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/GlucoseDataSample.yaml type: object properties: timestamp: type: string 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: type: integer examples: - 95 description: User's blood glucose reading glucose_level_flag: $ref: '#/components/schemas/GlucoseFlag' description: Flag indicating state of user's blood glucose level trend_arrow: $ref: '#/components/schemas/TrendArrow' 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DailyPatternSample.yaml type: object properties: time_from_midnight: type: integer 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: type: integer description: Percentile 5 of the glucose level at the given time of day. percentile_25: type: integer description: Percentile 25 of the glucose level at the given time of day. percentile_50: type: integer description: Percentile 50 of the glucose level at the given time of day. percentile_75: type: integer description: Percentile 75 of the glucose level at the given time of day. percentile_95: type: integer description: Percentile 95 of the glucose level at the given time of day. GlucoseData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/GlucoseData.yaml type: object properties: blood_glucose_samples: type: array items: $ref: '#/components/schemas/GlucoseDataSample' description: List of blood glucose readings sampled throughout the day. detailed_blood_glucose_samples: type: array items: $ref: '#/components/schemas/GlucoseDataSample' 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: type: number examples: - 92.5 description: User's average glucose level throughout the day. gmi: type: number 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: type: number description: Time that the user's glucose is within acceptable range (not hyper or hypoglycemic). sensor_usage: type: integer description: Number of data points recorded by the sensor throughout the day. daily_patterns: type: array items: $ref: '#/components/schemas/DailyPatternSample' description: List of glucose percentile samples throughout the day. DataContributor: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DataContributor.yaml type: object properties: contributor_name: type: string description: Name of the factor contributing to the score. contributor_score: type: number description: Numerical score representing the contribution of this factor. required: - contributor_name - contributor_score DailyDataEnrichment: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DailyDataEnrichment.yaml type: object properties: cardiovascular_contributors: type: array items: $ref: '#/components/schemas/DataContributor' description: Array of factors contributing to cardiovascular score. cardiovascular_score: type: number description: Cardiovascular health score for the day. immune_contributors: type: array items: $ref: '#/components/schemas/DataContributor' description: Array of factors contributing to immune index. immune_index: type: number description: Immune system health index for the day. readiness_contributors: type: array items: $ref: '#/components/schemas/DataContributor' description: Array of factors contributing to readiness score. readiness_score: type: number description: Readiness score for the day. respiratory_contributors: type: array items: $ref: '#/components/schemas/DataContributor' description: Array of factors contributing to respiratory score. respiratory_score: type: number description: Respiratory health score for the day. start_time: type: string description: Start time for the data enrichment calculation period. stress_contributors: type: array items: $ref: '#/components/schemas/DataContributor' description: Array of factors contributing to stress score. total_stress_score: type: number description: Total stress score for the day. DailyDistanceData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DailyDistanceData.yaml type: object properties: detailed: $ref: '#/components/schemas/DistanceDataDetailed' description: Object containing detailed distance information - this may include second-by-second samples. distance_meters: type: number examples: - 8500.45 description: Total distance covered by the user throughout the day. elevation: $ref: '#/components/schemas/ElevationData' description: Object containing information on the elevation of the user throughout the day. floors_climbed: type: integer 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: type: integer examples: - 12000 description: Total number of steps performed during the day. swimming: $ref: '#/components/schemas/SwimmingData' description: Summary information of the user's swimming statistics for the day, if applicable. DailyMetadata: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DailyMetadata.yaml 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: $ref: '#/components/schemas/TimestampLocalization' 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ScoresData.yaml type: object properties: activity: type: number examples: - 92 minimum: 0 maximum: 100 description: Activity score for the given day. recovery: type: number examples: - 78 minimum: 0 maximum: 100 description: Recovery score for the given day. sleep: type: number examples: - 85 minimum: 0 maximum: 100 description: Sleep score for the given day, pertaining to the previous night's sleep. biological_age: type: number examples: - 27 minimum: 0 maximum: 100 description: Biological age computed for the given day. StressSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/StressSample.yaml type: object properties: timestamp: type: string 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: type: number description: Stress level measurement at the given timestamp StressLevel: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/StressLevel.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/BodyBatterySample.yaml type: object properties: timestamp: type: string 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: type: number description: Body battery energy level at the given timestamp StressData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/StressData.yaml type: object properties: avg_stress_level: type: number examples: - 45.5 description: Average stress level for the day. activity_stress_duration_seconds: type: number examples: - 3600 minimum: 0 description: Total number of seconds spent in a stressed state while active during the day. low_stress_duration_seconds: type: number examples: - 28800 minimum: 0 description: Total number of seconds spent in a state of low stress during the day. max_stress_level: type: number examples: - 85 description: Maximum stress level recorded during the day. medium_stress_duration_seconds: type: number examples: - 7200 minimum: 0 description: Total number of seconds spent in a state of medium stress during the day. samples: type: array items: $ref: '#/components/schemas/StressSample' description: Array of stress level data points sampled throughout the day. rest_stress_duration_seconds: type: number examples: - 1800 minimum: 0 description: Total number of seconds spent in a stressed state while at rest during the day. high_stress_duration_seconds: type: number examples: - 900 minimum: 0 description: Total number of seconds spent in a state of high stress during the day. stress_duration_seconds: type: number examples: - 5400 minimum: 0 description: Total number of seconds spent in any stressed state during the day. stress_rating: $ref: '#/components/schemas/StressLevel' description: Stress rating for the day. body_battery_samples: type: array items: $ref: '#/components/schemas/BodyBatterySample' description: Array of Body Battery data points sampled throughout the day. TagEntry: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/TagEntry.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/TagData.yaml type: object properties: tags: type: array items: $ref: '#/components/schemas/TagEntry' description: Array of user-entered tags for the day. MenstruationMetadata: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/MenstruationMetadata.yaml 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: $ref: '#/components/schemas/TimestampLocalization' required: - end_time - start_time MenstrualPhase: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/MenstrualPhase.yaml oneOf: - type: string const: menstrual description: The menstrual phase when bleeding occurs. title: Menstrual - type: string const: follicular description: The follicular phase when follicles in ovaries develop. title: Follicular - type: string const: ovulation description: The ovulation phase when an egg is released. title: Ovulation - type: string const: luteal description: The luteal phase following ovulation. title: Luteal - type: string const: pms description: Premenstrual syndrome phase before menstruation begins. title: PMS - type: string const: fertile description: The fertile window when conception is most likely. title: Fertile - type: string const: first_trimester description: First third of pregnancy, weeks 1-12. title: First Trimester - type: string const: second_trimester description: Middle third of pregnancy, weeks 13-26. title: Second Trimester - type: string const: third_trimester description: Final third of pregnancy, weeks 27-40. title: Third Trimester - type: string const: unknown description: Menstrual cycle phase could not be determined. title: Unknown examples: - menstrual description: Represents menstrual cycle phases. MenstruationFlow: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/MenstruationFlow.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/MenstruationFlowSample.yaml type: object properties: timestamp: type: string 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: $ref: '#/components/schemas/MenstruationFlow' description: Flag indicating the strength of the user's menstrual flow. MenstruationData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/MenstruationData.yaml type: object properties: period_length_days: type: integer examples: - 5 description: Total length of period (i.e. menstrual bleeding). current_phase: $ref: '#/components/schemas/MenstrualPhase' description: Phase in associated cycle, (i.e. menstruation, fertile etc). length_of_current_phase_days: type: integer examples: - 5 description: Length of current phase. days_until_next_phase: type: integer examples: - 23 description: Number of days to reach the next phase (predicted). period_start_date: type: string examples: - '2022-11-28' description: Start date of menstrual cycle, in ISO8601 format. predicted_cycle_length_days: type: integer examples: - 28 description: Prediction of the cycle's total length. day_in_cycle: type: integer examples: - 24 description: Number of day in cycle this object is associated with. last_updated_time: type: string 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: type: string examples: - '28' description: Total cycle length in days. is_predicted_cycle: type: string examples: - 'true' description: Flag indicating whether associated object is a prediction or user-logged information. menstruation_flow: type: array items: $ref: '#/components/schemas/MenstruationFlowSample' description: List of user logs of information related to the strength of user's menstrual flow. DrinkSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DrinkSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 250 description: Volume of drink consumed drink_unit: type: string examples: - ml description: Unit of measurement for the drink drink_name: type: string examples: - Water description: Name of drink consumed. NutritionMicros: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/NutritionMicros.yaml type: object properties: biotin_mg: type: number examples: - 0.03 description: Biotin content of the associated food(s). caffeine_mg: type: number examples: - 95 description: Caffeine content of the associated food(s). calcium_mg: type: number examples: - 1000 description: Calcium content of the associated food(s). chloride_mg: type: number examples: - 2300 description: Chloride content of the associated food(s). chromium_mg: type: number examples: - 0.035 description: Chromium content of the associated food(s). copper_mg: type: number examples: - 0.9 description: Copper content of the associated food(s). folate_mg: type: number examples: - 0.4 description: Folate content of the associated food(s). folic_acid_mg: type: number examples: - 0.4 description: Folic Acid content of the associated food(s). iodine_mg: type: number examples: - 0.15 description: Iodine content of the associated food(s). iron_mg: type: number examples: - 8.5 description: Iron content of the associated food(s). magnesium_mg: type: number examples: - 320 description: Magnesium content of the associated food(s). manganese_mg: type: number examples: - 2.3 description: Manganese content of the associated food(s). molybdenum_mg: type: number examples: - 0.045 description: Molybdenum content of the associated food(s). niacin_mg: type: number examples: - 16 description: Niacin content of the associated food(s). pantothenic_acid_mg: type: number examples: - 5 description: Pantothenic content of the associated food(s). phosphorus_mg: type: number examples: - 1000 description: Phosphorus content of the associated food(s). potassium_mg: type: number examples: - 3500 description: Potassium content of the associated food(s). riboflavin_mg: type: number examples: - 1.3 description: Riboflavin content of the associated food(s). selenium_mg: type: number examples: - 0.055 description: Selenium content of the associated food(s). thiamin_mg: type: number examples: - 1.2 description: Thiamin content of the associated food(s). vitamin_A_mg: type: number examples: - 0.9 description: Vitamin A content of the associated food(s). vitamin_B12_mg: type: number examples: - 0.0024 description: Vitamin B12 content of the associated food(s). vitamin_B6_mg: type: number examples: - 1.7 description: Vitamin B6 content of the associated food(s). vitamin_C_mg: type: number examples: - 90 description: Vitamin C content of the associated food(s). vitamin_D_mg: type: number examples: - 0.02 description: Vitamin D content of the associated food(s). vitamin_D2_mg: type: number examples: - 0.01 description: Vitamin D2 content of the associated food(s). vitamin_D3_mg: type: number examples: - 0.015 description: Vitamin D3 content of the associated food(s). vitamin_E_mg: type: number examples: - 15 description: Vitamin E content of the associated food(s). vitamin_K_mg: type: number examples: - 0.12 description: Vitamin K content of the associated food(s). zinc_mg: type: number examples: - 11 description: Zinc content of the associated food(s). cystine_g: type: number examples: - 0.3 description: Cystine content of the associated food(s). histidine_g: type: number examples: - 0.6 description: Histidine content of the associated food(s). isoleucine_g: type: number examples: - 0.8 description: Isoleucine content of the associated food(s). leucine_g: type: number examples: - 1.2 description: Leucine content of the associated food(s). lysine_g: type: number examples: - 0.9 description: Lysine content of the associated food(s). methionine_g: type: number examples: - 0.6 description: Methionine content of the associated food(s). phenylalanine_g: type: number examples: - 0.9 description: Phenylalanine content of the associated food(s). threonine_g: type: number examples: - 0.5 description: Threonine content of the associated food(s). tryptophan_g: type: number examples: - 0.3 description: Tryptophan content of the associated food(s). tyrosine_g: type: number examples: - 0.7 description: Tyrosine content of the associated food(s). valine_g: type: number examples: - 0.8 description: Valine content of the associated food(s). monounsaturated_fat_g: type: number examples: - 15 description: Monounsaturated fat content of the associated food(s). polyunsaturated_fat_g: type: number examples: - 13 description: Polyunsaturated fat content of the associated food(s). omega3_g: type: number examples: - 1.6 description: Omega3 content of the associated food(s). omega6_g: type: number examples: - 17 description: Omega6 content of the associated food(s). starch_g: type: number examples: - 25 description: Starch content of the associated food(s). MealType: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/MealType.yaml 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) NutritionUnits: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/NutritionUnits.yaml 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 NutritionQuantity: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/NutritionQuantity.yaml type: object properties: unit: $ref: '#/components/schemas/NutritionUnits' amount: type: number required: - unit - amount NutritionMacros: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/NutritionMacros.yaml type: object properties: alcohol_g: type: number examples: - 14 description: Alcohol content of the associated food(s). calories: type: number examples: - 2000 description: Calorie content of the associated food(s). carbohydrates_g: type: number examples: - 300 description: Carbohydrates content of the associated food(s). cholesterol_mg: type: number examples: - 300 description: Cholesterol content of the associated food(s). fat_g: type: number examples: - 65 description: Fat content of the associated food(s). fiber_g: type: number examples: - 25 description: Fiber content of the associated food(s). net_carbohydrates_g: type: number examples: - 275 description: Net carbs content of the associated food(s). protein_g: type: number examples: - 50 description: Protein content of the associated food(s). saturated_fat_g: type: number examples: - 20 description: Saturated fat content of the associated food(s). sodium_mg: type: number examples: - 2300 description: Sodium content of the associated food(s). sugar_g: type: number examples: - 25 description: Sugar content of the associated food(s). trans_fat_g: type: number examples: - 2 description: Trans fat content of the associated food(s). Meal: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/Meal.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/NutritionMetadata.yaml 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: $ref: '#/components/schemas/TimestampLocalization' required: - end_time - start_time NutritionSummary: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/NutritionSummary.yaml type: object properties: macros: $ref: '#/components/schemas/NutritionMacros' description: Summary of macronutrient information for a given day. micros: $ref: '#/components/schemas/NutritionMicros' description: Summary of micronutrient information for a given day. water_ml: type: number examples: - 2000 description: Water consumption of the user for a given day. drink_ml: type: number examples: - 500 description: Non-water drink consumption of the user for a given day. SleepDataEnrichment: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/SleepDataEnrichment.yaml type: object properties: sleep_contributors: type: array items: $ref: '#/components/schemas/DataContributor' sleep_score: type: number SleepUploadType: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/SleepUploadType.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/SleepMetadata.yaml 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: type: boolean 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: type: string description: A unique identifier for the sleep session. timestamp_localization: $ref: '#/components/schemas/TimestampLocalization' 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 RecoveryLevel: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/RecoveryLevel.yaml oneOf: - type: number const: 0 description: Recovery level could not be determined or is not available. title: Unknown - type: number const: 1 description: Extremely low recovery. title: Very Poor - type: number const: 2 description: Low recovery level. title: Poor - type: number const: 3 description: Below average recovery. title: Compromised - type: number const: 4 description: Moderate recovery level. title: Ok - type: number const: 5 description: Above average recovery. title: Good - type: number const: 6 description: Excellent recovery level. title: Very Good examples: - 5 description: User's recovery score for a given day, resulting from the sleep session ReadinessData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ReadinessData.yaml type: object properties: readiness: type: integer examples: - 85 minimum: 0 maximum: 100 description: User's readiness score for a given day, resulting from the sleep session. recovery_level: $ref: '#/components/schemas/RecoveryLevel' description: User's recovery score for a given day, resulting from the sleep session - takes Enum value. BreathSample: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/BreathSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 16 description: User's respiration rate BreathsData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/BreathsData.yaml type: object properties: avg_breaths_per_min: type: number examples: - 14 description: Average breathing rate of the user during the sleep session. max_breaths_per_min: type: number examples: - 18 description: Maximum breathing rate of the user during the sleep session. min_breaths_per_min: type: number examples: - 10 description: Minimum breathing rate of the user during the sleep session. on_demand_reading: type: boolean examples: - false description: Flag indicating if the reading was performed on demand, or if it was automatically captured by the device. samples: type: array items: $ref: '#/components/schemas/BreathSample' description: List of breathing rate information sampled throughout the sleep session. start_time: type: string 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: type: string 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/OxygenSaturationData.yaml type: object properties: avg_saturation_percentage: type: number examples: - 97 description: Average Oxygen Saturation percentage of the user during the sleep session. end_time: type: string 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: type: array items: $ref: '#/components/schemas/OxygenSaturationSample' description: Array of Oxygen Saturation percentage datapoints sampled throughout the sleep session. start_time: type: string 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/SnoringSample.yaml type: object properties: timestamp: type: string 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: type: number examples: - 120 description: Duration of snoring episode, in seconds SnoringData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/SnoringData.yaml type: object properties: start_time: type: string 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: type: string 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: type: integer examples: - 12 description: Number of times over the sleep period when the user started snoring, as determined by the device. samples: type: array items: $ref: '#/components/schemas/SnoringSample' description: List of snoring information data points sampled throughout the sleep session. total_snoring_duration_seconds: type: number examples: - 3600 description: Total duration for which the user was snoring. RespirationData: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/RespirationData.yaml type: object properties: breaths_data: $ref: '#/components/schemas/BreathsData' description: Object containing information on breathing rate for the sleep session. oxygen_saturation_data: $ref: '#/components/schemas/OxygenSaturationData' description: Object containing information on saturation metrics for the sleep session. snoring_data: $ref: '#/components/schemas/SnoringData' description: Object containing information on snoring metrics for the sleep session. AsleepDurations: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/AsleepDurations.yaml type: object properties: duration_asleep_state_seconds: type: number examples: - 25200 description: Total duration for which the user was asleep, in any state. duration_deep_sleep_state_seconds: type: number examples: - 5400 description: Total duration for which the user was in a state of deep sleep. duration_light_sleep_state_seconds: type: number examples: - 14400 description: Total duration for which the user was in a state of light sleep. duration_REM_sleep_state_seconds: type: number examples: - 5400 description: Total duration for which the user was in a state of REM sleep. num_REM_events: type: integer examples: - 4 description: Number of periods of REM sleep captured during the sleep session. AwakeDurations: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/AwakeDurations.yaml type: object properties: duration_awake_state_seconds: type: number examples: - 1200 description: Total duration for which the user was awake during the sleep session. duration_long_interruption_seconds: type: number 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: type: number 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: type: integer examples: - 1 description: Number of times the user got out of bed during the sleep session. num_wakeup_events: type: integer examples: - 3 description: Number of times the user woke up during the sleep session. sleep_latency_seconds: type: number 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: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/SleepLevel.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/SleepHypnogramSample.yaml type: object properties: timestamp: type: string 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: $ref: '#/components/schemas/SleepLevel' OtherSleepDurations: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/OtherSleepDurations.yaml type: object properties: duration_in_bed_seconds: type: number examples: - 28800 description: Total duration of time spent in bed. duration_unmeasurable_sleep_seconds: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/SleepDurationsData.yaml type: object properties: asleep: $ref: '#/components/schemas/AsleepDurations' description: Object containing information on the duration the user spent asleep during the sleep recording session. awake: $ref: '#/components/schemas/AwakeDurations' description: Object containing information on the duration the user spent awake during the sleep recording session. hypnogram_samples: type: array items: $ref: '#/components/schemas/SleepHypnogramSample' description: List of sleep stage (Hypnogram) samples recorded during the user's sleep session. other: $ref: '#/components/schemas/OtherSleepDurations' description: Object containing information on the miscellaneous duration data for the sleep recording session. sleep_efficiency: type: number 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/SleepTemperatureData.yaml type: object properties: delta: type: number examples: - 0.5 description: Variation in user's skin temperature from their baseline. HealthcheckEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/HealthcheckEvent.yaml type: object properties: type: type: string const: healthcheck status: type: string description: Status of the healthcheck creation_timestamp: type: string description: Timestamp when the event was created trend_percentage: type: integer description: Percentage change in trends sent_webhooks_last_hour: type: integer description: Number of webhooks sent in the last hour required: - type - status - creation_timestamp - trend_percentage - sent_webhooks_last_hour allOf: - $ref: '#/components/schemas/WebhookEvent' description: Healthcheck event sent periodically to verify your webhook endpoint is functional AuthEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/AuthEvent.yaml type: object properties: type: type: string const: auth status: type: string description: Status of the event required: - type - status allOf: - $ref: '#/components/schemas/WebhookEvent' description: Authentication event AuthSuccessEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/AuthSuccessEvent.yaml type: object properties: status: type: string const: success description: Status of authentication user: $ref: '#/components/schemas/TerraUser' description: User who authenticated reference_id: type: string description: Client-provided reference ID widget_session_id: type: string description: Widget session identifier required: - status - user - reference_id - widget_session_id allOf: - $ref: '#/components/schemas/AuthEvent' description: Authentication success event AuthErrorEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/AuthErrorEvent.yaml type: object properties: status: type: string const: error description: Status of authentication user: $ref: '#/components/schemas/TerraUser' description: User who attempted to authenticate provider: type: string description: Provider information message: type: string description: Error message reason: type: string description: Reason for the error reference_id: type: string description: Client-provided reference ID widget_session_id: type: string description: Widget session identifier required: - status - user - provider - message - reason - reference_id - widget_session_id allOf: - $ref: '#/components/schemas/AuthEvent' description: Authentication error event DeauthEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DeauthEvent.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/UserReauthEvent.yaml type: object properties: type: type: string const: user_reauth new_user: $ref: '#/components/schemas/TerraUser' description: The new user record old_user: $ref: '#/components/schemas/TerraUser' description: The old user record that will be deleted status: type: string const: warning description: Status of the re-authentication message: type: string description: Information about the re-authentication required: - type - new_user - old_user - status - message allOf: - $ref: '#/components/schemas/WebhookEvent' description: User re-authentication event AccessRevokedEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/AccessRevokedEvent.yaml 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 ConnectionErrorEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ConnectionErrorEvent.yaml 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 GoogleNoDatasourceEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/GoogleNoDatasourceEvent.yaml type: object properties: type: type: string const: google_no_datasource user: $ref: '#/components/schemas/TerraUser' description: Affected user status: type: string const: warning description: Status of the event message: type: string description: Information about the issue required: - type - user - status - message allOf: - $ref: '#/components/schemas/WebhookEvent' description: Google no datasource event ProcessingEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ProcessingEvent.yaml type: object properties: type: type: string const: processing status: type: string const: success 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 retry_after_seconds: type: integer description: Seconds to wait before retrying required: - type - status - message - user - retry_after_seconds allOf: - $ref: '#/components/schemas/WebhookEvent' description: Processing event returned when data is being fetched asynchronously LargeRequestSendingEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/LargeRequestSendingEvent.yaml 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 RateLimitHitEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/RateLimitHitEvent.yaml type: object properties: type: type: string const: rate_limit_hit user: $ref: '#/components/schemas/TerraUser' description: User whose request hit rate limits start_date: type: string description: Start date of the requested data range end_date: type: string description: End date of the requested data range retrying_at: type: string description: When the request will be retried message: type: string description: Information about the rate limit required: - type - user - start_date - end_date - retrying_at - message allOf: - $ref: '#/components/schemas/WebhookEvent' description: Rate limit hit event S3PayloadEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/S3PayloadEvent.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/ActivityEvent.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/AthleteEvent.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/NutritionEvent.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/DailyEvent.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/SleepEvent.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/MenstruationEvent.yaml 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 $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/BodyEvent.yaml 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 PermissionChangeEvent: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/PermissionChangeEvent.yaml 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 WebhookEventType: $schema: https://json-schema.org/draft/2020-12/schema $id: https://raw.githubusercontent.com/tryterra/openapi/refs/heads/master/schemas/WebhookEventType.yaml oneOf: - $ref: '#/components/schemas/HealthcheckEvent' - $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/GoogleNoDatasourceEvent' - $ref: '#/components/schemas/PermissionChangeEvent' - $ref: '#/components/schemas/ProcessingEvent' - $ref: '#/components/schemas/LargeRequestProcessingEvent' - $ref: '#/components/schemas/LargeRequestSendingEvent' - $ref: '#/components/schemas/RateLimitHitEvent' - $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/S3PayloadEvent' description: Union of all possible webhook event types