Terra
Integrations
Research

Integration

API
Unified API
SDK
SDK
Authentication
Authentication
Streaming
Streaming
Blood
Blood Report API
Planned Workouts
Planned Workouts
AI Interface
AI Interface

User engagement

Graph API
Graph API
Scores
Health Scores
Rewards
Health Rewards

Use cases

Enterprise
Enterprise
Insurance
Insurance

Developers

Wearable Data
Wearable Data
Community
Community
Documentation
Documentation

Learn

Blog
Blog
Podcast
Podcast
Events
Events
Reports
Reports

Company

Customers
Customers
Careers
Careers
Partners
Partners
Support
Support
Pricing
Become an integrationGet started
IntegrationsResearch
Unified APIUnified APISDKSDKAuthenticationAuthenticationStreamingStreamingGraph APIGraph APIScoresScoresRewardsRewardsBlood Report APIBloodAI InterfaceAI Interface
EnterpriseEnterpriseInsuranceInsuranceWearable DataWearable DataCommunityCommunityDocumentationDocumentationBlogBlogPodcastPodcastEventsEventsReportsReportsCustomersCustomersCareersCareersPartnersPartnersSupportSupport
Pricing
Get startedBecome an integration
next ventures
pioneer fund
samsung next
y combinator
general catalyst

The world's best health apps run on Terra data

Get started
ProductsIntegrations AI Interface Authentication Mobile Development Documentation GraphAPI
DocumentationAPI SDK Quickstart
CommunityBlog Research Community Podcast Github
CompanyAboutCareersCustomersBecome an IntegrationCookies PolicyGDPRPrivacy PolicyTerms of Purchase
© Terra API. 2026 — All rights reserved.

Cookie Preferences

Essential CookiesAlways On
Advertisement Cookies
Analytics Cookies

Crunch Time: Embrace the Cookie Monster Within!

We use cookies to enhance your browsing experience and analyse our traffic. By clicking “Accept All”, you consent to our use of cookies according to our Cookie Policy. You can change your mind any time by visiting out cookie policy.

Cookies Policy
< Blogs
Elliott Yu
Elliott Yu

November 23, 2022

WHOOP Integration series Part 3: Integrating with Terra API

Adding WHOOP as an integration to your app is fairly straightforward thanks to the standardized integration method. Following the documentation, you simply have to implement: auth flow, data gathering, and data processing.

However, if you are building an app utilizing fitness data, you most likely are not gonna want to stop at one data provider. This means you would need to build multiple auth flows, multiple data gathering methods, and data processing systems one for each integration. How about instead of doing this, you make one integration only, and this provides you access to all the wearable companies as well (including WHOOP)?

This is where Terra comes in.

Authentication

Like any data flow, authentication is first and foremost, the most important part. You need to be able to get the user's consent to retrieve their data. This can be done through our (customizable) widget:

curl --location --request POST 'https://api.tryterra.co/v2/auth/generateWidgetSession' \
--header 'dev-id: DEV-ID' \
--header 'X-API-Key: X-API-KEY'

Where DEV-ID and X-API-KEY are credentials you receive when you sign up with Terra.

This will provide you with a widget URL that you can display to your user to log in with whatever provider they want:

{
    "expires_in": 900,
    "session_id": "aece836a-7d69-4489-82cb-1c348e68097e",
    "status": "success",
    "url": "https://widget.tryterra.co/session/aece836a-7d69-4489-82cb-1c348e68097e"
}

The flow would look like this:

The user is uniquely identified by a user_id provided at the auth success page (last in the image above) URL's query parameters.

Data Gathering

That's it! When you have signed up with us, you can set up a webhook URL (under API -> Customise) for which we will continuously send you new events for the user that is authenticated.

Data Processing

The data sent to your webhooks are all of the same structure. They will always contain the same formatting, same field names, and same units. For example, a webhook event from any provider (for example WHOOP) for a workout your user completed will always look like this:

