Microsoft Graph - Create Access Package API gives 'InvalidModel' Error

Alessandro De Vitis 21 Reputation points
2021-11-29T14:30:34.57+00:00

I'm using the Microsoft Graph API for creating an access package (https://learn.microsoft.com/en-us/graph/api/accesspackage-post?view=graph-rest-beta&tabs=http). As the doc shows, I'm defining an access package object in the following way:

POST https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/accessPackages  
Content-type: application/json  
  
{  
"catalogId": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",  
"displayName": "myAccessPackageName",  
"description": "myDescription"  
}  

However, when I call the API, I get a response with error code 400 and the following message:

{'error': {'code': 'InvalidModel',  
           'innerError': {'client-request-id': 'xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',  
                          'date': '2021-11-29T14:04:58',  
                          'request-id': 'xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'},  
           'message': 'The model is invalid.'}}  

What am I missing?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,664 questions
0 comments No comments
{count} votes

Accepted answer
  1. JamesTran-MSFT 36,456 Reputation points Microsoft Employee
    2021-11-29T23:53:47.213+00:00

    @Alessandro De Vitis
    Thank you for your post!

    When it comes to running the Create accessPackage Graph API, can you try this within Graph Explorer and see if you're still running into the same error message? I was able to run this within my environment without any issues.

    153440-image.png

    If you're still running into issues, please let me know.
    Thank you for your time and patience throughout this issue.

    ----------

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments

0 additional answers

Sort by: Most helpful