Skip to content

Public API

Public endpoints at /public require no authentication. They power the patient-facing portal: report lookup, home sampling booking, and lab marketing pages.

Rate limiting

Sensitive endpoints use the auth rate limit policy:

EndpointLimit behavior
POST /public/reports/lookupThrottled per IP
POST /public/portal/{slug}/home-samplingThrottled per IP

Exceeded limits return HTTP 429.

Portal home

GET /public/portal/{slug}

Returns branding and configuration for a lab's public portal:

FieldDescription
name, logoUrlLab branding
slugURL identifier
isReadonlyWhether lab is in read-only mode
featuresEnabled portal features

Returns 404 if slug not found.

GET /public/portal/{slug}/tests

ParameterDefaultDescription
searchFilter test names
pageSize30Max results

Returns published tests with prices for the public catalog.

Report lookup

POST /public/reports/lookup

Request:

json
{
  "slug": "my-lab",
  "invoiceNumber": "10042",
  "accessCode": "ABC123"
}

Success: Report summary with test results (if verified and released).

Failure: 404 — Invalid invoice number or access code.

Access codes are printed on patient receipts or sent via SMS.

POST /public/reports/print-data

Returns formatted print layout data for browser printing:

json
{
  "slug": "my-lab",
  "invoiceNumber": "10042",
  "accessCode": "ABC123"
}

Home sampling

POST /public/portal/{slug}/home-sampling

Submit a home collection request:

FieldRequiredDescription
patientNameYesPatient full name
phoneYesContact number
addressYesCollection address
preferredDateNoRequested date
testsNoRequested test names/IDs
notesNoSpecial instructions

Staff process requests in the tenant portal under Home Sampling.

Web analytics

POST /public/analytics/visit

Records anonymous page visit events for marketing analytics (no PII).

Custom domains

When a custom domain is configured, public routes are also served on the branded hostname. The slug parameter still identifies the tenant internally.

Security considerations

ControlDetail
Access codesRequired for report access; not guessable
No enumerationLookup failures are generic
HTTPSRequired in production
Read-only labsPortal may show message; booking may be disabled

Response format

Public routes use the standard ApiResponse<T> envelope where implemented:

json
{
  "success": true,
  "message": "Report retrieved successfully.",
  "data": { }
}

Ease Lab — Cloud Pathology Lab Management