🔌API & Webhooks

Connect LabSync to anything

A versioned REST API and HMAC-signed webhooks let you push calibration data to your ERP, trigger automation workflows, and build custom integrations.

webhook-receiver.ts
import crypto from "crypto";

export function verifyLabSync(
  body: string,
  header: string,
  secret: string
): boolean {
  const parts = Object.fromEntries(
    header.split(",").map(p => p.split("="))
  );
  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${parts.t}.${body}`)
    .digest("hex");
  return crypto.timingSafeEqual(
    Buffer.from(`v1=${expected}`),
    Buffer.from(parts.v1 ? `v1=${parts.v1}` : "")
  );
}

// Express example
app.post("/webhook", (req, res) => {
  const sig = req.headers["x-labsync-signature"];
  if (!verifyLabSync(req.rawBody, sig, SECRET)) {
    return res.status(401).send("Invalid signature");
  }
  const { event, data } = req.body;
  // handle event...
  res.json({ ok: true });
});

Webhook events

Subscribe to any combination of events. Each delivery includes the full object payload.

job.createdNew calibration job received
job.completedJob finished, cert ready
certificate.issuedCertificate signed and available
invoice.issuedTax invoice created
invoice.paidPayment confirmed
invoice.overdueInvoice past due date
portal.slip_receivedCustomer uploaded payment slip
lab.approvedLab verified and approved

Enterprise-grade integration infrastructure

Versioned REST API

Clean, predictable JSON API under /api/v1/*. Authenticate with API keys scoped to read/write/admin. Rate-limited per key. OpenAPI schema available.

HMAC-signed webhooks

Stripe-style t=timestamp,v1=signature header on every delivery. Verify authenticity in your receiver with 3 lines of code. Delivery log with retry status in the admin panel.

Exponential backoff retry

Failed webhook deliveries are retried automatically: 30s, 5m, 30m, 2h, 8h, 24h. Permanently failed after 6 attempts — notified via Sentry for oncall.

Scoped API keys

Create multiple API keys with read, write, or admin scope. Revoke instantly. Each key shows last-used date and request count. Rotate without downtime.

n8n + Zapier compatible

Pre-built n8n workflow templates for common automations: new signup email, new article → social, lab approval, cert-expiry notify. Webhook trigger works with any automation platform.

Delivery audit log

Every webhook delivery is logged — payload, response code, response body, latency, and retry count. Inspect any delivery in the admin panel to debug integration issues.

Ready to integrate?

API keys are available on all paid plans. Free trial includes full API access for 14 days.

REST API & Webhooks — Integrate LabSync | LabSync