Terra provides two methods of authenticating a user to allow you to begin receiving their data - widget-based authentication and rest-based authentication.

The Terra Widget provides a plug-and-play authentication solution with very little code required in order to integrate it into your application. The Widget provides an optimised authentication flow that has the same process for every provider. This is the recommended way to allow users to connect their fitness accounts to your applications. For more see Widget.

The REST-based authentication flow relies on you making a request to the Authenticate User endpoint in order to generate a user ID and authentication redirect URL which you must send the user to from your application in order to complete the authentication flow. For more see REST Authentication.

❗️

User limit

Testing & staging environments each have a 25 user limit attached to them
Please ensure that you deauthenticate all unused test accounts, or reach out to support for us to increase that cap if needed

REST Authentication

The REST-based authentication flow relies on you (the developer) dealing with most of the authentication flow in-app.

You will need to allow the user to select a provide on the client side, which will trigger a call to the Authenticate User endpoint originating from your backend. The user should then be redirected to the provided URL to complete the auth flow.

Once the auth flow is completed, you will receive a webhook of type auth_success, informing you that the auth flow has successfully completed.

537537

Flow diagram