The request must be POST, not GET one.
Why is assignLicense endpoint throwing "One or more properties of the user contains invalid values." using the Microsoft Graph API
I've created a Contoso tenant which has its own Users and Licenses. I tried using both the Graph Python SDK and normal HTTP requests and I get the same error every time, whether I assign or remove licenses.
In the following example where I try to remove an assigned license, I've checked many times that the license exists (it throws another error if it doesn't), that the license is assigned to the user (it throws another error when removing a license that the user does not have), and that the user is enabled.
Request:
POST https://graph.microsoft.com/v1.0/users/1d93d89f-fb4b-4861-8dad-b9b3a14359c7/assignLicense
{
"addLicenses": [],
"removeLicenses": [
"18a4bd3f-0b5b-4887-b04f-61dd0ee15f5e"
]
}
Response:
{
"error": {
"code": "Request_BadRequest",
"message": "One or more properties of the user contains invalid values.",
"innerError": {
"date": "2025-06-14T20:30:50",
"request-id": "6a9adf05-66ea-45f4-91e6-7f3cc62ed209",
"client-request-id": "6a9adf05-66ea-45f4-91e6-7f3cc62ed209"
}
}
}
I have the following permissions on my Azure App (I had the Least privileged but tried with Higher privileged, still same error)
I have not changed anything about the users on any portal or via API, all users are the default users provided when you create a Contoso tenant.
I've seen that some people get the same "One or more properties of the user contains invalid values." error when trying to create users, but I'm not doing nothing like that. From the admin portal I can remove and assign licenses freely and I've tried all combinations: remove/assign via api on fresh user, remove on admin panel and assign with api, assign on admin panel and remove with api... but I get the exact same error all the time.
Thanks!
Microsoft Graph
1 answer
Sort by: Most helpful
-
Vasil Michev 119.1K Reputation points MVP Volunteer Moderator
2025-06-15T06:05:37.6+00:00