POST /v1/reports

Upload a lab report and get structured results.

Try in Playground

Returns 202 with a queued report; poll it or wait for the webhook. Send an Idempotency-Key to make retries safe.

POST /api/v1/reports
Authorization: Bearer ik_live_...
Idempotency-Key: 6f1c2c1e-...
Content-Type: multipart/form-data

file     report.pdf
options  {"mode":"council","zero_retention":true,"external_id":"visit-4411"}

Response 200 OK

What GET /v1/reports/{id} returns once the report is completed (the same body as the webhook). The example is a Serbian report: printed_name keeps the lab's own words, analyte gives the standard code.

{
  "id": "0f6c...", "object": "report", "status": "completed",
  "report": {
    "language": "sr", "measured_on": "2026-09-29",
    "results": [
      { "printed_name": "HbA1c", "analyte": { "code": "hba1c", "loinc": "4548-4" },
        "value": 5.5, "unit": "%", "range_low": 4.0, "range_high": 5.6, "confidence": 0.98 },
      { "printed_name": "Glukoza", "analyte": { "code": "glucose", "loinc": "2345-7" },
        "value": 5.6, "unit": "mmol/L", "range_low": 3.9, "range_high": 6.1, "confidence": 0.97 }
    ]
  }
}

GET /v1/reports/{id}200 OK

The report and its results once status is completed.

curl https://insulait.xyz/api/v1/reports/{id} -H "Authorization: Bearer $INSULAIT_KEY"

{
  "id": "0f6c...", "object": "report", "status": "completed",
  "report": {
    "language": "sr", "lab_name": "...", "measured_on": "2026-09-29", "date_confident": true,
    "results": [{
      "printed_name": "Glukoza", "printed_value": "5,9", "printed_unit": "mmol/L",
      "printed_range": "3,9 - 6,1", "printed_flag": null,
      "analyte": { "code": "glucose", "loinc": "2345-7", "name": "Glucose (fasting)" },
      "value": 5.9, "comparator": "=", "unit": "mmol/L",
      "range_low": 3.9, "range_high": 6.1, "position": "within",
      "confidence": 0.97, "needs_review": false, "reasons": [], "page": 1
    }]
  }
}

GET /v1/reports

Your organization's most recent reports, newest first. ?limit= from 1 to 100, default 20.

curl "https://insulait.xyz/api/v1/reports?limit=20" -H "Authorization: Bearer $INSULAIT_KEY"

{ "object": "list", "data": [ { "id": "0f6c...", "object": "report", "status": "completed", ... } ] }

DELETE /v1/reports/{id}

Removes the file and the results immediately.

curl -X DELETE https://insulait.xyz/api/v1/reports/{id} -H "Authorization: Bearer $INSULAIT_KEY"

{ "id": "0f6c...", "object": "report", "deleted": true }

Lab API v1

Lab reports in, structured results out

Upload a lab report as a PDF or photos. Two independent readers and a verifier read it, code compares their readings, and you get every value back with its LOINC code, unit and the range the lab printed. Base URL https://insulait.xyz/api/v1. JSON everywhere except uploads. All processing in the EU.

Authentication

Create keys in the partner portal. Test keys (ik_test_) work without a plan and are limited to 25 reports a month. Keys are shown once and stored as a hash. Call the API from your server only.

Authorization: Bearer ik_live_ab12cd34_...

Webhooks

Events report.completed and report.failed. The body is the report object. Verify the signature, reject anything older than five minutes, answer 2xx within 10 seconds. Failures retry after 1, 5, 30, 120 and 600 minutes.

// Node: verify Insulait-Signature: t=<unix>,v1=<hex>
import crypto from "node:crypto";
function verify(secret, rawBody, header) {
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const mac = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(mac), Buffer.from(v1));
}

