Getting Started

Welcome to the IntakeDesk documentation. This guide will walk you through the basics of setting up and using IntakeDesk to streamline your referral intake process.

Installation

To get started, you will need to install our client libraries and configure your environment. We provide packages for popular EMR systems and a REST API for custom integrations.

Example Code
Here is an example of how to install the necessary packages.
npm install @intakedesk/client

Configuration

To generate an API Key, use the POST /api/api-keys endpoint (authenticated via your Dashboard session) or contact support to enable the API Keys UI in your dashboard.

Authentication

The API supports two methods of authentication:

  • Bearer Token: Standard Firebase ID Token. Used by frontend clients acting on behalf of a user.
    Authorization: Bearer <ID_TOKEN>
  • API Key: Secret key for server-side integrations. Grants full access to the organization's resources.
    x-api-key: sk_...

API Reference

The IntakeDesk API provides endpoints for managing referrals, cases, patients, and documents. All endpoints require authentication.

Referrals

EndpointMethodDescription
/api/referrals?orgId=...GETList referrals for an organization.
/api/referralsPOSTCreate a new referral. Returns a signed URL for file upload.
/api/referrals/:idGETGet a single referral by ID.
/api/referrals/:id/uploadPOSTUpload an additional file to an existing referral.
/api/referrals/:id/processPOSTTrigger processing pipeline for a referral.
/api/referrals/:id/qaPOSTRun quality-assurance checks on extracted data.
/api/referrals/:id/triageGETGet current triage result for a referral.
/api/referrals/:id/triagePOSTSet or override triage classification.
/api/referrals/bulkPOSTPerform bulk actions (move to triaged, mark duplicate).
/api/referrals/export?orgId=...&stage=...GETExport referrals as CSV. Optional stage filter.

Cases

Cases are merged patient records created from one or more referrals. Use these endpoints to manage case lifecycle.

EndpointMethodDescription
/api/cases/:caseIdPATCHUpdate case fields (location, priority band, queue).
/api/cases/:caseId/contactPOSTLog a contact attempt, mark scheduled, close, or add a note.
/api/cases/match-referrerPOSTMatch a case to an existing practice/provider and add alias.
/api/cases/create-referrerPOSTCreate a new practice/provider from unmatched candidates.

Patients

EndpointMethodDescription
/api/patients?orgId=...&q=...GETSearch patients by name or ID.
/api/patientsPOSTCreate a new patient record.
/api/patientsPATCHUpdate an existing patient record.
/api/patientsDELETEDelete a patient record.

Documents

EndpointMethodDescription
/api/referral-documents?orgId=...GETList documents for a referral or patient.
/api/referral-documentsPOSTAttach a document to a referral/patient.
/api/referral-documents/sign-readPOSTGet a short-lived signed URL to read a document.
/api/referral-documents/update-statusPATCHUpdate the processing status of a document.

Authentication

Session management and user profile endpoints for frontend clients.

EndpointMethodDescription
/api/auth/meGETGet current authenticated user profile and org context.
/api/auth/sessionPOSTCreate a session cookie from a Firebase ID token.
/api/auth/sessionDELETEDestroy the current session (logout).

Dashboard & Reporting

Read-only endpoints for analytics, backlog monitoring, and operational metrics.

EndpointMethodDescription
/api/backlogGETBacklog statistics with aging buckets and status breakdown.
/api/dashboard/overview-statsGETKPI overview stats for the dashboard.
/api/metricsGETDetailed operational metrics.
/api/mixGETCase mix / referral-type distribution.

Organization Config

EndpointMethodDescription
/api/orgs/:id/configPATCHUpdate organization configuration settings.

API Keys (Management)

EndpointMethodDescription
/api/api-keysPOSTGenerate a new API Key (requires User Token).
/api/api-keysGETList active API Keys.
/api/api-keysDELETERevoke an API Key.

EMR Integration

Queue-based chart creation for external EMR systems (e.g., NextGen). Cases are queued manually or automatically, then an external service polls and reports results. The poll and callback endpoints use API key authentication (X-Api-Key header).

EndpointMethodDescription
/api/cases/:caseId/emr-queuePOSTManually queue a case for EMR chart creation. Auth: Bearer token.
/api/emr/queueGETPoll pending queue items for chart creation. Returns denormalized patient/case data. Auth: API key.
/api/emr/queue/callbackPOSTExternal service reports chart creation results (success/failed/error). Auth: API key.