Implementation guide

Lab results API

Submit structured diagnostic result payloads into configured lanes.

Mapped results

Guide scope

MethodPOSTAccesswriteAuthBearer key

Lab results API

Use the Lab results API to submit mapped diagnostic result data, documents, and result status from a partner system.

Endpoint

POST /receiveTestData

Authentication and security

Send x-api-key with a key scoped for result ingestion. Include x-request-id when you need idempotent tracing.

Request example

curl -X POST "https://popularishealth.web.app/receiveTestData" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-request-id: partner-result-20260307-001" \
  -d '{
    "data": {
      "senderID": "partner-lab",
      "patientID": "patient_12345",
      "accessionNumber": "ACC-1001",
      "recordNo": "REC-1001",
      "status": "Completed",
      "ResultedDateUTC": "2026-03-07T12:00:00Z",
      "reports": [
        {
          "source": "base64",
          "type": "Lab Result",
          "name": "cmp-report.pdf",
          "data": "JVBERi0xLjQKJ... (truncated)"
        }
      ],
      "results": {
        "testName": "Comprehensive Metabolic Panel",
        "result": "Normal",
        "units": "",
        "referenceRange": "See PDF"
      }
    }
  }'

Success response

{
  "status": "success",
  "message": "Encrypted result saved and notifications attempted.",
  "requestId": "partner-result-20260307-001"
}

Response headers

  • x-request-id is echoed so support can trace a specific submission.
  • x-ratelimit-limit, x-ratelimit-remaining, and x-ratelimit-reset describe the active key limit state.

Common errors

  • 400: required mapped fields are missing from the payload.
  • 401: the API key is missing or invalid.
  • 403: the key is blocked by scope or partner policy.
  • 429: the rate limit was exceeded.

For file-based clinical payloads, review the FHIR intake guide and HL7 intake guide.