Medplum SCIM User Creation Issue
Problem Statement:
When attempting to create a Practitioner user through the Medplum SCIM API, the following error occurs:
{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
"status": "400",
"detail": "Missing defaultPatientAccessPolicy"
}
Request Used:
curl --location 'https://api.medplum.com/scim/v2/Users' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data-raw '{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User",
"urn:medplum:schemas:scim:2.0:User"
],
"userType": "Practitioner",
"name": {
"givenName": "Alice",
"familyName": "Smith"
},
"emails": [
{ "value": "alice.smith.test@example.com" }
],
"urn:medplum:schemas:scim:2.0:User": {
"accessPolicy": { "reference": "AccessPolicy/e5187428-2089-4089-9800-482000000000" },
"defaultPatientAccessPolicy": { "reference": "AccessPolicy/DEFAULT-PATIENT" }
}
}'
Error Message:
Missing defaultPatientAccessPolicy
Suggested Fix for Discovery Post:
I’m trying to add a new Practitioner user via the Medplum SCIM API, but I’m consistently getting the error ‘Missing defaultPatientAccessPolicy’. Below is the exact request and response. Can someone please confirm if the defaultPatientAccessPolicy must be manually created in the Medplum portal, or if there is a default value available for testing environments?
Also, please let me know the correct way to reference the AccessPolicy/DEFAULT-PATIENT resource while creating users through SCIM.