Edit

Share via


Delete assignment

Namespace: microsoft.graph.cloudLicensing

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Delete an assignment object.

Permissions

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 delete an assignment for an admin:

DELETE /admin/cloudLicensing/assignments/{assignmentId}
DELETE /admin/cloudLicensing/allotments/{allotmentId}/assignments/{assignmentId}
Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) CloudLicensing.AssignLicenses CloudLicensing.AssignLicenses.Organization, Directory.ReadWrite.All
Delegated (personal Microsoft account) Not supported. Not supported.
Application CloudLicensing.AssignLicenses.Organization Directory.ReadWrite.All

Permissions to delete an assignment for a user:

DELETE /me/cloudLicensing/assignments/{assignmentId}
DELETE /users/{userId}/cloudLicensing/assignments/{assignmentId}
Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) User-CloudLicensing.AssignLicenses User-CloudLicensing.AssignLicenses.Organization, User.ReadWrite.All, Directory.ReadWrite.All
Delegated (personal Microsoft account) Not supported. Not supported.
Application User-CloudLicensing.AssignLicenses.Organization User.ReadWrite.All, Directory.ReadWrite.All

Permissions to delete an assignment for a group:

DELETE /groups/{groupId}/cloudLicensing/assignments/{assignmentId}
Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Group-CloudLicensing.AssignLicenses Group-CloudLicensing.AssignLicenses.Organization, Group.ReadWrite.All, Directory.ReadWrite.All
Delegated (personal Microsoft account) Not supported. Not supported.
Application Group-CloudLicensing.AssignLicenses.Organization Group.ReadWrite.All, Directory.ReadWrite.All

HTTP request

To delete an assignment for the signed-in user using delegated (/me) permissions:

DELETE /me/cloudLicensing/assignments/{assignmentId}

To delete an assignment using either delegated or application permissions:

DELETE /admin/cloudLicensing/assignments/{assignmentId}
DELETE /admin/cloudLicensing/allotments/{allotmentId}/assignments/{assignmentId}
DELETE /groups/{groupId}/cloudLicensing/assignments/{assignmentId}
DELETE /users/{userId}/cloudLicensing/assignments/{assignmentId}

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 204 No Content response code.

Examples

Request

The following example shows a request.

DELETE https://graph.microsoft.com/beta/admin/cloudLicensing/assignments/0b1a424d-3b9b-4446-80b9-6917dd521e03

Response

The following example shows the response.

HTTP/1.1 204 No Content