Result fields

  • printed_*: exactly what the report says. Always present, even when we could not map the row.
  • analyte: catalog code and LOINC, or null when the test is not in the catalog. We never guess a mapping.
  • value, unit, range_low, range_high: converted to the catalog's canonical unit by a fixed table. Null when the printed unit cannot be converted safely.
  • position: where the value sits against the range the lab printed. A transcription fact, not a clinical judgment.
  • confidence, needs_review, reasons: computed from reader agreement, verifier result, catalog match, unit validity and plausibility.

Errors

{ "error": { "type": "quota_exceeded", "message": "...", "request_id": "req_..." } }

401 authentication, 403 suspended, 404 not found, 413 too large, 415 type, 429 quota. Every response carries x-request-id.

Markers (58)

Machine-readable at GET /analytes.

glucoseGlucose (fasting)2345-7mmol/L
glucose_ogtt_2hGlucose 2 h after 75 g load (OGTT)20438-8mmol/L
hba1cHbA1c4548-4%
insulinInsulin (fasting)20448-7µIU/mL
c_peptideC-peptide1986-9nmol/L
fructosamineFructosamine15069-8µmol/L
cholesterol_totalTotal cholesterol2093-3mmol/L
ldlLDL cholesterol13457-7mmol/L
hdlHDL cholesterol2085-9mmol/L
triglyceridesTriglycerides2571-8mmol/L
non_hdlNon-HDL cholesterol43396-1mmol/L
apobApolipoprotein B1884-6g/L
lpaLipoprotein(a)43583-4nmol/L
altALT1742-6U/L
astAST1920-8U/L
ggtGGT2324-2U/L
alpAlkaline phosphatase6768-6U/L
bilirubin_totalTotal bilirubin1975-2µmol/L
albuminAlbumin1751-7g/L
total_proteinTotal protein2885-2g/L
creatinineCreatinine2160-0µmol/L
ureaUrea3091-6mmol/L
bunBlood urea nitrogen3094-0mg/dL
egfreGFR98979-8mL/min/1.73m²
uric_acidUric acid3084-1µmol/L
uacrUrine albumin/creatinine ratio9318-7mg/mmol
hemoglobinHemoglobin718-7g/L
hematocritHematocrit4544-3%
rbcRed blood cells789-810^12/L
wbcWhite blood cells6690-210^9/L
plateletsPlatelets777-310^9/L
mcvMCV787-2fL
rdwRDW788-0%
lymphocytes_pctLymphocytes %736-9%
neutrophils_pctNeutrophils %770-8%
crpC-reactive protein1988-5mg/L
hs_crphs-CRP30522-7mg/L
esrErythrocyte sedimentation rate4537-7mm/h
tshTSH3016-3mIU/L
ft4Free T43024-7pmol/L
ft3Free T33051-0pmol/L
vitamin_dVitamin D (25-OH)1989-3nmol/L
b12Vitamin B122132-9pmol/L
folateFolate2284-8nmol/L
ferritinFerritin2276-4µg/L
ironIron2498-4µmol/L
sodiumSodium2951-2mmol/L
potassiumPotassium2823-3mmol/L
calciumCalcium17861-6mmol/L
magnesiumMagnesium19123-9mmol/L
testosteroneTestosterone (total)2986-8nmol/L
cortisolCortisol2143-6nmol/L
homocysteineHomocysteine13965-9µmol/L
weightBody weight29463-7kg
heightHeight8302-2cm
waistWaist circumference8280-0cm
bp_systolicBlood pressure, systolic8480-6mmHg
bp_diastolicBlood pressure, diastolic8462-4mmHg

Limits

  • Test keys: 25 reports a month, no plan needed.
  • Live keys: the reports included in your plan, then the per-report price shown in Billing.
  • One PDF or up to 8 images per report, 20 MB per file. Over a limit you get 429 quota_exceeded or 413.

Changelog

  • 2026-10-07: v1. Reports, results with LOINC and printed ranges, webhooks, zero retention.