Skip to main content
POST
/
appointments
/
update
/
{id}
curl -X POST /appointments/update/65f8a1b2c3d4e5f6789012ef \
  -H "Authorization: Bearer your_jwt_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "finished",
    "notes": "Consultation completed successfully"
  }'
{
  "success": true,
  "data": {
    "_id": "65f8a1b2c3d4e5f6789012ef",
    "name": "General Consultation",
    "date": "2024-03-15",
    "time": "14:30",
    "recording_id": "rec_123",
    "recording_url": "https://storage.example.com/recording.mp3",
    "recording_key": "recordings/rec_123.mp3",
    "status": "finished",
    "doctor_id": "doctor_uid_123",
    "patient_id": "65f8a1b2c3d4e5f6789012ab",
    "notes": "Consultation completed successfully",
    "language": "de",
    "notes_type": "soap_clinical_notes_de",
    "appointment_type": "in_person"
  }
}

Overview

Updates an existing appointment with new information. Only the fields provided in the request body will be updated; other fields will remain unchanged.

Authentication

Authorization
string
required
Bearer token for authenticated access
Authorization: Bearer your_jwt_token_here

Path Parameters

id
string
required
Unique appointment identifier (ObjectId format)

Body Parameters

name
string
Appointment name/title
date
string
Appointment date
time
string
Appointment time
recording_id
string
Associated recording ID
recording_url
string
URL to the recording
recording_key
string
Recording storage key
status
string
Appointment status
  • planned - Scheduled appointment
  • recording - Audio uploaded or in progress
  • transcribing - Audio being processed
  • processing - AI generating notes
  • finished - Complete workflow
  • error - Processing failed
doctor_id
string
Doctor’s user ID
patient_id
string
Patient’s ID (will be converted to ObjectId format, or set to null if explicitly null)
notes
string
Appointment notes
language
string
Language code
notes_type
string
Type of notes
appointment_type
string
Type of appointment

Response

success
boolean
Whether the request was successful
data
object
The updated appointment object
error
string
Error message (only present when success is false)

Example Request

curl -X POST /appointments/update/65f8a1b2c3d4e5f6789012ef \
  -H "Authorization: Bearer your_jwt_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "finished",
    "notes": "Consultation completed successfully"
  }'

Example Response

{
  "success": true,
  "data": {
    "_id": "65f8a1b2c3d4e5f6789012ef",
    "name": "General Consultation",
    "date": "2024-03-15",
    "time": "14:30",
    "recording_id": "rec_123",
    "recording_url": "https://storage.example.com/recording.mp3",
    "recording_key": "recordings/rec_123.mp3",
    "status": "finished",
    "doctor_id": "doctor_uid_123",
    "patient_id": "65f8a1b2c3d4e5f6789012ab",
    "notes": "Consultation completed successfully",
    "language": "de",
    "notes_type": "soap_clinical_notes_de",
    "appointment_type": "in_person"
  }
}

Error Responses

{
  "success": false,
  "error": "Appointment not found"
}
{
  "success": false,
  "error": "Invalid patient_id format for update."
}
{
  "success": false,
  "error": "Error saving appointment"
}
{
  "success": false,
  "error": "Error finding appointment for update"
}