REST API

Push results straight
into your COAs

Any instrument that can make an HTTP request can write directly to AI Lab Services. No middleware, no CSV exports — results land in the right COA the moment the run finishes.

How it works

1

Generate an API key

Create a scoped key per instrument in Settings → API Keys. Optionally name it and assign a field-mapping template.

2

POST your results

Send a JSON payload with the sample ID and result rows. The platform maps your instrument's field names to AILS fields automatically.

3

Review in the COA

Results appear instantly on the matching COA draft. Your lab team reviews, applies action limits, and issues with a single click.

Quick start

Push a result in under a minute with any HTTP client.

curl
curl -X POST https://api.ailabservices.com/api/ingest/results \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sampleId": "S-1001",
    "results": [
      {
        "analyte": "THC",
        "result": 22.4,
        "unit": "%",
        "method": "HPLC-UV",
        "lod": 0.01,
        "loq": 0.05
      },
      {
        "analyte": "CBD",
        "result": 0.12,
        "unit": "%",
        "method": "HPLC-UV",
        "lod": 0.01,
        "loq": 0.05
      }
    ]
  }'

Endpoints

Base URL: https://api.ailabservices.com

POST/api/ingest/results

Push results to a COA

Appends one or more result rows to a COC/COA. The API key determines the tenant and applies any saved field mappings automatically.

POST/api/ingest/analyze

Dry-run field mapping

Submit a sample payload and get back how it would be mapped to AILS fields — without writing any data. Use during integration development.

GET/api/ingest/me

Verify API key

Returns the key name, instrument name, manufacturer, and active status. Great for a connectivity check from instrument firmware.

Result fields

These are the canonical AILS field names. Your instrument can use different names — configure the mapping once in Settings → API Keys → Field Mappings.

FieldRequiredTypeNotes
sampleIdrequiredstringMust match an existing COC sample ID
analyterequiredstringName of the analyte tested (e.g. "THC", "Aflatoxin B1")
resultrequirednumber | stringNumeric result value, or "<LOD" / "<LOQ"
unitoptionalstringUnit of measure (e.g. "%", "mg/kg", "CFU/g")
methodoptionalstringTest method name or SOP reference
lodoptionalnumberLimit of Detection
loqoptionalnumberLimit of Quantitation
passoptionalbooleanOverride pass/fail; if omitted the platform evaluates action limits
notesoptionalstringFree-text notes attached to this result row
ignoreoptionalbooleanMark the row as informational (excluded from final pass/fail)

Authentication

Pass your API key as a Bearer token in the Authorization header. Keys are scoped to a single tenant and can be revoked at any time from the Instrument Hub.

http
Authorization: Bearer ails_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Key rotation

Generate a new key without downtime — old key stays active until you revoke it.

Per-instrument scoping

One key per instrument so you can track usage and rotate independently.

Field mapping templates

Save a mapping once per key — every push auto-translates your instrument's field names.

Usage tracking

Last-used timestamp and total call count visible in the Instrument Hub.

Start pushing results today

Generate your first API key in under a minute. No separate developer account required.