Skip to content

tryterra/terra

v2.1.0MIT

Set up, manage and debug your Terra API integration from your coding agent. Ask for the result and the agent does the work through the terra CLI or the bundled Terra API MCP server: environments, enabled providers, webhook destinations, credentials, connected users, delivered events and billing, with skills for the Unified API, the mobile and streaming SDKs, planned workouts, routes, lab reports, Vantage and Models.

terra-cli

Start from example apps and manage Terra API account configuration with the terra CLI from a coding agent (Claude Code, Codex, Cursor), instead of the Terra API dashboard: environments (dev-ids), enabled providers, data scopes, webhook destinations, API keys and data tokens, delivered webhook events, users, team, and billing. Also reaches any admin or data API endpoint with terra admin-api and terra data-api. Use when a task needs Terra API account state read or changed, when you would otherwise send the user to dashboard.tryterra.co, when a webhook did not arrive or has to be resent, when a user connection has to be created or verified, when trying a data API request before writing the code, or when the user mentions terra-cli, terra login, terra agent setup, TERRA_ADMIN_TOKEN, a dev-id, an x-api-key or terra examples. Preferred over the Terra API admin MCP server in coding agents. Not for chat assistants (claude.ai, Claude Desktop, ChatGPT), even with a code sandbox: use terra-mcp there.

terra-lab-reports

Best practices and API reference for Terra API Lab Reports (pre-release) – convert clinical lab report PDFs and images into structured, standardized biomarker data. Use when parsing blood test results, extracting biomarkers, mapping to LOINC or UCUM unit codes, handling reference ranges, handling lab_report.completed / lab_report.failed webhooks, or working with PDF lab results and lab report OCR. Covers the async upload/standardize/deliver lifecycle, the event envelope (event_id, upload_id), the layered result model (source, biomarker, measurement, interpretation, reference ranges), unmatched-biomarker handling, snowflake IDs, and idempotent webhook processing.

terra-mcp

Manage a Terra API account through the Terra API admin MCP server (access.tryterra.co/api/v3/admin/mcp) from a chat assistant such as claude.ai, Claude Desktop or ChatGPT, even one that can run code, or where the terra CLI cannot be used: environments, enabled providers, data scopes, webhook destinations, delivered events and resends, connected users, models, billing, team, and docs_ask. Use in a chat assistant for any Terra API account task, when its tools, such as environments_read, events_read or unified_api_destinations_write, are available, when a tool returns approval_required or asks for an approval_id, when connecting Terra API to Claude, ChatGPT, Cursor, VS Code or Codex as an MCP server, or when debugging insufficient_scope, dev_id_not_found or validation_failed. Not the AI Interface MCP that reads end users' health data. Coding agents such as Claude Code, Codex and Cursor use terra-cli instead.

terra-mobile-sdk

Integrate the Terra API mobile SDK for on-device health sources that have no web API – Apple Health (HealthKit), Samsung Health, and Health Connect. Use when connecting Apple Health, Samsung Health, or Health Connect from a mobile app; when working with TerraiOS, TerraAndroid, terra-react, or terra_flutter_bridge; when minting a mobile SDK auth token via /auth/tokens or generateAuthToken; when configuring HealthKit background delivery, initConnection permission popups, getUserId validation, ProGuard rules for Samsung, or Health Connect manifest permissions; or when writing on-device data with postActivity/postBody/postNutrition.

terra-models

Run Terra API health models (Sleep Window, Menstrual Cycle Tracker, Smart Fill) over a connected user's data for a date range to return ready-to-use wellness insights. Use when building with Terra API Models, the /v2/models or /v2/models/run endpoints, model_run pricing, or turning a user's Terra API data into a sleep-schedule, menstrual-cycle or gap-filled-metrics insight.

terra-planned-workouts

Build with the Terra API Planned Workouts product (pre-release) – define a structured workout once and Terra API pushes it to users' devices. Use when pushing planned or structured workouts to Garmin, COROS, Wahoo, Suunto, TrainingPeaks, Huawei, Zepp, Hevy, or Apple watches, building training plans or workout templates, working with intervals, warmups, targets (HR, power, pace, cadence, RPE, zones), FTP or threshold-based personalization, athlete parameters, swimming or strength templates, or handling provider coercion warnings when a device cannot represent a feature.

terra-routes

Push GPS routes to users' fitness devices with Terra API Routes (pre-release). Use when creating GPS courses or navigation routes, defining waypoints and course points, pushing a route to Garmin, COROS, or Wahoo devices, handling GPX or FIT route formats, or building turn-by-turn navigation onto wearables. Covers the create-then-push workflow, the RouteTemplate and Waypoint data model, per-provider wire formats and feature gaps, cascade re-pushes, and route deletion.

terra-streaming

Best practices for the Terra API Streaming (Real-Time) API – live, roughly per-second biometric data from wearables over websockets. Use when building realtime streaming with Terra API, TerraRT SDKs, or wss://ws.tryterra.co; streaming live heart rate, steps, distance, acceleration, ECG, HRV, RR intervals, calories, MET, power, cadence, speed, location, or gyroscope; pairing a wearable over BLE or ANT+; producing sensor data from a mobile app; consuming a live stream on a backend; or streaming from an Apple Watch or Wear OS watch. Covers the producer/broker/consumer architecture, the websocket handshake and opcodes, token minting, close codes, replay/backfill, and per-platform SDK setup (iOS, Android, React Native, Flutter, Wear OS).

terra-unified-api

Best practices for integrating Terra API – the unified health & fitness data API for 500+ wearables (Garmin, Fitbit, Oura, Whoop, Apple Health, Strava, Dexcom). Use when building with Terra API or tryterra.co, handling terra-signature (X-Terra-Signature) webhooks, storing wearable health data (activity, sleep, daily, body, nutrition, menstruation, hormone), managing device connections, or merging data across multiple devices.

terra-vantage

Order at-home and go-to-lab diagnostic tests and deliver results with Terra API Vantage. Use when ordering blood tests or DNA tests, integrating at-home test kits, placing diagnostics orders, browsing test products and variants, handling kit activation, simulating order lifecycles in sandbox, tracking fulfillment and shipping, receiving results-status webhooks, fetching FHIR-format lab results, or acknowledging results (a mandatory compliance step before patients can view them). Covers the product-to-order-to-results workflow, authentication (Terra API dev-id and API key via HTTP Basic or headers), the AT_HOME vs GO_TO_LAB collection methods, webhook events and HMAC signature verification, delivery debugging, the sandbox environment, and the manual partner onboarding required to get started.