OnePath Connect
OnePath Connect
OnePath Connect Documentation
Getting StartedAuthenticationYour First API CallSandbox EnvironmentGoing Live
Getting Started

Your First API Call

Onboard a sandbox user and pull AI insights in five minutes.

Let's make a real API call. We'll use the sandbox environment so no real health data is involved.

Step 1: Onboard a user

curl -X POST https://api.onepath.health/partner/v1/users/onboard \
  -H "X-API-Key: onepath_sandbox_demo" \
  -H "X-Consent-Assertion: <sandbox-consent-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "externalId": "my-user-001",
    "consentScopeId": "full-health"
  }'

You'll get back a userId — this is the OnePath identifier you use for all subsequent calls.

{
  "userId": "onepath_usr_7xkm2p9q",
  "fhirPatientId": "pt-a1b2c3d4",
  "status": "active",
  "consentScope": "full-health"
}

Step 2: Submit some health data

curl -X PATCH https://api.onepath.health/partner/v1/users/onepath_usr_7xkm2p9q/health-data \
  -H "X-API-Key: onepath_sandbox_demo" \
  -H "X-Consent-Assertion: <sandbox-consent-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "observations": [{
      "code": "8867-4",
      "system": "http://loinc.org",
      "display": "Heart rate",
      "valueQuantity": { "value": 72, "unit": "beats/min" },
      "effectiveDateTime": "2026-08-04T09:00:00Z"
    }]
  }'

Step 3: Get AI insights

curl https://api.onepath.health/partner/v1/users/onepath_usr_7xkm2p9q/insights \
  -H "X-API-Key: onepath_sandbox_demo" \
  -H "X-Consent-Assertion: <sandbox-consent-token>"
{
  "summary": "Based on available data, this user has a resting heart rate within the normal range...",
  "flags": [],
  "lastUpdated": "2026-08-04T09:00:30Z",
  "cached": false
}

Insights are cached for 6 hours after generation. Pass ?refresh=true to force a regeneration.

Using the SDK

The same flow using the TypeScript SDK:

import { OnepathClient } from "@onepath/connect";

const onepath = new OnepathClient({ apiKey: "onepath_sandbox_demo" });

const user = await onepath.users.onboard({
  externalId: "my-user-001",
  consentScopeId: "full-health",
  consentToken: "<sandbox-consent-token>",
});

await onepath.users.updateHealthData(user.userId, {
  observations: [{ code: "8867-4", system: "http://loinc.org", valueQuantity: { value: 72 } }],
});

const insights = await onepath.insights.get(user.userId);
console.log(insights.summary);

Authentication

How API keys and consent tokens work in OnePath Connect.

Sandbox Environment

Safe testing with pre-seeded data, no real PHI involved.

On this page

Step 1: Onboard a userStep 2: Submit some health dataStep 3: Get AI insightsUsing the SDK