Skip to main content
PUT
/
patients
/
update
/
{cpf}
Update Patient
curl --request PUT \
  --url https://api.example.com/patients/update/{cpf} \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "dateOfBirth": "<string>",
  "address": "<string>",
  "medicalHistory": "<string>"
}
'
{}
Updates an existing patient’s information.

Path Parameters

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

Request Body

name
string
Updated patient name.
dateOfBirth
string
Updated date of birth in ISO 8601 format (YYYY-MM-DD).
address
string
Updated address (maximum 255 characters).
medicalHistory
string
Updated medical history notes.

Response

cpf
string
The patient’s CPF.
name
string
The updated patient name.
email
string
The patient’s email address (unchanged).
dateOfBirth
string
The updated date of birth.
address
string
The updated address.
medicalHistory
string
The updated medical history.

Example Request

cURL
curl -X PUT http://localhost:8080/patients/update/12345678901 \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Maria Silva Santos",
    "dateOfBirth": "1990-05-15",
    "address": "Rua Nova, 456, São Paulo, SP",
    "medicalHistory": "No known allergies. Previous surgery in 2015. Updated in 2026."
  }'

Example Response

200 OK
{
  "cpf": "12345678901",
  "name": "Maria Silva Santos",
  "email": "maria.silva@example.com",
  "dateOfBirth": "1990-05-15",
  "address": "Rua Nova, 456, São Paulo, SP",
  "medicalHistory": "No known allergies. Previous surgery in 2015. Updated in 2026."
}

Error Responses

{}
{
  "error": "Validation failed",
  "message": "Invalid date format for dateOfBirth"
}
{
  "error": "Internal server error",
  "message": "An unexpected error occurred"
}

Notes

  • The CPF in the URL path identifies which patient to update
  • Only the fields provided in the request body will be updated
  • Email and password cannot be updated through this endpoint
  • Returns 404 if no patient exists with the provided CPF
  • Date of birth must be in ISO 8601 format (YYYY-MM-DD)
  • All fields in the request body are optional - only send the fields you want to update

Build docs developers (and LLMs) love