Skip to main content
DELETE
/
api
/
doctors
/
:id
curl -X DELETE "https://api.saludya.com/api/doctors/doc_8x9y2z3a4b5c6d7e" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "success": true,
  "message": "Doctor successfully deleted",
  "deleted_id": "doc_8x9y2z3a4b5c6d7e",
  "deleted_at": "2024-03-06T17:30:00Z"
}

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DUVAN100/saludya-api/llms.txt

Use this file to discover all available pages before exploring further.

Path Parameters

id
string
required
Unique identifier of the doctor to delete (e.g., “doc_8x9y2z3a4b5c6d7e”)

Query Parameters

force
boolean
default:"false"
Force deletion even if the doctor has associated schedules or appointments.Warning: Setting this to true will also delete all related schedules and cancel all future appointments. Use with caution.
reassign_to
string
Doctor ID to reassign future appointments to. If provided, appointments will be transferred instead of cancelled.

Response

success
boolean
Indicates whether the deletion was successful
message
string
Confirmation message
deleted_id
string
ID of the deleted doctor
deleted_at
string
ISO 8601 timestamp of when the deletion occurred
reassigned_appointments
integer
Number of appointments reassigned to another doctor (only present when reassign_to is used)
cancelled_appointments
integer
Number of appointments that were cancelled (only present when force=true)
curl -X DELETE "https://api.saludya.com/api/doctors/doc_8x9y2z3a4b5c6d7e" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "success": true,
  "message": "Doctor successfully deleted",
  "deleted_id": "doc_8x9y2z3a4b5c6d7e",
  "deleted_at": "2024-03-06T17:30:00Z"
}

Deletion Behavior

Default Deletion

By default, the API will not allow deletion if:
  • The doctor has any upcoming appointments
  • The doctor has active schedules
  • The doctor has any associated records

Force Deletion (force=true)

When force deletion is enabled:
  1. All associated schedules are deleted
  2. All future appointments are cancelled
  3. Past appointment records are preserved for historical purposes
  4. Patients with cancelled appointments should be notified

Reassignment (reassign_to)

When reassigning appointments:
  1. Only future appointments are reassigned
  2. The target doctor must have the same or compatible specialty
  3. Appointments are reassigned to available time slots
  4. If no compatible slots exist, the operation fails
  5. Patients should be notified of the doctor change

Important Warnings

Permanent Action: Deleting a doctor is a permanent action and cannot be undone. Make sure you have backed up any necessary data before proceeding.
Patient Impact: Deleting a doctor with active appointments will affect patients. Always use the reassign_to parameter when possible to minimize disruption.
Compliance: Ensure deletion complies with data retention policies and medical record regulations in your jurisdiction.

Best Practices

  1. Check for appointments first - Use Get Doctor with include=appointments to see what will be affected
  2. Prefer reassignment - Use reassign_to instead of cancelling appointments when possible
  3. Archive instead of delete - Consider marking the doctor as unavailable using Update Doctor instead of deletion
  4. Notify patients - Always notify affected patients when appointments are cancelled or reassigned

Build docs developers (and LLMs) love