Yes, there is, although it is not well documented ...
# general
c
Yes, there is, although it is not well documented 😦 The API endpoint is /admin/invite. It is only available to users who are project administrators (can be either human users or ClientApplications for pure API use). The expected input is a JSON object with the following properties: * resourceType - in your case, this would be a patient * firstName, lastName, email The API will create a user account. It will search for an existing Patient resource with the specified email. If a Patient is found, it connects the new user to the existing Patient. If a Patient is not found, it will create a new Patient resource. This unit test might be helpful: https://github.com/medplum/medplum/blob/main/packages/server/src/admin/invite.test.ts#L38-L69 By default, the invite operation will send a system generated invite email with instructions for setting up password, etc. You can prevent that behavior by including
"sendEmail": false
. Like I said, this is not well documented, and is an area where we want to invest more (more options for customizing email messages, etc). Hopefully this is helpful for getting started. Let us know if there's anything we can do to help!
183 Views