REST API Endpoints
Our full OpenAPI spec is available at: https://github.com/tryterra/openapi/blob/master/v5.yaml
🕸️ API info
Retrieve a detailed list of supported integrations, optionally filtered by the developer's enabled integrations and the requirement for SDK usage.
If true, allows SDK integrations to be included in the response.
Successful response containing a list of integrations.
Successful response containing a list of integrations.
🔌 Authentication
Creates a login link that allows end users to connect their fitness tracking account
Your API key for authentication
Provider resource identifier (e.g., 'FITBIT', 'GARMIN', 'OURA'). See "Get detailed list of integrations" for available providers
FITBITyour developer ID
testingTerraReturned when authentication link could be successfully generated
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when a parameter does not exist on Terra's end (e.g. resource)
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)
Your API key for authentication
200
404
Generates a link to redirect an end user to for them to select an integration and log in with their fitness data provider
Your API key for authentication
Comma separated list of providers to display on the device selection page. This overrides your selected sources on your dashboard
GARMIN,FITBIT,OURA,WITHINGS,SUUNTODisplay language of the widget
enIdentifier of the end user on your system, such as a user ID or email associated with them
[email protected]URL the user is redirected to upon successful authentication
https://myapp.com/successURL the user is redirected to upon unsuccessful authentication
https://myapp.com/failureReturned when authentication link could be successfully generated
Returned when one or more parameters is malformed - an appropriate error message will be returned
Deletes all records of the user on Terra's end, revoking Terra's access to their data
Your API key for authentication
Terra user ID (UUID format) to deauthenticate and remove from Terra system
Returned when user is successfully deauthenticated and data is deleted
Returned when the user_id is not existent
💁♂️ User info
Used to query for information on one Terra user ID, or to query for all registered Terra User objects under one reference ID
Your API key for authentication
user ID to query for
reference ID to query for
Returned when the provided resources are found
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when a parameter does not exist on Terra's end (e.g. user_id)
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).
Your API key for authentication
Zero-based page number. If omitted, results are not paginated.
0Number of results per page (default is 500).
500Returned upon a successful request
Returned when one or more parameters are malformed
Used to query for information for multiple Terra User IDs
Your API key for authentication
List of user IDs to get information for
Returned upon successful request
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when a parameter does not exist on Terra's end (e.g. user_id)
Fetches relevant profile info such as first & last name, birth date etc. for a given user ID
Your API key for authentication
Terra user ID (UUID format) to retrieve data for
Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided)
Returned upon successful data request
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when credentials (dev ID and API key) are invalid
Returned when a parameter does not exist on Terra's end (e.g. user_id)
⏳ Historical Data retrieval
Fetches completed workout sessions, with a defined start and end time and activity type (e.g. running, cycling, etc.)
Your API key for authentication
Terra user ID (UUID format) to retrieve data for
Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided)
Boolean flag specifying whether to include detailed samples in the returned payload (default: false)
Returned upon successful data request
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when credentials (dev ID and API key) are invalid
Returned when a parameter does not exist on Terra's end (e.g. user_id)
Fetches body metrics such as weight, height, body fat percentage etc. for a given user ID
Your API key for authentication
Terra user ID (UUID format) to retrieve data for
Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided)
Boolean flag specifying whether to include detailed samples in the returned payload (default: false)
Returned upon successful data request
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when credentials (dev ID and API key) are invalid
Returned when a parameter does not exist on Terra's end (e.g. user_id)
Fetches daily summaries of activity metrics such as steps, distance, calories burned etc. for a given user ID
Your API key for authentication
Terra user ID (UUID format) to retrieve data for
Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided)
Boolean flag specifying whether to include detailed samples in the returned payload (default: false)
Returned upon successful data request
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when credentials (dev ID and API key) are invalid
Returned when a parameter does not exist on Terra's end (e.g. user_id)
Fetches menstruation data such as cycle length, period length, ovulation date etc. for a given user ID
Your API key for authentication
Terra user ID (UUID format) to retrieve data for
Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided)
Boolean flag specifying whether to include detailed samples in the returned payload (default: false)
Returned upon successful data request
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when credentials (dev ID and API key) are invalid
Returned when a parameter does not exist on Terra's end (e.g. user_id)
Fetches nutrition log data such as meal type, calories, macronutrients etc. for a given user ID
Your API key for authentication
Terra user ID (UUID format) to retrieve data for
Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided)
Boolean flag specifying whether to include detailed samples in the returned payload (default: false)
Returned upon successful data request
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when credentials (dev ID and API key) are invalid
Returned when a parameter does not exist on Terra's end (e.g. user_id)
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
Your API key for authentication
Terra user ID (UUID format) to retrieve data for
Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided)
Boolean flag specifying whether to include detailed samples in the returned payload (default: false)
Returned upon successful data request
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when credentials (dev ID and API key) are invalid
Returned when a parameter does not exist on Terra's end (e.g. user_id)
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)
Your API key for authentication
Terra user ID (UUID format) to retrieve data for
Start date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
End date for data query - either ISO8601 date (YYYY-MM-DD) or unix timestamp in seconds (10-digit)
Boolean flag specifying whether to send the data retrieved to the webhook instead of in the response (default: true if not provided)
Returned upon successful data request
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when credentials (dev ID and API key) are invalid
Returned when a parameter does not exist on Terra's end (e.g. user_id)
✏️ Writing data
Used to post activity data to a provider. This endpoint only works for users connected via Wahoo. Returns error for other providers.
Your API key for authentication
Returned when activity was successfully created on the provider
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when a parameter does not exist on Terra's end (e.g. user_id)
Used to post nutrition logs to a provider. This endpoint only works for users connected via Fitbit. Returns error for other providers.
Your API key for authentication
Returned when activity was successfully created on the provider
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when a parameter does not exist on Terra's end (e.g. user_id)
Used to post body data to a provider. This endpoint only works for users connected via Google Fit. Returns error for other providers.
Your API key for authentication
Returned when activity was successfully created on the provider
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when a parameter does not exist on Terra's end (e.g. user_id)
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)
Your API key for authentication
Terra user ID (UUID format) to retrieve data for
Returned when activity was successfully created on the provider
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when a parameter does not exist on Terra's end (e.g. user_id)
Used to delete nutrition logs the user has registered on their account
Your API key for authentication
Terra user ID (UUID format) to retrieve data for
List of identifiers for nutrition entries to be deleted
Returned when all records were deleted successfully
Returned when multiple status codes were obtained from attempting to delete the requested records
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when credentials (dev ID and API key) are invalid
Returned when a parameter does not exist on Terra's end (e.g. user_id)
Used to delete Body metrics the user has registered on their account
Your API key for authentication
Terra user ID (UUID format) to retrieve data for
List of identifiers for body metrics entries to be deleted
Returned when all records were deleted successfully
Returned when multiple status codes were obtained from attempting to delete the requested records
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when credentials (dev ID and API key) are invalid
Returned when a parameter does not exist on Terra's end (e.g. user_id)
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)
Your API key for authentication
Terra user ID (UUID format) to retrieve data for
List of identifiers for planned workout entries to be deleted
Returned when all records were deleted successfully
Returned when multiple status codes were obtained from attempting to delete the requested records
Returned when one or more parameters is malformed - an appropriate error message will be returned
Returned when authorization with a data provider has failed
Returned when a parameter does not exist on Terra's end (e.g. user_id)
Last updated
Was this helpful?