Edit

Share via


Get usageRight

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.

Get the properties and relationships of a usageRight for a user or group.

Permissions

The following tables show the least privileged permission or permissions required to call this API on each supported resource type. Follow best practices to request least privileged permissions. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permissions to get a usageRight for a user:

GET /me/cloudLicensing/usageRights/{usageRightId}
GET /users/{userId}/cloudLicensing/usageRights/{usageRightId}
Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) User-UsageRight.Read User.Read, User.Read.All, User.ReadWrite, User.ReadWrite.All, Directory.Read.All, Directory.ReadWrite.All, User-CloudLicensing.Read.All, User-CloudLicensing.Read, User-UsageRight.Read.All, User-UsageRight.Read
Delegated (personal Microsoft account) Not supported. Not supported.
Application User-UsageRight.Read.All User.Read.All, User.ReadWrite.All, Directory.Read.All, Directory.ReadWrite.All, User-CloudLicensing.Read.All, User-UsageRight.Read.All

Permissions to get a usageRight for a group:

GET /groups/{groupId}/cloudLicensing/usageRights/{usageRightId}
Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Group-UsageRight.Read.All Directory.Read.All, Directory.ReadWrite.All, Group-CloudLicensing.Read, Group-CloudLicensing.Read.All, Group.Read.All, Group.ReadWrite.All, User.Read.All, User.ReadWrite.All
Delegated (personal Microsoft account) Not supported. Not supported.
Application Group-UsageRight.Read.All Directory.Read.All, Directory.ReadWrite.All, Group-CloudLicensing.Read.All, Group.Read.All, Group.ReadWrite.All, User.Read.All, User.ReadWrite.All

HTTP request

To get a usage right for the signed-in user using delegated (/me) permissions:

GET /me/cloudLicensing/usageRights/{usageRightId}

To get a usage right for a specific user or a group using either delegated or application permissions:

GET /users/{userId}/cloudLicensing/usageRights/{usageRightId}
GET /groups/{groupId}/cloudLicensing/usageRights/{usageRightId}

Optional query parameters

This method supports the $select OData query parameter to help customize the response. For general information, see OData query parameters.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a microsoft.graph.cloudLicensing.usageRight object in the response body.

Examples

Example 1: Get a usageRight for a user

The following example shows how to get a usage right for a user.

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/users/48fbdf70-9e09-40df-9dbe-17af483ab113/cloudLicensing/usageRights/i6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby3

Response

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.usageRight",
  "id": "i6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby3",
  "skuId": "639dec6b-bb19-468b-871c-c5c441c4b0cb",
  "skuPartNumber": "Microsoft_365_Copilot",
  "services": [
    {
      "@odata.type": "microsoft.graph.cloudLicensing.service",
      "assignableTo": "user,group",
      "planId": "fe6c28b3-d468-44ea-bbd0-a10a5167435c",
      "planName": "COPILOT_STUDIO_IN_COPILOT_FOR_M365"
    }
  ]
}

Example 2: Get a usageRight for a group

The following example shows how to get a usage right for a group.

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/groups/1003985b-dfc1-4f42-97d4-65f70a335ca8/cloudLicensing/usageRights/j6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby4

Response

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.usageRight",
  "id": "j6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby4",
  "skuId": "639dec6b-bb19-468b-871c-c5c441c4b0cb",
  "skuPartNumber": "Microsoft_365_Copilot",
  "services": [
    {
      "@odata.type": "microsoft.graph.cloudLicensing.service",
      "assignableTo": "user,group",
      "planId": "fe6c28b3-d468-44ea-bbd0-a10a5167435c",
      "planName": "COPILOT_STUDIO_IN_COPILOT_FOR_M365"
    }
  ]
}