Skip to content
EirlyEirly
PractitionersDevelopersPricing

Get help

Help centreSet up, order, results, billing, step by stepDeveloper docsAPI reference and the MCPContactTalk to the team

Learn

GuidesHow diagnostics and health data workBlogNews and writing from the teamWhat's newWhat changed on Eirly Health, newest firstRoadmapWhat we are building next
About
Sign inGet started
Get started
  1. All collections
  2. ›Integrations and API
  3. ›Build on the pathology API, from staging to production

Step by step

Build on the pathology API, from staging to production

The path a health company takes to put pathology ordering and results inside its own product: a staging organisation, API credentials, the first request, the first referral, webhooks that tell you when a result is ready, Medicare provider records, then the same setup in production.

Cost:
Staging is free; production needs an API plan, quoted to your volume
Environments:
Staging and production have separate accounts, organisations, billing and keys
Medicare referrals:
API version 1.1.0 or higher
Results:
Webhooks tell you something changed; you fetch results through the API

Updated 28 November 2026

Build your integration · 12 steps

For health companies and developers putting pathology ordering and results inside their own product. The full reference is in Getting Started in the docs.

Get started with staging

12 steps · 0 done

  1. 1Create an account, verify, create an organisation
  2. 2Add the test card
  3. 3Enable the API
  4. 4Get a token
  5. 5Make the first call
  6. 6Choose tests and create a referral
  7. 7Show the nearest centre
  8. 8Subscribe to webhooks
  9. 9Create a Medicare provider record
  10. 10Check the provider will receive results
  11. 11Connect the MCP
  12. 12Go to production
Get started with staging

Steps

  1. Create an account, verify, create an organisation

    Where: app.staging.eirly.health/signup

    The same first steps as in Try Eirly in staging. A verified profile (pick a practitioner type, Other if unsure) is required before an organisation can exist, and all API access is scoped to an organisation.

    You will know it worked when: You're on the organisation's Dashboard.

  2. Add the test card

    Where: Settings, then Billing

    A billing method must be on file before API access can be enabled. Staging accepts Stripe's test card and never charges it.

    Test card number

    4242 4242 4242 4242

    You will know it worked when: Billing shows a card ending 4242.

  3. Enable the API

    Where: Settings, then API Keys

    Follow the steps to enable API access. You receive a client_id and a client_secret for staging. Keep the secret on your server and in your CI's secrets; it never goes in a browser or a repository.

    You will know it worked when: A client_id and client_secret are shown once, and you've stored them.

  4. Get a token

    Where: Your terminal

    Exchange the credentials for an access token with the client credentials flow. The token lasts an hour; a refresh token comes with it.

    Token request
    curl -X POST https://auth.staging.eirly.health/oauth/token \
      -u "$CLIENT_ID:$CLIENT_SECRET" \
      -d grant_type=client_credentials

    You will know it worked when: The response carries access_token and expires_in 3600.

  5. Make the first call

    Where: Your terminal

    List the tests, then find the five centres nearest Sydney. Every list endpoint pages the same way, with a cursor.

    First calls
    curl https://api.staging.eirly.health/v1/tests -H "Authorization: Bearer $TOKEN"
    curl "https://api.staging.eirly.health/v1/collection-centres?lat=-33.8688&lng=151.2093&count=5" -H "Authorization: Bearer $TOKEN"

    You will know it worked when: JSON comes back, and the centres carry distanceKm.

  6. Choose tests and create a referral

    Where: POST /v1/referrals

    List the tests, or order a pre-configured set by bundle and extend it with extra tests. Commercial and Medicare tests can go in the same request. POST /v1/referrals with the person and the tests: Eirly creates and issues the referral, and you retrieve the referral PDF. An order with both Medicare and commercial tests produces two referrals. Use made-up people in staging.

    You will know it worked when: You can retrieve the referral PDF. A mixed order gives two referrals.

  7. Show the nearest centre

    Where: Collection-centre search

    Collection-centre search returns centres by location, nearest first, with opening hours. The person walks in; most tests need no appointment.

    You will know it worked when: Centres come back nearest first, with opening hours.

  8. Subscribe to webhooks

    Where: The REST API, webhook subscriptions

    Create a webhook subscription over REST. A webhook tells your system a referral or a result is created or updated: you receive a small event, then fetch the current state from the REST API, which is the source of truth. Each biomarker has a consistent identity across labs and a canonical value beside the lab's own. The event list and retry behaviour are in the webhooks reference in the docs.

    You will know it worked when: Your system receives an event, and the referral or result you fetch from the API matches it.

  9. Create a Medicare provider record

    Where: POST /v1/providers

    Send the doctor's provider number, name, address and a PNG signature. The doctor needs no account with Eirly; that practitioner can order Medicare tests from this call on. Medicare referrals need API version 1.1.0 or higher.

    You will know it worked when: The practitioner can order Medicare tests from this call on.

  10. Check the provider will receive results

    Where: GET /v1/providers/{providerNumber}

    Every organisation is on copy routing unless our team has set it to direct routing. On copy routing, a provider record with every detail and a signature receives results: the request form asks the lab to copy us in, so there's no lab to notify. The provider response carries routingMethod and ready. Only call POST /v1/providers/{providerNumber}/routing when routingMethod is DIRECT; on copy routing it succeeds and does nothing.

    You will know it worked when: The provider record shows ready true.

  11. Connect the MCP

    Where: Claude Code, Cursor, Windsurf, Codex, or any assistant that speaks MCP

    The developer MCP is public and read-only: the API reference, schemas, docs and webhook events, read by your coding assistant while it writes your integration. Any tool that speaks MCP over HTTP can connect; the command below is Claude Code's, the others take the same address in their MCP settings.

    Claude Code
    claude mcp add --transport http eirly-dev https://mcp.eirly.health/dev/v1

    You will know it worked when: Your assistant can list the endpoints tagged Collection centres.

  12. Go to production

    Where: app.eirly.health

    Repeat the setup in production: new account, organisation, billing and keys. Nothing carries over from staging, so rebuild your bundles, members and settings there too. Keys from staging do not work there. Production needs a plan, quoted to your volume.

    You will know it worked when: Your production keys are in your server's secrets, and your staging ones are kept for testing.

