biome
sight
Developer documentation · v1

Partner API

Order kits, register samples and pull results into your own system.

Partner API v1

Introduction

Integrate gut microbiome testing into your platform with Biomesight. The Partner API lets you offer gut microbiome testing directly inside your product. Place orders, register collection kits, retrieve analysis results, and receive real-time status updates — all through a simple REST API secured with OAuth 2.0.

The API is designed for:

Health-tech platforms

adding microbiome insights to their offering

Wellness and nutrition apps

that want to personalise recommendations with gut data

Telehealth providers

integrating lab testing into virtual consultations

Corporate wellness programmes

running gut-health screening for employees

Getting started

01

Contact us

Reach out at support@biomesight.com to discuss your integration and receive API credentials.

02

Authenticate

Use your Client ID and Client Secret to obtain an access token via the OAuth 2.0 Client Credentials flow.

03

Integrate

Create orders, register kits, and retrieve results using the endpoints described below.

04

Go live

Once you have tested in our sandbox environment, we will provision production credentials and you are ready to launch.

Authentication

All API requests require a Bearer token. Obtain one by sending your Client ID and Client Secret using HTTP Basic authentication:

POST /api/v1/auth/token

Request

Header / FieldValue
Authorization Basic {base64(client_id:client_secret)}
Content-Type application/x-www-form-urlencoded
grant_type client_credentials
curl -X POST https://api.biomesight.com/api/v1/auth/token \
  -u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
  -d "grant_type=client_credentials"
import requests

resp = requests.post(
    "https://api.biomesight.com/api/v1/auth/token",
    auth=("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET"),
    data={"grant_type": "client_credentials"},
)
token = resp.json()["access_token"]

Response 200 OK

{
  "access_token": "eyJhbGciOi...",
  "token_type":   "Bearer",
  "scope":        "read write",
  "expires_in":   3600
}

Include the token in subsequent requests:

Authorization: Bearer eyJhbGciOi...

Create Order

Submit an order on behalf of a customer. Biomesight will ship a collection kit to the provided address.

POST /api/v1/order

Request Headers

HeaderValue
AuthorizationBearer {access_token}
Content-Typeapplication/json

Request Body

FieldTypeDescription
order_id string required Your unique order identifier
purchase_date string required ISO 8601 UTC timestamp, e.g. 2025-06-15T10:30:00
user object required Customer details (see below)
  user.id string required Your customer identifier
  user.first_name string required Customer first name
  user.last_name string required Customer last name
  user.email string required Valid email address
  user.phone string optional Phone number
shipping_speed string optional Defaults to "standard"
destination_address object required Shipping address (see below)
  destination_address.name string optional Recipient name (defaults to customer name)
  destination_address.address_line1 string required Street address
  destination_address.address_line2 string optional Apartment, suite, etc.
  destination_address.city string required City
  destination_address.state string optional State or province
  destination_address.postcode_zip string required Postcode / ZIP code
  destination_address.country_code string required Country code (e.g. "US", "GB", "DE")
items array required List of ordered items
  items[].product_sku string required Product SKU (provided during onboarding)
  items[].product_name string optional Human-readable product name
  items[].quantity integer optional Defaults to 1

Example Request

curl -X POST https://api.biomesight.com/api/v1/order \
  -H "Authorization: Bearer eyJhbGciOi..." \
  -H "Content-Type: application/json" \
  -d '{
    "order_id": "ORD-20250615-001",
    "purchase_date": "2025-06-15T10:30:00",
    "user": {
      "id": "CUST-12345",
      "first_name": "Jane",
      "last_name": "Smith",
      "email": "jane.smith@example.com"
    },
    "destination_address": {
      "address_line1": "42 Wellness Avenue",
      "city": "London",
      "postcode_zip": "SW1A 1AA",
      "country_code": "GB"
    },
    "items": [
      { "product_sku": "YOUR_SKU", "quantity": 1 }
    ]
  }'
import requests

resp = requests.post(
    "https://api.biomesight.com/api/v1/order",
    headers={
        "Authorization": f"Bearer {token}",
        "Content-Type": "application/json",
    },
    json={
        "order_id": "ORD-20250615-001",
        "purchase_date": "2025-06-15T10:30:00",
        "user": {
            "id": "CUST-12345",
            "first_name": "Jane",
            "last_name": "Smith",
            "email": "jane.smith@example.com",
        },
        "destination_address": {
            "address_line1": "42 Wellness Avenue",
            "city": "London",
            "postcode_zip": "SW1A 1AA",
            "country_code": "GB",
        },
        "items": [
            {"product_sku": "YOUR_SKU", "quantity": 1}
        ],
    },
)
print(resp.json())

