POST
/transactional-api/update-patient-telephone-numberUpdate Patient Telephone Number
Sets the patient's telephone number of the given type, removing any existing number 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-telephone-number' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"telephoneNumber": "07912 345678",
"telephoneNumberType": "mobile",
"preferredTelephoneNumberForSms": false,
"notes": ""
}'
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
patientId | string<uuid> | Yes | Medicus patient identifier. |
telephoneNumber | string | Yes | |
telephoneNumberType | enum | Yes | Which of the patient's telephone numbers to set. One of: home, temporary, work, mobile. |
preferredTelephoneNumberForSms | boolean | No | Whether this becomes the patient's preferred number for SMS. Unsets the flag on any other number. |
notes | string (nullable) | No |
Responses
200 Telephone number updated.
Response fields
| Field | Type | Description |
|---|---|---|
status | string |
{
"status": "ok"
}
400 Validation error.
5 possible code values
| Code | Description | When |
|---|---|---|
missing-patient-id | The patientId is required | patientId missing |
invalid-patient-id | The patientId is not valid | patientId not a valid UUID |
invalid-telephone-number | '' is not a valid telephone number. | telephoneNumber missing or not a recognisable telephone number |
invalid-telephone-number-type | The telephoneNumberType must be one of: home, temporary, work, mobile | telephoneNumberType missing or not one of home/temporary/work/mobile |
patient-not-found | Patient not found for this patientId | patientId doesn't exist |
Response fields
| Field | Type | Description |
|---|---|---|
errors[].code | string | |
errors[].description | string |
{
"errors": [
{
"code": "missing-patient-id",
"description": "The patientId is required"
}
]
}
403 The call is application-restricted rather than user-restricted.
Response fields
| Field | Type | Description |
|---|---|---|
errors[].code | string | |
errors[].description | string |
{
"errors": [
{
"code": "application-restricted-not-supported",
"description": "This endpoint is only available to user-restricted callers."
}
]
}