Skip to main content
PUT
https://app.medisync.me
/
api
/
transcriptions
/
update
/
{appointmentId}
Update Transcription
curl --request PUT \
  --url https://app.medisync.me/api/transcriptions/update/{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

Updates an existing transcription for a specific appointment. The transcription content is replaced with the new text provided, and the appointment status is automatically updated.
This endpoint finds the transcription by appointment ID and updates its content. The appointment status will be updated from “transcribing” to “processing” if applicable.

Authentication

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

Path Parameters

appointmentId
string
required
The appointment ID whose transcription should be updated (MongoDB ObjectId)
65f8a1b2c3d4e5f6789012f3

Body Parameters

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

Response

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

Example Request

curl -X PUT \
  'https://app.medisync.me/api/transcriptions/update/65f8a1b2c3d4e5f6789012f3' \
  -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. Updated with additional observations."
  }'

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. Updated with additional observations.",
    "createdAt": "2024-03-18T10:30:00.000Z",
    "updatedAt": "2024-03-18T11:15:00.000Z"
  }
}
Error Response - Transcription Not Found
{
  "success": false,
  "error": "Transcription not found for appointment"
}
Error Response - Database Error
{
  "success": false,
  "error": "Database error message"
}

Behavior Notes

  • Update by Appointment: The endpoint finds and updates transcriptions using the appointment ID
  • Complete Replacement: The transcription content is completely replaced with the new text
  • Automatic Processing: Updates appointment status from “transcribing” to “processing” if applicable
  • Real-time Updates: Emits socket events to notify connected clients of transcription and appointment updates
  • Authentication Required: Requires valid JWT token for authorization

Automatic Side Effects

  1. Appointment Status Update: Updates the appointment status from “transcribing” to “processing” if the current status is “transcribing”
  2. Socket Events: Emits real-time updates for both transcription changes and appointment status changes
  3. Timestamp Update: Automatically updates the updatedAt timestamp

Use Cases

  1. Transcription Corrections: Fix errors in automatically generated transcriptions
  2. Content Enhancement: Add additional details or clarifications to existing transcriptions
  3. Medical Review: Update transcriptions after medical professional review
  4. Reprocessing: Update transcription content after re-running speech-to-text processing