Response 201 Created

{
  "status": "created",
  "sale_id": 4821,
  "external_order_id": "ORD-20250615-001"
}

Error Cases

StatusCause
400Missing order_id or invalid JSON body
409Duplicate order — an order with the same order_id already exists
422Validation error — missing or invalid fields (e.g. invalid email, missing address, unknown SKU, invalid date)
500Server error — contact support

Register Kit

After your customer collects their sample, register the kit to associate the customer with the kit ID.

POST /api/v1/register_kit

Request Headers

HeaderValue
AuthorizationBearer {access_token}
Content-Typeapplication/json

Request Body

FieldTypeDescription
order_id string required The order_id used when creating the order
kit_id string required Kit code printed on the collection tube
sample_date string required Date the sample was collected (YYYY-MM-DD)
sample_type string optional Defaults to "Gut"
bristol_scale integer optional Bristol stool scale (1–7)
bm_frequency string optional Bowel-movement frequency. One of: "3 or more times per day", "After every meal", "Twice daily", "Once daily", "Every 2 to 3 days", "Every 4 to 5 days", "About once a week"

Example Request

curl -X POST https://api.biomesight.com/api/v1/register_kit \
  -H "Authorization: Bearer eyJhbGciOi..." \
  -H "Content-Type: application/json" \
  -d '{
    "order_id": "ORD-20250615-001",
    "kit_id": "BS1-ABC12",
    "sample_date": "2025-07-01",
    "bristol_scale": 4
  }'
import requests

resp = requests.post(
    "https://api.biomesight.com/api/v1/register_kit",
    headers={
        "Authorization": f"Bearer {token}",
        "Content-Type": "application/json",
    },
    json={
        "order_id": "ORD-20250615-001",
        "kit_id": "BS1-ABC12",
        "sample_date": "2025-07-01",
        "bristol_scale": 4,
    },
)
print(resp.json())

Response 200 OK

{
  "status": "Success"
}

Error Cases

StatusCause
200Kit already registered — returns {"status": "Already registered"}
400Missing required fields, invalid sample data, order not found, kit not found, or invalid kit status
500Server error — contact support

Get Results

Retrieve microbiome analysis results for a registered kit. Results are available once lab processing is complete.

GET /api/v1/results/{kit_id}

Request Headers

HeaderValue
AuthorizationBearer {access_token}

Query Parameters

ParameterTypeDescription
format string optional "json" (default), "pdf" or "csv"

Example Request

curl https://api.biomesight.com/api/v1/results/BS1-ABC12?format=json \
  -H "Authorization: Bearer eyJhbGciOi..."
import requests

resp = requests.get(
    "https://api.biomesight.com/api/v1/results/BS1-ABC12",
    headers={"Authorization": f"Bearer {token}"},
    params={"format": "json"},
)
results = resp.json()

JSON Response 200 OK

Returns a results object containing health scores and personalised recommendations.

{
  "scores": {
    "gut_health": 89.25,
    "Diversity": 88.0,
    "Probiotic": 90.07,
    "Commensal": 98.15,
    "Pathobiont": 83.33
  },
  "recommendations": {
    "food": {
      "enjoy": ["cranberries", "green tea", "pomegranate", ...],
      "avoid": ["acacia tree", "guar bean", ...]
    },
    "prebiotics": {
      "enjoy": ["Acacia fiber", "lactulose", ...],
      "reduce": ["PHGG", "psyllium", ...]
    },
    "probiotics": {
      "reduce": ["Abiotrophia defectiva"]
    }
  },
  "general": {
    "kit_id": "BS1-ABC12",
    "sample_id": 380,
    "export_date": "2026-01-09 11:49:49",
    "pipeline_id": 1
  }
}

Response Fields

