Connect a lab to Cell Ledger
For LIMS vendors, lab IT teams and monitoring providers. A lab's systems can send its clients, samples, custody events and tank readings to Cell Ledger, or Cell Ledger can fetch them from an export the lab publishes.
Overview
- Base address:
https://cellledger.com/api/v1 - JSON over HTTPS. Send
Content-Type: application/json. - Every request carries the lab's key:
Authorization: Bearer cvk_… - Everything a key sends belongs to that lab only. Keys can't read data, only send it.
- Safe to retry: records are matched on the lab's own IDs, and repeated readings are skipped.
- Machine-readable description: OpenAPI 3.1 (import it into Postman or a code generator).
Keys and permissions
A lab admin creates keys in Settings → Connect your systems, one per system, and ticks what each may send:
| Permission | Allows |
|---|---|
| Clients and samples | POST /samples |
| Custody events | POST /events |
| Tank readings | POST /tank-readings |
The key is shown once. Cell Ledger only keeps a hash of it. The lab sees when each key was last used and can revoke it at any time; a revoked key stops working immediately. Never put a key in a web page or app that customers download.
Clients and samples: POST /samples
Send up to 500 records per request. A record creates or updates the client (matched on clientRef) and the sample (matched on sampleCode). New samples get a “banked” entry in their custody history.
| Field | Meaning |
|---|---|
| clientRef * | Client number |
| fullName * | Owner full name |
| icNumber | ID / passport no. (only the last 4 digits are kept) |
| phone | Phone (local numbers get the lab's country code) |
| country | Country of residence |
| preferredLanguage | Language |
| whatsappConsent | WhatsApp opt-in |
| whatsappMarketing | Offers & news opt-in |
| paidUntil | Paid until (ISO date or dd/mm/yyyy) |
| outstandingAmount | Amount owed |
| sampleCode * | Sample ID |
| cellType * | Cell type |
| donorName | Donor name |
| collectedAt | Collection date (ISO date or dd/mm/yyyy) |
| frozenAt | Freeze date (ISO date or dd/mm/yyyy) |
| totalCells | Total cell count |
| viability | Viability % |
| cd34Count | CD34+ count |
| volumeMl | Volume (ml) |
| vialCount | No. of vials/bags |
| tankCode | Tank |
| rack | Rack |
| box | Box |
| position | Position |
POST https://cellledger.com/api/v1/samples
Authorization: Bearer cvk_your_key
Content-Type: application/json
{"records": [{
"clientRef": "CB000123", "fullName": "Tan Mei Yee", "email": "mei@example.com", "phone": "012-345 6789",
"sampleCode": "S-000123", "cellType": "Cord blood", "totalCells": 1.2e9, "viability": 94.5,
"tankCode": "LN2-01", "rack": "R3", "box": "B7", "position": "C4", "paidUntil": "2027-01-31"
}]}
→ 200 {"ownersCreated": 1, "samplesCreated": 1, "samplesUpdated": 0, "errors": []}Custody events: POST /events
Adds an entry to a sample's tamper-evident history (each entry is chained to the previous one). Types: AUDIT, MOVED, QC_TEST, REMOVED, RETURNED, TRANSFERRED, ALERT. A MOVED event with tankCode, rack, box, position also updates the sample's location. The owner sees the event straight away.
POST https://cellledger.com/api/v1/events
{"sampleCode": "S-000123", "type": "MOVED", "description": "Moved to LN2-02 for maintenance",
"performedBy": "Tech Aminah", "tankCode": "LN2-02", "rack": "R1", "box": "B2", "position": "A1"}
→ 200 {"id": "…", "hash": "…"}Tank readings: POST /tank-readings
One reading, or {"readings": [...]} with up to 1000. Tanks are created the first time their code is seen. A reading for the same tank and time is skipped, so you can safely re-send a whole log.
| tankCode * | Tank |
| temperatureC * | Temperature (°C) |
| ln2LevelPct | LN₂ level (%) |
| lidOpen | Lid open |
| recordedAt | Time |
POST https://cellledger.com/api/v1/tank-readings
{"readings": [{"tankCode": "LN2-01", "temperatureC": -190.4, "ln2LevelPct": 72, "recordedAt": "2026-10-28T10:00:00Z"}]}
→ 200 {"saved": 1, "duplicatesSkipped": 0, "errors": []}Responses and errors
| 200 | Done. For batches, records that couldn't be read are listed in errors (by position) and the rest are saved. |
| 400 | The body isn't valid JSON, or required fields are missing. |
| 401 | Missing, wrong or revoked key. |
| 403 | The key isn't allowed to send this kind of data. |
| 404 | Unknown sample (events). |
Errors look like {"error": "…"}.
Let Cell Ledger fetch instead
If a system can't call an API but can publish an export, the lab adds a Connection in its back office. Cell Ledger fetches the address every 15 minutes to once a day and imports it with the same rules as above.
- Formats: CSV (first row = column names) or JSON (a list of records, optionally inside the response, e.g.
data.items). - Columns: matched automatically from common names (e.g. “Client No.”, “Unit No”, “TNC”, “Temperature”), and adjustable by the lab.
- Authentication: one header of your choice (e.g.
Authorization: Bearer …orX-API-Key), stored encrypted. - Requirements: a public
https://address; at most 10 MB and 20,000 records per fetch; answer within 30 seconds.
Building a ready-made connector for your LIMS? Send us a sample export and we'll add a preset so labs can connect in a few clicks.
Code examples
curl
curl -X POST https://cellledger.com/api/v1/tank-readings \
-H "Authorization: Bearer $CELL_LEDGER_KEY" -H "Content-Type: application/json" \
-d '{"tankCode":"LN2-01","temperatureC":-190.4,"ln2LevelPct":72}'JavaScript (Node 18+)
const res = await fetch("https://cellledger.com/api/v1/samples", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.CELL_LEDGER_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ records: rowsFromYourLims }),
});
console.log(await res.json());Python
import os, requests
r = requests.post(
"https://cellledger.com/api/v1/events",
headers={"Authorization": f"Bearer {os.environ['CELL_LEDGER_KEY']}"},
json={"sampleCode": "S-000123", "type": "AUDIT", "description": "Annual inventory audit"},
timeout=30,
)
print(r.status_code, r.json())Questions or a new connector? Contact us through your lab's Cell Ledger account, or register a test lab to try the API with your own key.
