POST /v1/reports
Upload a lab report and get structured results.
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.
| glucose | Glucose (fasting) | 2345-7 | mmol/L |
| glucose_ogtt_2h | Glucose 2 h after 75 g load (OGTT) | 20438-8 | mmol/L |
| hba1c | HbA1c | 4548-4 | % |
| insulin | Insulin (fasting) | 20448-7 | µIU/mL |
| c_peptide | C-peptide | 1986-9 | nmol/L |
| fructosamine | Fructosamine | 15069-8 | µmol/L |
| cholesterol_total | Total cholesterol | 2093-3 | mmol/L |
| ldl | LDL cholesterol | 13457-7 | mmol/L |
| hdl | HDL cholesterol | 2085-9 | mmol/L |
| triglycerides | Triglycerides | 2571-8 | mmol/L |
| non_hdl | Non-HDL cholesterol | 43396-1 | mmol/L |
| apob | Apolipoprotein B | 1884-6 | g/L |
| lpa | Lipoprotein(a) | 43583-4 | nmol/L |
| alt | ALT | 1742-6 | U/L |
| ast | AST | 1920-8 | U/L |
| ggt | GGT | 2324-2 | U/L |
| alp | Alkaline phosphatase | 6768-6 | U/L |
| bilirubin_total | Total bilirubin | 1975-2 | µmol/L |
| albumin | Albumin | 1751-7 | g/L |
| total_protein | Total protein | 2885-2 | g/L |
| creatinine | Creatinine | 2160-0 | µmol/L |
| urea | Urea | 3091-6 | mmol/L |
| bun | Blood urea nitrogen | 3094-0 | mg/dL |
| egfr | eGFR | 98979-8 | mL/min/1.73m² |
| uric_acid | Uric acid | 3084-1 | µmol/L |
| uacr | Urine albumin/creatinine ratio | 9318-7 | mg/mmol |
| hemoglobin | Hemoglobin | 718-7 | g/L |
| hematocrit | Hematocrit | 4544-3 | % |
| rbc | Red blood cells | 789-8 | 10^12/L |
| wbc | White blood cells | 6690-2 | 10^9/L |
| platelets | Platelets | 777-3 | 10^9/L |
| mcv | MCV | 787-2 | fL |
| rdw | RDW | 788-0 | % |
| lymphocytes_pct | Lymphocytes % | 736-9 | % |
| neutrophils_pct | Neutrophils % | 770-8 | % |
| crp | C-reactive protein | 1988-5 | mg/L |
| hs_crp | hs-CRP | 30522-7 | mg/L |
| esr | Erythrocyte sedimentation rate | 4537-7 | mm/h |
| tsh | TSH | 3016-3 | mIU/L |
| ft4 | Free T4 | 3024-7 | pmol/L |
| ft3 | Free T3 | 3051-0 | pmol/L |
| vitamin_d | Vitamin D (25-OH) | 1989-3 | nmol/L |
| b12 | Vitamin B12 | 2132-9 | pmol/L |
| folate | Folate | 2284-8 | nmol/L |
| ferritin | Ferritin | 2276-4 | µg/L |
| iron | Iron | 2498-4 | µmol/L |
| sodium | Sodium | 2951-2 | mmol/L |
| potassium | Potassium | 2823-3 | mmol/L |
| calcium | Calcium | 17861-6 | mmol/L |
| magnesium | Magnesium | 19123-9 | mmol/L |
| testosterone | Testosterone (total) | 2986-8 | nmol/L |
| cortisol | Cortisol | 2143-6 | nmol/L |
| homocysteine | Homocysteine | 13965-9 | µmol/L |
| weight | Body weight | 29463-7 | kg |
| height | Height | 8302-2 | cm |
| waist | Waist circumference | 8280-0 | cm |
| bp_systolic | Blood pressure, systolic | 8480-6 | mmHg |
| bp_diastolic | Blood pressure, diastolic | 8462-4 | mmHg |
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_exceededor413.
Changelog
- 2026-10-07: v1. Reports, results with LOINC and printed ranges, webhooks, zero retention.