Healthcare Intake Pipeline

Webhook → PostgreSQL → API pipeline. Retell AI call_ended payload in, pre-registration record out. Live demo — synthetic data only.

checking…

1. Paste bearer tokens

From the Upwork application message. Commands below regenerate as you type.

2. Try it — copy & run

Paste any of these into a terminal. Replace <PRE_REG_ID> / <INTAKE_EVENT_ID> with UUIDs from earlier responses.

Health check (no auth)

Confirms the app is running and can reach Postgres. Returns {"status":"ok","db":"ok"}. No authentication required — anyone can check liveness.

Submit a webhook · POST /webhooks/retell

Simulates Retell posting a completed call. Validates the payload, stores the raw JSON as an audit event, and creates a pre_reg record. Posting the same call_id again returns {"status":"duplicate"} — idempotent by design.

List pre-registrations · GET /api/pre-reg

Returns pre-registration records, most recent first. Cursor-paginated: add ?limit=20&cursor=... to page through. Filter by status with ?status=reviewed. Soft-deleted rows are never returned.

Get one by id · GET /api/pre-reg/:id

Fetches a single pre_reg record by UUID, plus metadata about the intake event it was derived from. Returns 404 if the record is missing or soft-deleted.

Update one · PATCH /api/pre-reg/:id (mark reviewed + add note)

Partially updates a record — any subset of fields is allowed, empty body returns 400. Fields go through the same validators the webhook uses (E.164 phones, ISO dates, email format). Useful for a coordinator marking a record reviewed or fixing a typo.

Reprocess a stored event · POST /api/intake-events/:id/reprocess

Recovery for events whose derivation failed on the first try (bad payload, transient bug). Retries the derivation now. If a pre_reg already exists for that event, returns already_derived — safe to call either way. Without this endpoint, failed events would be permanently orphaned.

3. Build a custom payload (optional)

Generate a synthetic Retell call_ended event

A default payload is generated on page load and wired into the submit command above. Change any field and click Generate payload to refresh the JSON (and the submit command). Reset to default restores the sample values.

Generated payload

Notes + links