Skip to main content
DELETE
/
patients
/
delete
/
{cpf}
Delete Patient
curl --request DELETE \
  --url https://api.example.com/patients/delete/{cpf}
{}
Deletes a patient from the system.

Path Parameters

cpf
string
required
The CPF of the patient to delete (11-digit Brazilian tax ID).

Response

Returns a text message indicating the deletion status.

Example Request

cURL
curl -X DELETE http://localhost:8080/patients/delete/12345678901

Example Response

200 OK
Paciente deletado com sucesso

Error Responses

{}
{
  "error": "Internal server error",
  "message": "An unexpected error occurred"
}

Notes

  • This operation is permanent and cannot be undone
  • Returns 404 if no patient exists with the provided CPF
  • Due to cascade delete settings, this will also remove all consultations associated with the patient
  • Consider implementing soft delete for production use to maintain data history
  • Ensure proper authorization is implemented before allowing patient deletion
This is a destructive operation. All patient data and associated consultations will be permanently removed from the system.

Build docs developers (and LLMs) love