Skip to main content
DELETE
https://app.medisync.me
/
api
/
recordings
/
{appointmentId}
Delete Recording
curl --request DELETE \
  --url https://app.medisync.me/api/recordings/{appointmentId} \
  --header 'Authorization: <authorization>'
{
  "success": true,
  "data": {
    "_id": "<string>",
    "appointment_id": "<string>",
    "recording_url": "<string>",
    "recording_key": "<string>",
    "createdAt": "<string>",
    "updatedAt": "<string>"
  },
  "error": "<string>"
}

Overview

Deletes a recording associated with a specific appointment ID. This operation removes both the recording file from storage and the database record permanently.
Permanent Deletion: This operation permanently deletes the recording file and cannot be undone. The recording will be removed from both cloud storage and the database.

Authentication

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

Path Parameters

appointmentId
string
required
The appointment ID whose recording should be deleted (MongoDB ObjectId)
65f8a1b2c3d4e5f6789012f3

Response

success
boolean
required
Indicates if the recording was deleted successfully
data
object
The deleted recording object
error
string
Error message if the deletion failed

Example Request

curl -X DELETE \
  'https://app.medisync.me/api/recordings/65f8a1b2c3d4e5f6789012f3' \
  -H 'Authorization: Bearer your_jwt_token_here'

Example Response

Success Response
{
  "success": true,
  "data": {
    "_id": "65f8a1b2c3d4e5f6789012f4",
    "appointment_id": "65f8a1b2c3d4e5f6789012f3",
    "recording_url": "https://storage.example.com/recordings/65f8a1b2c3d4e5f6789012f3_recording.wav",
    "recording_key": "65f8a1b2c3d4e5f6789012f3_recording.wav",
    "createdAt": "2024-03-18T10:30:00.000Z",
    "updatedAt": "2024-03-18T10:30:00.000Z"
  }
}
Error Response - Recording Not Found
{
  "success": false,
  "error": "Recording not found for appointment"
}
Error Response - Storage Deletion Failed
{
  "success": false,
  "error": "Failed to delete recording from storage"
}

Behavior Notes

  • Delete by Appointment: The endpoint finds and deletes recordings using the appointment ID
  • Two-Phase Deletion: First deletes the file from cloud storage, then removes the database record
  • Permanent Operation: The deletion is permanent and cannot be reversed
  • Real-time Updates: Emits socket events to notify connected clients of the deletion
  • Authentication Required: Requires valid JWT token for authorization

Use Cases

  1. Clean Up Old Recordings: Remove recordings that are no longer needed
  2. Privacy Compliance: Delete recordings upon patient request
  3. Storage Management: Free up storage space by removing old files
  4. Data Retention: Implement data retention policies by removing expired recordings