Terra Authentication API

Connect and disconnect end-user wearable and health accounts.

Operations 4

POST /auth/authenticateUser Generate a custom authentication link #
POST /auth/generateWidgetSession Generate a Terra Widget session #
POST /auth/generateAuthToken Generate an auth token for the Terra mobile SDKs #
DELETE /auth/deauthenticateUser Deauthenticate a user #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/terra-api-authentication-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

terra-api-authentication-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Terra Authentication API
  description: Terra is a unified wearables and health-data API that aggregates data from 500+ wearables, fitness trackers, and health apps (Garmin, Fitbit, Oura, Apple Health, Whoop, Strava, Google Fit, Polar, Withings, and more) behind a single normalized REST interface.
  version: '2.0'
  contact:
    name: Terra
    url: https://tryterra.co
  license:
    name: Proprietary
    url: https://tryterra.co
servers:
- url: https://api.tryterra.co/v2
  description: Terra API v2
security:
- devId: []
  apiKey: []
tags:
- name: Authentication
  description: Connect and disconnect end-user wearable and health accounts.
paths:
  /auth/authenticateUser:
    post:
      operationId: authenticateUser
      tags:
      - Authentication
      summary: Generate a custom authentication link
      description: Generates an authentication URL for a specific resource (provider) so an end user can connect their wearable or health account to your Terra developer account.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                resource:
                  type: string
                  description: The provider to connect (for example GARMIN, FITBIT, OURA).
                reference_id:
                  type: string
                  description: Your own identifier to associate with the connected user.
                auth_success_redirect_url:
                  type: string
                auth_failure_redirect_url:
                  type: string
      responses:
        '200':
          description: Authentication URL and session details.
        '401':
          $ref: '#/components/responses/Unauthorized'
  /auth/generateWidgetSession:
    post:
      operationId: generateWidgetSession
      tags:
      - Authentication
      summary: Generate a Terra Widget session
      description: Generates a hosted Terra Widget authentication link that lets an end user pick from your enabled providers and connect their account, without you building a custom UI.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                language:
                  type: string
                reference_id:
                  type: string
                providers:
                  type: string
                  description: Comma-separated list of providers to show in the widget.
                auth_success_redirect_url:
                  type: string
                auth_failure_redirect_url:
                  type: string
      responses:
        '200':
          description: A widget session URL the end user opens to connect an account.
        '401':
          $ref: '#/components/responses/Unauthorized'
  /auth/generateAuthToken:
    post:
      operationId: generateAuthToken
      tags:
      - Authentication
      summary: Generate an auth token for the Terra mobile SDKs
      description: Mints a short-lived token used to initialize the Terra iOS/Android mobile SDKs (for Apple Health, Samsung Health, and Freestyle Libre connections).
      responses:
        '200':
          description: A token for use with the Terra mobile SDKs.
        '401':
          $ref: '#/components/responses/Unauthorized'
  /auth/deauthenticateUser:
    delete:
      operationId: deauthenticateUser
      tags:
      - Authentication
      summary: Deauthenticate a user
      description: Disconnects a connected user and revokes Terra's access to their data.
      parameters:
      - name: user_id
        in: query
        required: true
        schema:
          type: string
        description: The Terra user ID to deauthenticate.
      responses:
        '200':
          description: The user was deauthenticated.
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    Unauthorized:
      description: Missing or invalid dev-id / x-api-key credentials.
  securitySchemes:
    devId:
      type: apiKey
      in: header
      name: dev-id
      description: Your public Terra developer identifier.
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your secret Terra API key.