| title | Update assignment |
|---|---|
| description | Update an assignment object to enable or disable services. |
| author | patrick-starrin |
| ms.date | 07/18/2025 |
| ms.localizationpriority | medium |
| ms.subservice | cloud-licensing |
| doc_type | apiPageType |
Namespace: microsoft.graph.cloudLicensing
[!INCLUDE beta-disclaimer]
Update an assignment object to enable or disable services. Any service contained in its allotment which isn't listed in the disabledServicePlanIds array is enabled.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permissions to update an assignment for an admin:
PATCH /admin/cloudLicensing/assignments/{assignmentId}
PATCH /admin/cloudLicensing/allotments/{allotmentId}/assignments/{assignmentId}[!INCLUDE permissions-table]
Permissions to update an assignment for a user:
PATCH /me/cloudLicensing/allotments/{allotmentId}/assignments/{assignmentId}
PATCH /users/{userId}/cloudLicensing/assignments/{assignmentId}[!INCLUDE permissions-table]
Permissions to update an assignment for a group:
PATCH /groups/{groupId}/cloudLicensing/assignments/{assignmentId}[!INCLUDE permissions-table]
To update an assignment for the signed-in user using delegated (/me) permissions:
PATCH /me/cloudLicensing/allotments/{allotmentId}/assignments/{assignmentId}To update an assignment using either delegated or application permissions:
PATCH /admin/cloudLicensing/assignments/{assignmentId}
PATCH /admin/cloudLicensing/allotments/{allotmentId}/assignments/{assignmentId}
PATCH /groups/{groupId}/cloudLicensing/assignments/{assignmentId}
PATCH /users/{userId}/cloudLicensing/assignments/{assignmentId}| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
[!INCLUDE table-intro]
| Property | Type | Description |
|---|---|---|
| disabledServicePlanIds | GUID collection | The list of disabled service plans for this assignment. An empty list indicates that all services are enabled. Required. |
If successful, this method returns a 200 OK response code and an updated microsoft.graph.cloudLicensing.assignment object in the response body.
The following example shows a request.
PATCH https://graph.microsoft.com/beta/me/cloudLicensing/assignments/0b1a424d-3b9b-4446-80b9-6917dd521e03
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.cloudLicensing.assignment",
"disabledServicePlanIds": [
"bed136c6-b799-4462-824d-fc045d3a9d25"
],
"allotment@odata.bind": "https://graph.microsoft.com/beta/admin/cloudLicensing/allotments/rkocgef3dgjhnu3gmu2mqhbdbmwcymnf6fk3k6a7zbui5e7gfpmi",
"assignedTo@odata.bind": "https://graph.microsoft.com/beta/users/6d645c5f-089f-40d8-b0e7-136fb5c56d5b"
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.cloudLicensing.assignment",
"disabledServicePlanIds": [
"bed136c6-b799-4462-824d-fc045d3a9d25"
],
"id": "405ee855-dd74-f695-8d7e-be35a6788fe8"
}