QEHSQEHS

migration

Bulk loading via API

For migrations larger than ~50k rows, the CSV importer can be slow. The API bulk-load endpoint accepts NDJSON with idempotency keys.

8 min read · 2 sections

Why API over CSV

  • Bulk loads up to 10,000 rows per call with 500 rows/sec throughput.
  • Idempotency keys prevent duplicate insertion on retries.
  • Stream-friendly (NDJSON) — no memory cap on total row count.
  • Attachments (photos, PDFs) can be uploaded concurrently via signed URLs.

Minimum example

curl -X POST https://app.qehsethos.com/api/modules/incidents/bulk \
  -H "Authorization: Bearer $QEHS_API_KEY" \
  -H "Content-Type: application/x-ndjson" \
  -H "Idempotency-Key: migration-batch-2026-04-16-001" \
  --data-binary @incidents.ndjson

Each line in incidents.ndjson is a single JSON object. The response streams per-row outcomes so you can correlate with your source system. See the Developer portal → API reference for the full schema.

Tags: api · bulk · migration · ndjson