For the complete documentation index, see llms.txt. This page is also available as Markdown.
Quick Start
Upload a lab report, check status, and retrieve structured biomarker data in three steps.
⚠️ Pre-Release
This page is currently under active development and is provided in a pre-release state.
Some content may evolve as we continue to iterate on the implementation based on your feedback, but the core concepts and functionality are expected to remain consistent.
The page will be marked as general release in the near future
Prerequisites
A Terra developer account with a dev-id and x-api-key (get these from the Terra Dashboard)
A webhook destination configured in the dashboard (optional but recommended)
A lab report file to upload (PDF, PNG, JPEG, GIF, or WebP)
The upload returns an upload_id — the durable handle for this upload. The session_id(s) are learned from the webhook events or via GET /v2/lab-reports?upload_id=upl_4a2b8c1d. Both IDs are strings; store snowflake session_ids as strings to avoid JavaScript integer precision issues.
Step 2: Wait for Processing
The report moves through several statuses before results are ready:
Option A: Webhook (recommended) — Terra delivers a lab_report.completed event (with the report under data) to your configured webhook endpoint automatically when the session reaches sent. No polling needed.
Lab reports can be delivered to any destination you've configured — not just webhooks, but also cloud storage, message queues, and databases. Delivery is opt-in per destination: add "lab_report" to a destination's destination_event_types to start receiving reports there. See Delivery Destinations.
Option B: Poll the session — Check status by retrieving the session:
Processing typically takes 30 seconds to 2 minutes depending on report complexity.
Step 3: Retrieve Results
Once the session status is sent (or standardized or later), the results are available:
Response (200 OK):
What's Next?
Core Concepts — Understand the full session lifecycle and data model