Skip to main content
PUT
/
patients
/
{id}
curl -X PUT /patients/65f8a1b2c3d4e5f6789012ab?uid=doctor_uid_123 \
  -H "Authorization: Bearer your_jwt_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "medicalHistory": "Updated medical history with recent diagnosis",
    "currentMedications": "Lisinopril 10mg daily",
    "contact": {
      "phone": "+1234567891"
    }
  }'
{
  "success": true,
  "data": {
    "_id": "65f8a1b2c3d4e5f6789012ab",
    "doctor_id": "doctor_uid_123",
    "firstName": "John",
    "lastName": "Doe",
    "dateOfBirth": "1985-06-15",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "zipCode": "10001"
    },
    "insurance": {
      "provider": "Blue Cross",
      "policyNumber": "BC123456"
    },
    "medicalHistory": "Updated medical history with recent diagnosis",
    "currentMedications": "Lisinopril 10mg daily",
    "contact": {
      "phone": "+1234567891",
      "email": "[email protected]"
    }
  }
}

Overview

Updates an existing patient with new information. Only the fields provided in the request body will be updated; other fields will remain unchanged. The patient must belong to the requesting doctor.

Authentication

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

Path Parameters

id
string
required
Patient identifier (ObjectId format)

Query Parameters

uid
string
required
Doctor’s user ID (for verification that the patient belongs to this doctor)

Body Parameters

firstName
string
Patient’s first name
lastName
string
Patient’s last name
dateOfBirth
string
Patient’s date of birth
address
object
Patient’s address information (merged with existing data)
insurance
object
Patient’s insurance information (merged with existing data)
medicalHistory
string
Patient’s medical history
currentMedications
string
Patient’s current medications
contact
object
Patient’s contact information (merged with existing data)

Response

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

Example Request

curl -X PUT /patients/65f8a1b2c3d4e5f6789012ab?uid=doctor_uid_123 \
  -H "Authorization: Bearer your_jwt_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "medicalHistory": "Updated medical history with recent diagnosis",
    "currentMedications": "Lisinopril 10mg daily",
    "contact": {
      "phone": "+1234567891"
    }
  }'

Example Response

{
  "success": true,
  "data": {
    "_id": "65f8a1b2c3d4e5f6789012ab",
    "doctor_id": "doctor_uid_123",
    "firstName": "John",
    "lastName": "Doe",
    "dateOfBirth": "1985-06-15",
    "address": {
      "street": "123 Main St",
      "city": "New York",
      "state": "NY",
      "zipCode": "10001"
    },
    "insurance": {
      "provider": "Blue Cross",
      "policyNumber": "BC123456"
    },
    "medicalHistory": "Updated medical history with recent diagnosis",
    "currentMedications": "Lisinopril 10mg daily",
    "contact": {
      "phone": "+1234567891",
      "email": "[email protected]"
    }
  }
}

Error Responses

{
  "success": false,
  "error": "Patient not found"
}
{
  "success": false,
  "error": "Failed to update patient"
}