Skip to main content
POST/transactional-api/update-patient-email-address

Update Patient Email Address

Sets the patient's email address of the given type, removing any existing address of that type first. User-restricted only.

Authorization: Bearer token (JWT). See Authentication.

Request​

curl -L -X POST 'https://{tenantId}.api.england.medicus.health/transactional-api/update-patient-email-address' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"emailAddress": "patient@example.com",
"emailAddressType": "personal",
"preferredEmailAddress": false
}'

Body parameters

FieldTypeRequiredDescription
patientIdstring<uuid>YesMedicus patient identifier.
emailAddressstring<email>Yes
emailAddressTypeenumYesWhich of the patient's email addresses to set. One of: personal, work.
preferredEmailAddressbooleanNoWhether this becomes the patient's preferred email address. Unsets the flag on any other address.

Responses​

200 Email address updated.

Response fields

FieldTypeDescription
statusstring
{
"status": "ok"
}
400 Validation error.
5 possible code values
CodeDescriptionWhen
missing-patient-idThe patientId is requiredpatientId missing
invalid-patient-idThe patientId is not validpatientId not a valid UUID
invalid-email-addressThe emailAddress is not validemailAddress missing or not a valid email address
invalid-email-address-typeThe emailAddressType must be one of: personal, workemailAddressType missing or not one of personal/work
patient-not-foundPatient not found for this patientIdpatientId doesn't exist

Response fields

FieldTypeDescription
errors[].codestring
errors[].descriptionstring
{
"errors": [
{
"code": "missing-patient-id",
"description": "The patientId is required"
}
]
}
403 The call is application-restricted rather than user-restricted.

Response fields

FieldTypeDescription
errors[].codestring
errors[].descriptionstring
{
"errors": [
{
"code": "application-restricted-not-supported",
"description": "This endpoint is only available to user-restricted callers."
}
]
}