This article provides guidance for troubleshooting a "403 Authorization_RequestDenied" error that occurs when you try to add a user to a group by using the Microsoft Graph API.
Symptoms
When you try to add a user to a group by using Microsoft Graph API, you receive the following "403" error message:
{
"error": {
"code": "Authorization_RequestDenied",
"message": "Insufficient privileges to complete the operation.",
"innerError": {
"date": "2024-05-07T15:39:39",
"request-id": "aa324f0f-b4a3-4af6-9c4f-996e195xxxx",
"client-request-id": "aa324f0f-b4a3-4af6-9c4f-996e1959074e"
}
}
}
Cause
This issue occurs if the group that you tried to add the user to can't be managed by Microsoft Graph. Microsoft Graph supports only Microsoft 365 groups and Security groups.
Solution
Step 1: Check the group type
Make sure that the group you trying to modify is supported by Microsoft Graph.
-
In Microsoft Graph, the group type can be determined by the settings of its
groupTypes,mailEnabled, andsecurityEnabledproperties. Use the Microsoft Graph Explorer to check the group's attributes:https://graph.microsoft.com/v1.0/groups/<Group Object ID>?$select=displayName,groupTypes,mailEnabled,securityEnableExample response:
{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups(displayName,groupTypes,mailEnabled,securityEnabled)/$entity", "displayName": "Test group A", "groupTypes": [], "mailEnabled": true, "securityEnabled": false } -
Review the following table to verify that the group type is supported by Microsoft Graph API. In the example response, the "Test group A" group is a Distribution group that can't be supported by Microsoft Graph. For more information, see Working with groups in Microsoft Graph.
Type groupTypes mailEnabled securityEnabled Can be managed by using Microsoft Graph APIs Microsoft 365 groups ["Unified"]truetrueorfalseYes Security groups []falsetrueYes Mail-enabled security groups []truetrueNo; read-only through Microsoft Graph Distribution groups []truefalseNo; read-only through Microsoft Graph [!NOTE]
- Group type can't be changed after creation. For more information, see Edit group settings.
- The membership of a dynamic group (groupTypes contains "DynamicMembership") can't be managed through Microsoft Graph.
Step 2: Verify required permissions
Different group member types require specific permissions. For user-type membership, make sure that the application or account that performs the operation has the GroupMember.ReadWrite.All permission.
For detailed permission requirements, see Add members documentation.
Step 3: Check whether the group is a role-assignable group
-
Role-assignable groups require extra permissions to manage their members. You can verify that the group is role-assignable by using Azure portal or Microsoft Graph Explorer:
Azure portal
- In the Azure portal, go to Microsoft Entra ID, select Groups, and then select All groups.
- Locate the target group, select Properties, and then check whether Microsoft Entra role can be assigned to the group is set to Yes.
Microsoft Graph Explorer
To check the
isAssignableToRolesvalue, run the following request:GET https://graph.microsoft.com/v1.0/groups/<group object="" id="">?$select=displayName,groupTypes,mailEnabled,securityEnabled,isAssignableToRoleExample response:
{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups(displayName,groupTypes,mailEnabled,securityEnabled,isAssignableToRole)/$entity", "displayName": "Test group B", "groupTypes": [], "mailEnabled": false, "securityEnabled": true, "isAssignableToRole": true } -
If the group is role-assignable, you need the
RoleManagement.ReadWrite.Directorypermission in addition toGroupMember.ReadWrite.All. For more information, see Add members documentation.
Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors (upstream author metadata: bachoang). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