FieldDescription
scores.gut_health Overall gut health score (0–100)
scores.Diversity Microbiome diversity percentile (0–100)
scores.Probiotic Beneficial bacteria score (0–100)
scores.Commensal Commensal bacteria score (0–100)
scores.Pathobiont Pathogenic bacteria score (0–100)
recommendations Personalised recommendations grouped by category (food, prebiotics, probiotics), each containing enjoy, avoid, or reduce lists
general Metadata including kit ID, sample ID, export timestamp, and pipeline ID
Note: The JSON response can be extended to include additional result data such as full taxonomy breakdowns, metabolite predictions, and more — matching the detail available in the PDF and CSV exports. Contact us to discuss your requirements.

PDF Response 200 OK

Returns a base64-encoded PDF report. See a sample report for the full layout. White-label partners can have the report branded as “Powered by Biomesight” with their own logo and colour scheme.

{
  "kit_id": "BS1-ABC12",
  "pdf": "JVBERi0xLjQKMS..."
}

CSV Response 200 OK

Returns a base64-encoded CSV file containing the full taxonomy breakdown for the sample from our Consensus pipeline: one row per taxon lineage (kingdom down to species) with its read count and relative abundance, sorted by abundance, highest first. Lineages with no reads are left out. The CSV is available once the Consensus pipeline has finished (csv_available on Get Kit Status); until then the request returns 202.

{
  "kit_id": "BS1-ABC12",
  "csv": "dGF4b25vbXksYW..."
}

CSV Columns

ColumnDescription
Kingdom, Phylum, Class, Order, Family, GenusTaxon name at each rank; empty where the reads could not be classified to that rank. Unclassified reads have Kingdom set to Unclassified
SpeciesSpecies name without the genus (e.g. muciniphila); empty where not classified to species
num_hitsNumber of reads assigned to the lineage
%_hitsPercentage of the sample’s reads assigned to the lineage (0–100, up to 6 decimal places)

Error Cases

StatusCause
202Results are not ready yet — lab processing is still in progress
203PDF report or CSV file not ready (JSON results may already be available)
400Unsupported format or invalid client
403Kit does not belong to your account
404Kit not found

Get Kit Status

Look up the current status of a kit/sample as it moves through the lab pipeline.

GET /api/v1/status/kit/{kit_id}

Request Headers

HeaderValue
AuthorizationBearer {access_token}

Example Request

curl https://api.biomesight.com/api/v1/status/kit/BS1-ABC12 \
  -H "Authorization: Bearer eyJhbGciOi..."
import requests

resp = requests.get(
    "https://api.biomesight.com/api/v1/status/kit/BS1-ABC12",
    headers={"Authorization": f"Bearer {token}"},
)
print(resp.json())

Response 200 OK

{
  "kit_id": "BS1-ABC12",
  "status": "Sample Received",
  "description": "Lab received sample",
  "date": "2025-07-10T00:00:00Z",
  "results_available": false,
  "csv_available": false
}

Response Fields

FieldDescription
kit_idThe kit ID
statusCurrent kit / sample status
descriptionShort description of the status, the same text the webhook sends; can be empty
dateUTC date of the latest recorded step: results available, else sample received by the lab, else kit registered. Received and results dates are whole days (T00:00:00Z). null before the kit is registered
results_availabletrue once JSON results can be downloaded from Get Results
csv_availabletrue once the Consensus pipeline has processed the sample, so the CSV can be downloaded with format=csv

The status values match those listed in Kit / Sample Status Updates below. Statuses that are not pushed as webhooks can also be returned: Issued (kit not yet registered), Registered, Follow-up email sent, Tracking Exception, Lab Completed, ZipFile Received, Workflow initiated, Files prepared, Files uploaded to Illumina, Analysis requested, Download Available and Results processing failed.

Error Cases

StatusCause
403Kit does not belong to your account
404Kit not found

Get Order Status

Look up the current fulfilment status of an order.

GET /api/v1/status/order/{order_id}

Request Headers

HeaderValue
AuthorizationBearer {access_token}

Example Request

curl https://api.biomesight.com/api/v1/status/order/ORD-20250615-001 \
  -H "Authorization: Bearer eyJhbGciOi..."
import requests

resp = requests.get(
    "https://api.biomesight.com/api/v1/status/order/ORD-20250615-001",
    headers={"Authorization": f"Bearer {token}"},
)
print(resp.json())

Response 200 OK

{
  "order_id": "ORD-20250615-001",
  "status": "Delivered",
  "description": "Delivered",
  "date": "2025-06-15T09:15:00Z",
  "kits": [
    {
      "kit_id": "BS1-ABC12",
      "status": "Sample Received",
      "description": "Lab received sample",
      "date": "2025-07-10T00:00:00Z",
      "results_available": false,
      "csv_available": false
    }
  ]
}

