Omni Health
Developer guide › Tutorial

Build a wearable integration in 10 minutes

A complete walkthrough: from an installed service to writing step data and nudging the patient — the exact shape a “Fitbit connector” takes on OmniHealth.

1

Get set up

Make sure you’re an approved developer, then in your workspace:

  • Install your service (e.g. “Step Counter”). We’ll call its id your.service.id below — copy your real one from the workspace.
  • Create an API client with scopes system/Observation.write and system/Notification.write. Save the client_id and client_secret.
  • Register a webhook pointing at your server, subscribed to service.enabled and service.disabled. Save the signing secret.
2

A patient enables your service

When a patient turns your tool on in their health journal, we call your webhook:

POST https://your-app.example.com/webhook
X-OmniHealth-Event: service.enabled
X-OmniHealth-Signature: t=1784…,v1=9f2c…

{ "event":"service.enabled", "service_id":"your.service.id",
  "service":"Step Counter", "data":{"patient_id":123},
  "created_at":"2026-07-24T09:00:00Z" }

Verify the signature (see the guide), then remember patient_id 123 — you may now write their data. Kick off your first Fitbit sync for them.

3

Get a token

curl -X POST https://omnihealth.solutions/fhir/token \
  -d grant_type=client_credentials \
  -d client_id=$CLIENT_ID -d client_secret=$CLIENT_SECRET \
  -d scope="system/Observation.write system/Notification.write"
# → { "access_token":"oht_…", "expires_in":3600, … }
Cache the token and reuse it until it expires (1 hour) — don’t fetch one per request.
4

Write today’s steps

curl -X POST https://omnihealth.solutions/fhir/Observation \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/fhir+json" \
  -d '{
    "resourceType":"Observation",
    "status":"final",
    "code":{"coding":[{"code":"your.service.id"}]},
    "subject":{"reference":"Patient/123"},
    "effectiveDateTime":"2026-07-24T23:00:00Z",
    "component":[{"code":{"text":"steps"},"valueQuantity":{"value":10432}}]
  }'
# → 201 Created,  Location: /fhir/Observation/psd-…

Use effectiveDateTime for the day the steps were counted, so the data lands with the right timestamp even if you upload it later.

5

Celebrate a milestone

Hit a goal? Nudge the patient through the platform’s own notifications:

curl -X POST "https://omnihealth.solutions/fhir/$notify-patient" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"service_id":"your.service.id","patient_id":123,
       "title":"Goal reached 🎉","body":"You hit 10,000 steps today!",
       "link":"/health-river"}'
6

Stop cleanly when they leave

If the patient disables your service you’ll get a service.disabled webhook. Stop syncing, and don’t retain their data beyond what your terms allow. That’s the whole lifecycle.

That’s it. Enable → token → write → notify → disable. Everything else in the guide is detail on top of these five calls. Grab the OpenAPI spec to generate a client, and copy a ready-made webhook receiver to start from.
×