Skip to main content
POST
https://app.medisync.me
/
api
/
transcriptions
/
add
/
{appointmentId}
Create Transcription
curl --request POST \
  --url https://app.medisync.me/api/transcriptions/add/{appointmentId} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "transcription": "<string>"
}
'
{
  "success": true,
  "data": {
    "_id": "<string>",
    "appointment_id": "<string>",
    "transcription": "<string>",
    "createdAt": "<string>",
    "updatedAt": "<string>"
  },
  "error": "<string>"
}

Overview

Creates a new transcription for a specific appointment. The transcription is automatically linked to the appointment and triggers the appointment status update and notes generation process.
Only one transcription can be created per appointment. If a transcription already exists for the appointment, the request will be rejected.

Authentication

Authorization
string
required
Bearer JWT token for authentication
Authorization: Bearer your_jwt_token_here

Path Parameters

appointmentId
string
required
The appointment ID to create a transcription for (MongoDB ObjectId)
65f8a1b2c3d4e5f6789012f3

Query Parameters

uid
string
required
Doctor’s user ID for authorization and notes generation

Body Parameters

transcription
string
required
The transcription text content
"Patient reports chest pain that started this morning. No shortness of breath. Vital signs stable."

Response

success
boolean
required
Indicates if the transcription was created successfully
data
object
The created transcription object
error
string
Error message if the creation failed

Example Request

curl -X POST \
  'https://app.medisync.me/api/transcriptions/add/65f8a1b2c3d4e5f6789012f3?uid=doctor123' \
  -H 'Authorization: Bearer your_jwt_token_here' \
  -H 'Content-Type: application/json' \
  -d '{
    "transcription": "Patient reports chest pain that started this morning. No shortness of breath. Vital signs stable."
  }'

Example Response

Success Response
{
  "success": true,
  "data": {
    "_id": "65f8a1b2c3d4e5f6789012f7",
    "appointment_id": "65f8a1b2c3d4e5f6789012f3",
    "transcription": "Patient reports chest pain that started this morning. No shortness of breath. Vital signs stable.",
    "createdAt": "2024-03-18T10:30:00.000Z",
    "updatedAt": "2024-03-18T10:30:00.000Z"
  }
}
Error Response - Transcription Already Exists
{
  "success": false,
  "error": "Transcription already exists"
}
Error Response - Database Error
{
  "success": false,
  "error": "Database error message"
}

Behavior Notes

  • Duplicate Prevention: Only one transcription per appointment is allowed
  • Automatic Processing: Creates transcription, updates appointment status from “transcribing” to “processing”, and triggers notes generation
  • Notes Generation: If uid and dashboard token are provided, automatically sends transcription to notes service for processing
  • Real-time Updates: Emits socket events to notify connected clients of transcription creation and appointment updates
  • Authentication Required: Requires valid JWT token and uid parameter

Automatic Side Effects

  1. Appointment Status Update: Updates the appointment status from “transcribing” to “processing”
  2. Notes Generation: Triggers automatic generation of clinical notes based on the transcription
  3. Socket Events: Emits real-time updates for both transcription creation and appointment status changes

Use Cases

  1. Medical Transcription: Store transcribed text from audio recordings of medical consultations
  2. AI Processing Results: Save the output from automatic speech-to-text processing
  3. Clinical Documentation: Create the foundation for generating structured clinical notes
  4. Appointment Workflow: Progress appointments through the transcription → notes generation pipeline