Response Fields

FieldDescription
order_idYour order ID
statusCurrent order status; Pending until fulfilment starts
descriptionRepeats the status, as the order webhook does
dateUTC time the order was created with us (the time of each status change is not recorded)
kitsEach kit registered against the order, with the fields of Get Kit Status; empty until a kit is registered

The status values match those listed in Order Status Updates below, plus Pending.

Error Cases

StatusCause
403Order does not belong to your account
404Order not found

Status Webhooks

Biomesight pushes status updates to your endpoint as orders and samples progress through the fulfilment and lab pipeline. You provide a webhook URL during onboarding and we send authenticated POST requests to it whenever a status changes.

Webhook Payload

{
  "order_id": "ORD-20250615-001",   // for order updates
  "kit_id": "BS1-ABC12",              // for kit/sample updates
  "status": "Sample Received",
  "description": "Lab received sample",
  "date": "2025-07-10T14:22:00Z"
}

A kit update carries kit_id and an order update carries order_id, never both. date is the UTC time the update was sent, as YYYY-MM-DDTHH:MM:SSZ. description is our short description of the status and can be empty; it may differ from the wording in the tables below, and for order updates it repeats the status.

Webhook requests are sent with Content-Type: application/json and include an Authorization: Bearer header using OAuth credentials you provide to us, so you can verify the sender: we request the token from your OAuth token endpoint with the client credentials grant.

Delivery: we treat any 2xx response within 30 seconds as delivered. A failed delivery (any other response, a timeout or a connection error) is not retried; our team is alerted. Updates can arrive more than once (Results Processed, PDF Ready and QA Failed can be sent once for each of our analysis pipelines) and are not guaranteed to arrive in order. Use date to order them, and Get Kit Status or Get Order Status to check the current status or recover a missed update.

Kit / Sample Status Updates

These statuses are pushed as a sample moves through the lab pipeline:

StatusDescription
Shipping to LabKit dispatched to the laboratory
Sample DeliveredSample delivered to lab but not yet acknowledged
Sample ReceivedLab has received and logged the sample
Lab ProcessingSequencing and analysis has started
Lab Processing RepeatingSample is being processed a second time (can occur up to 2 times)
Results ProcessedResults are processed on one of our analysis pipelines. JSON results are ready for download via the API once results_available is true on Get Kit Status; the CSV once csv_available is true
PDF ReadyPDF report is ready for download via the API
Replacement kit issuedA replacement kit has been issued
Sample not viableSample could not be processed; a replacement may be needed
Enquiry initiatedA manual enquiry has been opened for this sample
Dried outSample dried out in transit; a new sample is needed
Sample CancelledSample processing was cancelled (normally at customer request)
QA FailedLab processing completed but did not pass quality criteria

Order Status Updates

These statuses are pushed as an order moves through fulfilment:

StatusDescription
Booked with AmazonOrder submitted to Amazon FBA for fulfilment
DispatchedKit has been dispatched from the warehouse
ShippedKit is in transit to the customer
DeliveredKit has been delivered
CancelledOrder has been cancelled
ErrorAn error occurred during fulfilment
LostKit was lost in transit
Enquiry in ProgressA fulfilment enquiry is in progress
Note: The Pending status is the default when an order is created and is never sent as a webhook. Amazon FBA fulfilment is available.

Error Handling

All error responses follow a consistent JSON format:

{
  "error": "A description of what went wrong"
}

Common HTTP Status Codes

CodeMeaning
200Success
201Resource created (e.g. new order)
202Accepted but not ready (e.g. results still processing)
400Bad request — missing or invalid parameters
401Unauthorised — missing or expired token
403Forbidden — insufficient permissions or IP not whitelisted
404Resource not found
409Conflict — duplicate resource (e.g. duplicate order ID)
422Validation error — missing or invalid fields
500Server error — contact support if this persists

Ready to Integrate?

Apply for access: once we approve your organisation you create your own sandbox API keys. Questions? support@biomesight.com

Request API access
DISCLAIMER This service has not been evaluated by the Food and Drug Administration or other healthcare authorities. Our platform and related products and services are not intended to diagnose, treat, cure or prevent any disease. Ranges apply to over 18s only.
Chat with us