Skip to main content
POST
/
patients
/
add
curl -X POST /patients/add?uid=doctor_uid_123 \
  -H "Authorization: Bearer your_jwt_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "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": "No significant medical history",
    "currentMedications": "None",
    "contact": {
      "phone": "+1234567890",
      "email": "[email protected]"
    }
  }'
{
  "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": "No significant medical history",
    "currentMedications": "None",
    "contact": {
      "phone": "+1234567890",
      "email": "[email protected]"
    }
  }
}

Overview

Creates a new patient record with the specified details. The doctor ID is provided as a query parameter.

Authentication

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

Query Parameters

uid
string
required
Doctor’s user ID for the patient

Body Parameters

firstName
string
required
Patient’s first name
lastName
string
required
Patient’s last name
dateOfBirth
string
Patient’s date of birth
address
object
Patient’s address information
insurance
object
Patient’s insurance information
medicalHistory
string
Patient’s medical history
currentMedications
string
Patient’s current medications
contact
object
Patient’s contact information

Response

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

Example Request

curl -X POST /patients/add?uid=doctor_uid_123 \
  -H "Authorization: Bearer your_jwt_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "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": "No significant medical history",
    "currentMedications": "None",
    "contact": {
      "phone": "+1234567890",
      "email": "[email protected]"
    }
  }'

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": "No significant medical history",
    "currentMedications": "None",
    "contact": {
      "phone": "+1234567890",
      "email": "[email protected]"
    }
  }
}

Error Response

{
  "success": false,
  "error": "Failed to add patient"
}