This makes processing events from Terra very simple and elegant as you simply need to pick off points you need from the payload for whatever your app requires.

Advanced

Now, what if you want historic data as well? Tera also has endpoints that allow you to retrieve historical data! You can make a simple HTTP request formatted as:

curl --location --request GET 'https://api.tryterra.co/v2/activity?end_date=2022-10-29&start_date=2022-10-28&user_id=USER_ID' \
--header 'dev-id: DEV-ID' \
--header 'X-API-Key: X-API-KEY'

Where again, DEV-ID and X-API-KEY are credentials you receive when you sign up for Terra. USER_ID on the other hand, is the unique identifier we provide to you after authentication completion to identify the user that has authenticated. The request above with the requested start_date and end_date will gather (and send) the workouts the user has completed over that period of time to your webhook.

Buy or Build

Terra API follows a very simple and easy-to-use structure that allows integrations to WHOOP, Garmin, Fitbit, and hundreds of fitness wearables in one single integration.

You may think that if you can do one, you can go over and do all the others as much as your app would want to support.

However, there are many things to consider, such as partnerships, parsing different data models from other companies, changing your auth system slightly for every company you want to integrate with, and at the same time building a frontend structure to display all of your integrations! These can make a huge difference between if you want to buy or build in-house.


In our Integration series on WHOOP, we are discussing the data available from our API when fetching data from WHOOP.

As a reminder, the WHOOP series contains:

  • Part 1: Getting started with Rest APIs
  • Part 2: Data available from the API
  • Part 3: Integrating with Terra API
  • Part 4: Data from TERRA API

Related Articles

The complete guide: How the new Google Health API works

May 18, 2026

The complete guide: How the new Google Health API works

Google Health API replaces the Fitbit Web API. This is the field guide with code, schemas, and a migration playbook to help you understand where Google Health is heading.

Vanessa Neeff
5 Lessons for Standing Out at HLTH

December 5, 2024

5 Lessons for Standing Out at HLTH

5 lessons from team Terra API for making a lasting impact at HLTH: from engaging senses to building real touch points, here’s what we learned from the HLTH event.

Vanessa Neeff
Strava Pulls the Plug on their API: What This Means for Developers

November 21, 2024

Strava Pulls the Plug on their API: What This Means for Developers

Strava discontinued their API service, changing the ecosystem of third-party apps that have relied on their platform. How can developers react to this?

Terra APITerra API

More Topics

All Blogs
Team Spotlight
Startup Spotlight
How To
Blog
Podcast
Product Updates
Wearables
See All >
The complete guide: How the new Google Health API works

The complete guide: How the new Google Health API works

Google Health API replaces the Fitbit Web API. This is the field guide with code, schemas, and a migration playbook to help you understand where Google Health is heading.

Vanessa NeeffVanessa Neeff
May 18, 2026
September 2025 updates

September 2025 updates

July: Terra Research launches, Lab Reports land in the dashboard with PDF/Image → JSON, and Samsung Health moves to the new Data SDK for a tighter Android integration. 🚀

Alex VenetidisAlex Venetidis
October 1, 2025
August 2025 updates

August 2025 updates

🎉 July Highlights: InBody Goes Global, Faster APIs, and Rock-Solid Data 💪📊

Alex VenetidisAlex Venetidis
September 1, 2025
July 2025 updates

July 2025 updates

July = rock-solid Terra: WHOOP V2, Garmin & Fitbit bug fixes, faster SDKs, plus bulk blood-report uploads with smarter reference ranges. Reliability + data power-ups! 💪🩸

Alex VenetidisAlex Venetidis
August 2, 2025
June 2025 Updates

June 2025 Updates

June brings Terra MCPs for AI-driven setup, Fern-powered Python/JS SDKs with strong typing, and official Expo plugin support—build faster with less friction. 🚀🧰📱

Alex VenetidisAlex Venetidis
July 1, 2025