Title: `InvalidModel` when updating Access Package Assignment Policy · Issue #1258 · microsoftgraph/msgraph-sdk-python · GitHub
Open Graph Title: `InvalidModel` when updating Access Package Assignment Policy · Issue #1258 · microsoftgraph/msgraph-sdk-python
X Title: `InvalidModel` when updating Access Package Assignment Policy · Issue #1258 · microsoftgraph/msgraph-sdk-python
Description: Describe the bug I want to update an access package assignment policy, but whenever the policy includes the requirement for approval (i.e. is_approval_required_for_add=True), this fails with an InvalidModel error. Example: If I set the p...
Open Graph Description: Describe the bug I want to update an access package assignment policy, but whenever the policy includes the requirement for approval (i.e. is_approval_required_for_add=True), this fails with an Inv...
X Description: Describe the bug I want to update an access package assignment policy, but whenever the policy includes the requirement for approval (i.e. is_approval_required_for_add=True), this fails with an Inv...
Opengraph URL: https://github.com/microsoftgraph/msgraph-sdk-python/issues/1258
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`InvalidModel` when updating Access Package Assignment Policy","articleBody":"### Describe the bug\n\nI want to update an access package assignment policy, but whenever the policy includes the requirement for approval (i.e. `is_approval_required_for_add=True`), this fails with an `InvalidModel` error. \n\n**Example**:\nIf I set the property for \"requires approval\" to false, I am able to retrieve an existing access package policy by ID and update a certain property (e.g. the duration) successfully: \n\n```\n\n# Retrieve the pre-existing access package assignment policy:\nap_assignment_policy_obj = await graph_client.identity_governance.entitlement_management.assignment_policies.by_access_package_assignment_policy_id(\u003cap_pol_id\u003e).get()\n\n# Set the required duration in ISO 8601 duration format:\nap_assignment_policy_obj.expiration.duration = \"PT4H\"\n \n# Update the access package assignment policy:\nresult = await graph_client.identity_governance.entitlement_management.assignment_policies.by_access_package_assignment_policy_id(\u003cap_pol_id\u003e).put(ap_assignment_policy_obj)\n\n```\n\nHowever as soon as \"requires approval\" is set to true (and the associated approval groups etc. are set), I am no longer able to update an existing access package assignment policy. Instead, the following error is encountered:\n\n```\nmsgraph.generated.models.o_data_errors.o_data_error.ODataError: \nAPIError\nCode: 400\nmessage: None\nerror: MainError(additional_data={}, code='InvalidModel', details=[], inner_error=InnerError(additional_data={}, client_request_id='', date=datetime.datetime(2025, 6, 12, 12, 57, 48), odata_type=None, request_id=''), message='The model is invalid.', target=None)\n```\n\n\n### Expected behavior\n\nRegardless of whether or not approval is required (as dictated by the property `is_approval_required_for_add`), the access package policy update should work.\n\n### How to reproduce\n\n1. Create an access package assignment policy\n2. Set \"requires approval\" to true, and fill in the required properties\n3. Try to update the access package assignment policy\n\n### SDK Version\n\n1.33.0\n\n### Latest version known to work for scenario above?\n\n_No response_\n\n### Known Workarounds\n\n_No response_\n\n### Debug output\n\n\u003cdetails\u003e\u003csummary\u003eClick to expand log\u003c/summary\u003e\n\n```\n\nmsgraph.generated.models.o_data_errors.o_data_error.ODataError: \nAPIError\nCode: 400\nmessage: None\nerror: MainError(additional_data={}, code='InvalidModel', details=[], inner_error=InnerError(additional_data={}, client_request_id='', date=datetime.datetime(2025, 6, 12, 12, 57, 48), odata_type=None, request_id=''), message='The model is invalid.', target=None)\n\n```\n\u003c/details\u003e\n\n\n### Configuration\n\n_No response_\n\n### Other information\n\nAn example of the approval settings that can be used to generate this error is shown below:\n\n``` \n\nfrom msgraph.generated.models.access_package_assignment_approval_settings import AccessPackageAssignmentApprovalSettings\nfrom msgraph.generated.models.access_package_approval_stage import AccessPackageApprovalStage\n\nap_assignment_policy_obj. request_approval_settings = AccessPackageAssignmentApprovalSettings(\n is_approval_required_for_add = True,\n is_approval_required_for_update = False,\n is_requestor_justification_required = True,\n stages = [\n AccessPackageApprovalStage(\n duration_before_automatic_denial = datetime.timedelta(days=14), \n is_escalation_enabled = False,\n is_approver_justification_required = True,\n duration_before_escalation = datetime.timedelta(0),\n primary_approvers = [\n GroupMembers(\n odata_type = \"#microsoft.graph.groupMembers\",\n description = \"approver_group\"\n )\n ],\n fallback_primary_approvers = [],\n escalation_approvers = [],\n fallback_escalation_approvers = []\n )\n ]\n)\n```","author":{"url":"https://github.com/sandra-bee","@type":"Person","name":"sandra-bee"},"datePublished":"2025-06-12T13:19:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1258/msgraph-sdk-python/issues/1258"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fe34c1ac-316c-bc05-466a-1f5ce12dbe63 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D2CE:2D7E6:ECC76F:1442BE1:69693E70 |
| html-safe-nonce | b72b2154f9bff311b18d7366158bc2986f6e29d386c868afb634d75941a4ca60 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkNFOjJEN0U2OkVDQzc2RjoxNDQyQkUxOjY5NjkzRTcwIiwidmlzaXRvcl9pZCI6Ijc4MTE1NTQzMzc4MTk4MDMyNDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cae1fae9d972f359a49e467a5ca5c17de3e76f9ba1491dfd0c277067e08190d0 |
| hovercard-subject-tag | issue:3140266225 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoftgraph/msgraph-sdk-python/1258/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b5324fba75510f8fb8f029bd73996940fbf7251b19ed972fa668ddd958fae940/microsoftgraph/msgraph-sdk-python/issues/1258 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b5324fba75510f8fb8f029bd73996940fbf7251b19ed972fa668ddd958fae940/microsoftgraph/msgraph-sdk-python/issues/1258 |
| og:image:alt | Describe the bug I want to update an access package assignment policy, but whenever the policy includes the requirement for approval (i.e. is_approval_required_for_add=True), this fails with an Inv... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sandra-bee |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoftgraph/msgraph-sdk-python git https://github.com/microsoftgraph/msgraph-sdk-python.git |
| octolytics-dimension-user_id | 17304259 |
| octolytics-dimension-user_login | microsoftgraph |
| octolytics-dimension-repository_id | 534665999 |
| octolytics-dimension-repository_nwo | microsoftgraph/msgraph-sdk-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 534665999 |
| octolytics-dimension-repository_network_root_nwo | microsoftgraph/msgraph-sdk-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width