Skip to main content

Welcome to MediSync API

MediSync provides powerful APIs for medical AI, transcription, and healthcare data management. This guide will walk you through setting up your first integration, from authentication to generating AI-powered clinical notes.

Prerequisites

Before you begin, ensure you have:
Sign up for a MediSync account at app.medisync.me. You’ll need:
  • Valid medical credentials
  • Professional email address
  • EHR system information
Some features require an active subscription. Check your subscription status in your dashboard or use the API:
GET /api/settings/subscription?uid={user_id}

Step 1: Authentication

Get Your Access Token

First, authenticate with your MediSync credentials to obtain a JWT token:
curl -X POST https://app.medisync.me/api/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "your_password",
    "remember": false
  }'
Response:
{
  "success": true,
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "uid": "user_123456",
  "userTitle": "Dr.",
  "firstName": "John",
  "lastName": "Doe"
}
Save the token and uid values - you’ll need them for all subsequent API calls.

Set Up Authorization

Include your JWT token in the Authorization header for all protected endpoints:
Authorization: Bearer YOUR_JWT_TOKEN

Step 2: Create Your First Patient

Before creating appointments, add a patient to your system:
curl -X POST https://app.medisync.me/api/patients/add?uid=YOUR_USER_ID \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Jane",
    "lastName": "Smith",
    "dateOfBirth": "1985-03-15",
    "address": {
      "street": "123 Main St",
      "city": "Berlin",
      "zipCode": "10115",
      "country": "Germany"
    },
    "insurance": {
      "provider": "AOK",
      "policyNumber": "123456789"
    },
    "contact": {
      "phone": "+49 30 12345678",
      "email": "[email protected]"
    }
  }'

Step 3: Schedule an Appointment

Create a new appointment for your patient:
curl -X POST https://app.medisync.me/api/appointments/add?uid=YOUR_USER_ID \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Annual Checkup",
    "date": "2024-01-15",
    "time": "14:30",
    "patient_id": "PATIENT_OBJECT_ID",
    "status": "planned",
    "language": "de",
    "notes_type": "soap_clinical_notes_de",
    "appointment_type": "in_person"
  }'
Response:
{
  "success": true,
  "appointment": {
    "_id": "appointment_123",
    "name": "Annual Checkup",
    "status": "planned",
    ...
  }
}

Step 4: Upload Audio Recording

Upload an audio file of the medical consultation:
curl -X POST https://app.medisync.me/api/recordings/add/APPOINTMENT_ID?uid=YOUR_USER_ID \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -F "audio=@consultation_recording.wav"
Supported formats: WAV (recommended), MP3, M4A
Max file size: 500MB
Quality: 16kHz, 16-bit recommended for best transcription results

Step 5: Get AI Transcription

Once the audio is processed, retrieve the transcription with speaker diarization:
curl -X GET https://app.medisync.me/api/transcriptions/APPOINTMENT_ID \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Response:
{
  "success": true,
  "transcription": [
    {
      "speaker": "SPEAKER_0",
      "text": "Hello, how are you feeling today?",
      "start_time": 0.0,
      "end_time": 3.5
    },
    {
      "speaker": "SPEAKER_1", 
      "text": "I've been having some chest pain recently.",
      "start_time": 4.0,
      "end_time": 7.2
    }
  ]
}

Step 6: Generate Clinical Notes

Let MediSync AI generate structured clinical notes from the transcription:
curl -X POST https://app.medisync.me/api/notes/add/APPOINTMENT_ID \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "notes": "Patient presents with chest pain...",
    "summary": "Brief summary of consultation"
  }'
Then retrieve the AI-enhanced notes:
curl -X GET https://app.medisync.me/api/notes/APPOINTMENT_ID \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Step 7: Get AI Diagnosis (Optional)

Generate AI-powered diagnosis suggestions with ICD-10 codes:
curl -X POST https://app.medisync.me/api/notes/diagnosis/APPOINTMENT_ID \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Live Transcription (Real-time)

For real-time transcription during consultations, connect to our WebSocket API:
const ws = new WebSocket('wss://speech.medisync.me/ws/transcribe', {
  headers: {
    'Authorization': 'Bearer YOUR_JWT_TOKEN'
  }
});

ws.on('message', (data) => {
  const message = JSON.parse(data);
  if (message.type === 'transcription') {
    console.log('Live transcription:', message.text);
  }
});

// Send audio chunks
ws.send(audioBuffer);

Error Handling

MediSync APIs use standard HTTP status codes and return structured error responses:
{
  "success": false,
  "error": "Invalid authentication token"
}

Common Status Codes

  • 401 - Unauthorized (invalid token)
  • 403 - Forbidden (subscription required)
  • 404 - Resource not found
  • 429 - Rate limit exceeded

Authentication Errors

  • Check token expiration
  • Verify Bearer format
  • Confirm user permissions
  • Validate subscription status

Next Steps

Now that you’ve completed the basic workflow, explore advanced features:

Support

Need help? We’re here to assist:
Join our developer community for updates, tips, and integration examples!