Forbidden 403: insufficient privilages to complete operations Graph API POST Create User

Taha Shahabuddin 21 Reputation points
2022-09-01T05:18:32.33+00:00

While trying to create a user using POST graph api https://graph.microsoft.com/v1.0/users

getting following error

"code": "Authorization_RequestDenied",
"message": "Insufficient privileges to complete the operation.",

even after having consent of all the following permissions
DeviceManagementApps.ReadWrite.All
Directory.ReadWrite.All
User.ReadWrite.All

Able to call the GET api https://graph.microsoft.com/v1.0/users

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,445 questions
0 comments No comments
{count} votes

Accepted answer
  1. Zehui Yao_MSFT 5,846 Reputation points
    2022-09-01T06:10:15.83+00:00

    Hi @Taha Shahabuddin , After my testing the cause of the problem may be
    The account you use to obtain a token through authentication is not an administrator account within the tenant
    Only the administrator account has permission to create new users, you can go to the AD portal to set the currently logged in user as a global administrator and regain the token.
    236767-untitled.png
    Hope this helps you and I wish you all the best.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful