Partner API
Order kits, register samples and pull results into your own system.
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
Contact us
Reach out at support@biomesight.com to discuss your integration and receive API credentials.
Authenticate
Use your Client ID and Client Secret to obtain an access token via the OAuth 2.0 Client Credentials flow.
Integrate
Create orders, register kits, and retrieve results using the endpoints described below.
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:
Request
| Header / Field | Value |
|---|---|
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.
Request Headers
| Header | Value |
|---|---|
Authorization | Bearer {access_token} |
Content-Type | application/json |
Request Body
| Field | Type | Description |
|---|---|---|
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
| Status | Cause |
|---|---|
400 | Missing order_id or invalid JSON body |
409 | Duplicate order — an order with the same order_id already exists |
422 | Validation error — missing or invalid fields (e.g. invalid email, missing address, unknown SKU, invalid date) |
500 | Server error — contact support |
Register Kit
After your customer collects their sample, register the kit to associate the customer with the kit ID.
Request Headers
| Header | Value |
|---|---|
Authorization | Bearer {access_token} |
Content-Type | application/json |
Request Body
| Field | Type | Description |
|---|---|---|
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
| Status | Cause |
|---|---|
200 | Kit already registered — returns {"status": "Already registered"} |
400 | Missing required fields, invalid sample data, order not found, kit not found, or invalid kit status |
500 | Server error — contact support |
Get Results
Retrieve microbiome analysis results for a registered kit. Results are available once lab processing is complete.
Request Headers
| Header | Value |
|---|---|
Authorization | Bearer {access_token} |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
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
| Field | Description |
|---|---|
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 |
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
| Column | Description |
|---|---|
Kingdom, Phylum, Class, Order, Family, Genus | Taxon name at each rank; empty where the reads could not be classified to that rank. Unclassified reads have Kingdom set to Unclassified |
Species | Species name without the genus (e.g. muciniphila); empty where not classified to species |
num_hits | Number of reads assigned to the lineage |
%_hits | Percentage of the sample’s reads assigned to the lineage (0–100, up to 6 decimal places) |
Error Cases
| Status | Cause |
|---|---|
202 | Results are not ready yet — lab processing is still in progress |
203 | PDF report or CSV file not ready (JSON results may already be available) |
400 | Unsupported format or invalid client |
403 | Kit does not belong to your account |
404 | Kit not found |
Get Kit Status
Look up the current status of a kit/sample as it moves through the lab pipeline.
Request Headers
| Header | Value |
|---|---|
Authorization | Bearer {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
| Field | Description |
|---|---|
kit_id | The kit ID |
status | Current kit / sample status |
description | Short description of the status, the same text the webhook sends; can be empty |
date | UTC 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_available | true once JSON results can be downloaded from Get Results |
csv_available | true 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
| Status | Cause |
|---|---|
403 | Kit does not belong to your account |
404 | Kit not found |
Get Order Status
Look up the current fulfilment status of an order.
Request Headers
| Header | Value |
|---|---|
Authorization | Bearer {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
| Field | Description |
|---|---|
order_id | Your order ID |
status | Current order status; Pending until fulfilment starts |
description | Repeats the status, as the order webhook does |
date | UTC time the order was created with us (the time of each status change is not recorded) |
kits | Each 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
| Status | Cause |
|---|---|
403 | Order does not belong to your account |
404 | Order 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.
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:
| Status | Description |
|---|---|
| Shipping to Lab | Kit dispatched to the laboratory |
| Sample Delivered | Sample delivered to lab but not yet acknowledged |
| Sample Received | Lab has received and logged the sample |
| Lab Processing | Sequencing and analysis has started |
| Lab Processing Repeating | Sample is being processed a second time (can occur up to 2 times) |
| Results Processed | Results 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 Ready | PDF report is ready for download via the API |
| Replacement kit issued | A replacement kit has been issued |
| Sample not viable | Sample could not be processed; a replacement may be needed |
| Enquiry initiated | A manual enquiry has been opened for this sample |
| Dried out | Sample dried out in transit; a new sample is needed |
| Sample Cancelled | Sample processing was cancelled (normally at customer request) |
| QA Failed | Lab processing completed but did not pass quality criteria |
Order Status Updates
These statuses are pushed as an order moves through fulfilment:
| Status | Description |
|---|---|
| Booked with Amazon | Order submitted to Amazon FBA for fulfilment |
| Dispatched | Kit has been dispatched from the warehouse |
| Shipped | Kit is in transit to the customer |
| Delivered | Kit has been delivered |
| Cancelled | Order has been cancelled |
| Error | An error occurred during fulfilment |
| Lost | Kit was lost in transit |
| Enquiry in Progress | A fulfilment enquiry is in progress |
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
| Code | Meaning |
|---|---|
200 | Success |
201 | Resource created (e.g. new order) |
202 | Accepted but not ready (e.g. results still processing) |
400 | Bad request — missing or invalid parameters |
401 | Unauthorised — missing or expired token |
403 | Forbidden — insufficient permissions or IP not whitelisted |
404 | Resource not found |
409 | Conflict — duplicate resource (e.g. duplicate order ID) |
422 | Validation error — missing or invalid fields |
500 | Server 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