Follow this guide in your AI tool

The whole guide is also a Markdown file. Open it in the tool you already use and it will take you through the steps and check each one; or copy the Markdown and paste it anywhere.

Open the Markdown filehttps://eirly.health/support/articles/build-on-the-pathology-api.md
What the tool is told
Please follow this guide with me, one step at a time, and check each step before moving on: https://eirly.health/support/articles/build-on-the-pathology-api.md

It is Eirly Health's guide "Build on the pathology API, from staging to production". Nothing in staging reaches a lab, and I will use made-up people only.

Questions

Is there a free sandbox?+

Yes. Staging is a full environment with its own keys, and it never charges a real card. Production needs a plan.

Do webhooks carry the result?+

No. A webhook tells you something changed; you fetch the referral or result from the REST API. Webhooks and list endpoints cover orders created through the API.

Does the ordering doctor need an Eirly account?+

Not through the API: a provider record holds their number, details and signature. On the platform, each ordering doctor is a member with their own signature.

Are there SDKs?+

No. It is a REST API with OAuth 2.0 client credentials, cursor paging and JSON; the developer MCP server lets a coding assistant read the reference while it writes your client.

Can we white-label the referral?+

Your branding can appear on referrals, included or as an add-on depending on your plan.

No key in the browser, ever+

A client_id and client_secret in an HTML page, a bundle or a mobile app is public. Exchange them for a token on your server, or at build time, and ship only data.

Never commit a secret+

Keep credentials in environment variables or your CI's encrypted secrets, add .env files to .gitignore, and scan commits before they leave your machine. If a secret reaches a repository, treat it as leaked: rotate it in Settings, then API Keys, and rewrite nothing.

One key per environment, one per job+

Staging and production issue separate keys and neither works in the other. Give an integration its own organisation and key so you can revoke it without touching anything else.

Keep tokens out of logs+

Access tokens last an hour and refresh tokens a month; log neither. Mask them in error reports and never put them in a URL.

Real clients only in production+

Staging is for made-up people. A real name, Medicare number or result never belongs in a test environment, a fixture, a screenshot or a bug report.

Verify what arrives+

Treat a webhook as a notification, then fetch the record from the API with your token before you act on it. Reject anything your server did not ask for.

Least privilege for people too+

In the app, roles add up and no built-in role grants Medicare ordering; give each person the capabilities their job needs and rotate API keys when someone who held them leaves.

Found a security problem?+

Email support@eirly.health with the detail and we will respond; please do not post it publicly first.

Still need help?

Email support@eirly.health with your organisation name, the environment and the request you made. Never send your client_secret, access tokens or real client details.

Next

  • Getting started with staging

    Account, organisation, test card and API keys.

  • Pathology API

    Referrals, results, webhooks, bundles and collection centres in one REST API.

  • Lab results API

    What a result looks like: normalised across labs, with canonical values.

  • Medicare pathology ordering

    Who can request Medicare pathology, and Medicare and commercial tests on one order.

  • Developer MCP server

    Let your coding assistant read the API reference while it writes your integration.

  • Pathology booking API

    Referral, nearest collection centre with opening hours, and the result, in one REST API.

  • API pricing

    Plans and what each includes.

Open stagingBook a demo

EirlyEirly

Pathology and diagnostic infrastructure for practitioners and health brands.

Solutions

  • Partners
  • Telehealth services
  • Health brands and white label
  • Clinics and practitioners
  • Longevity clinics
  • Clinical trials
  • Businesses and insurers
  • Research
  • At-home collection

Platform

  • Pathology infrastructure
  • Eirly API
  • Medicare pathology
  • Catalogue
  • Pricing
  • API pricing

Developers

  • Pathology API
  • Lab results API
  • Pathology booking API
  • Lab testing API
  • Radiology API
  • MCP server

Resources

  • Guides
  • Who can order tests and scans
  • Blog
  • Blood test FAQ
  • What's new
  • Roadmap

Support

  • Help centre
  • Step by step
  • Developer docs
  • Contact

Company

  • About
  • Why
  • Compliance
  • Security and governance
  • Brand guidelines

Legal

  • Privacy
  • Terms
  • Refunds

Our network

  • Pathology labs
  • Collection centres
  • Healius Pathology
  • Australian Clinical Labs
  • 4Cyte Pathology
  • Sonic Healthcare
  • NutriPATH
  • Microba
  • Fatty Acid Labs

Built in Australia. Global by design, local where it counts.

Eirly Health is a trading name of Bloody Good Tests Pty Ltd. Eirly provides data infrastructure and educational context. It does not provide medical advice, diagnosis or treatment. Pathology is requested by a registered practitioner and analysed by accredited or otherwise appropriately qualified laboratories. Practitioners using the platform are responsible for their own clinical and regulatory obligations.

© 2026 Bloody Good Tests Pty Ltd

Clients: sign in to view your results →