Overview
The Nestmed API enables you to build two types of integration clients that work in concert: EMR clients that push scheduling data into Nestmed, and application clients that capture clinical artifacts during visits. This architecture creates a complete documentation pipeline from your existing systems through to AI-generated clinical records.Integration Architecture
EMR Clients
Your EMR integration pushes foundational data into Nestmed:- Patients: Demographics, medical history, insurance information
- Episodes: Care periods from admission through discharge
- Visits: Scheduled encounters with assigned clinicians
- Documents: Admission files, care plans, prior assessments
Application Clients
Nestmed mobile applications and custom clients consume this scheduling data and capture:- Audio recordings: Ambient conversations during patient encounters
- Clinical images: Wounds, medications, home environment
- Manual entries: Vital signs, assessment results, interventions performed
Getting Started
Tenant Configuration
Every Nestmed integration requires a unique tenant identifier. Your organization will be provisioned with atenantId during onboarding, which becomes part of your API base URL. This tenant-based architecture ensures complete data isolation and enables custom configurations per organization.
Base URL
{tenantId} with your organization’s identifier. For example, if your tenant ID is acme-health, your base URL would be:
Authentication
All requests require OAuth 2.0 bearer tokens:Data Model & Hierarchy
Multi-Tenant Architecture
Core Entities
Episodes
Represent complete care periods from admission to discharge. All visits and documentation are scoped to an episode, maintaining clinical continuity across the care journey.Visits
Scheduled clinical encounters that serve as containers for all documentation. Visits transition through states:scheduled → in_progress → completed.
Media Processing
Audio and images uploaded during visits trigger asynchronous AI processing:- Upload media via multipart/form-data
- Receive task ID for tracking
- Poll task status or receive webhook on completion
- Retrieve processed derivatives (transcripts, extracts, captions)
Clinical Documentation Architecture
Forms
Forms are the foundation of Nestmed’s documentation system—flexible JSON schemas that capture any type of clinical data. Each form defines a question with a specific response schema that can include simple selections, multi-select arrays, and complex conditional logic where answers trigger follow-up questions. For example, an infectious disease screening form might start with a yes/no question: “Have you tested positive for any infectious disease in the past 2 weeks?” If the answer is “Yes”, the form dynamically reveals a multi-select list of diseases (COVID-19, C-diff, Influenza, etc.), and selecting “Other” triggers another field for specification. This conditional branching can go multiple levels deep, creating sophisticated documentation trees from simple JSON definitions. The response to a form submission follows the exact structure defined in the schema. Using our infectious disease example:Medications
The medications module tracks the complete medication lifecycle with intelligent reconciliation across multiple sources. When medications appear in admission packets, are verbally confirmed during visits, or captured in photos, the system reconciles these into a unified medication list. Each medication maintains usage status (active/discontinued), dosing schedules, and financial responsibility for billing compliance. The clinician-reviewed flag ensures that once a provider confirms a medication, it remains in the record with appropriate versioning. The module also documents medication education: whether the patient understands the purpose, directions for use, and potential side effects.Interventions
Interventions document skilled clinical actions as paired intervention-goal relationships. Each entry tracks whether the intervention was provided, captures implementation details, and assesses if the associated goal was met. When interventions aren’t provided or goals aren’t achieved, the system requires selection from a standardized list of exception reasons—from clinical factors like cognitive barriers to operational issues like equipment availability. Agencies maintain libraries of standard interventions with pre-configured goals, ensuring consistent documentation while supporting individualized care.Patient Goals
Patient goals capture what matters most to the individual receiving care, distinct from clinical intervention goals. These document the collaborative planning process between patients and clinicians, whether the goal is maintaining independence, managing symptoms, or achieving functional milestones. Each goal includes the goal statement plus contextual comments about barriers and progress indicators. The clinician review flag ensures AI-suggested goals are validated before becoming part of the official care plan, creating a narrative thread that connects individual visits to the patient’s broader health journey.Implementation Patterns
EMR Integration Flow
Application Client Flow
Processing & Task Management
Asynchronous Operations
Long-running operations like audio processing, image analysis, and bulk data imports operate asynchronously to maintain API responsiveness. When you upload media or initiate complex processing, the API immediately returns a task ID that serves as your handle for monitoring progress. Tasks transition through states frompending to processing to completed or failed, with detailed progress information available at each stage. The task system supports automatic retries for transient failures, maintains processing logs for debugging, and can trigger webhook notifications upon completion to enable event-driven architectures.
Media processing and bulk operations return task IDs for tracking:
Response Format
Consistent structure across all endpoints:Error Responses
Rate Limiting
- Standard tier: 100 requests/second per API key
- Bulk operations: 10 concurrent operations
- Media uploads: 50 MB max file size, 100 uploads/minute

