1
votes

Microsoft Graph API's User entity has field "userType". According to documentation there is no any information about this. There is one line: "A string value that can be used to classify user types in your directory, such as “Member” and “Guest”. Supports $filter.". So there is no any limitations :-)

  1. Can be "userType" null? I can't PATCH existing user manually via graph api - graph api return an error. But on production we have some users, which have "userType": null
  2. Which values are valid for "userType"? Can you provide it in documentation or here please?
1
Here is also a same question with an answer: stackoverflow.com/questions/49340485/… - Baris Bikmaz

1 Answers

1
votes

According to your questions, I suppose you want to know the valid value of the field userType. we can refer to the content of User Entity.

For your first question, we can set the field userType to null, not " " or "null". When we create a user, the default value of this field will be Member if we didn't set it. We can patch existing user. Based on my test, we can modify it like this:

PATCH https://graph.microsoft.com/v1.0/users/{userid}

  {

            "displayName":  "XXX",

            "givenName": "XXXX",

            "jobTitle": "Marketing Director",

            "userType": "Guest"

 }

This will modify the user'userType from Member to Guest.

For your second question, according to the content of User Entity and the article of Azure AD User, the valid value for userType is "Member" and "Guest". Based on my test, it is sure that only these two values can be used.