How to Retrieve Assigned Licenses Per Subscription Using Microsoft Graph API?

28711978 0 Reputation points
2025-03-07T08:49:08.2466667+00:00

Question:

In the Microsoft Admin Portal, under Your Products, I can see the list of subscriptions along with details like assigned licenses, purchased licenses, and available licenses. If the same product is part of multiple subscriptions, it correctly displays them as separate subscriptions with their respective details.

However, when I call the Company Subscriptions API: 🔗 https://graph.microsoft.com/v1.0/directory/subscriptions/

I get the following response:

{
    "createdDateTime": "2024-09-XXTXX:XX:XXZ",
    "commerceSubscriptionId": "7e718d7f-xxxx-xxxx-xxxx-xxxxxxxx6ad1",
    "id": "8c6fe79e-fcf7-xxxx-xxxx-0eff31d6c2e6",
    "isTrial": false,
    "nextLifecycleDateTime": "2025-09-XXTXX:XX:XXZ",
    "skuId": "18181a46-0d4e-45cd-891e-60aabd171b4e",
    "skuPartNumber": "STANDARDPACK",
    "status": "Enabled",
    "totalLicenses": 20
}
{
    "createdDateTime": "2024-08-XXTXX:XX:XXZ",
    "commerceSubscriptionId": "55ce5e0c-80f2-xxxx-xxxx-8cbd7911cc70",
    "id": "c46a342f-c520-xxxx-xxxx-87f5c4e50a44",
    "isTrial": false,
    "nextLifecycleDateTime": "2025-08-XXTXX:XX:XXZ",
    "skuId": "18181a46-0d4e-45cd-891e-60aabd171b4e",
    "skuPartNumber": "STANDARDPACK",
    "status": "Enabled",
    "totalLicenses": 729
}

The issue is this API does not return assigned licenses or available licenses, which are visible in the Admin Portal.

Additionally, when I call the User License Details API:

"value": [
    {
        "id": "I02B9DU4h02n3FxxxxxxxqJMjIx6kH_WwjU",
        "skuId": "18181a46-0d4e-45cd-891e-60aabd171b4e",
        "skuPartNumber": "STANDARDPACK",
        "servicePlans": []
    }
]

This response also does not indicate which subscription a user’s assigned license is coming from, even when there are multiple subscriptions for the same SKU.

My Question:

Since the Admin Portal is displaying this data, Microsoft must be maintaining this information internally. How can we retrieve assigned licenses per subscription using the Microsoft Graph API? Is there any specific API endpoint that provides this data, or is there another way to achieve this?

Thank you!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,283 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yakun Huang-MSFT 10,555 Reputation points Microsoft External Staff
    2025-03-07T09:54:50.37+00:00

    Hello 28711978,

    Thank you for reaching out to Microsoft Support!

    You can get the details of the license through the List licenseDetails endpoint, but unfortunately Graph does not provide information about the license comes from.

    User's image

    we suggest that you can submit a feature request idea using this support link, which will be monitored by Microsoft team and make the enhancements to Microsoft Graph APIs.

    Reference document:

    https://learn.microsoft.com/en-us/graph/api/user-list-licensedetails?view=graph-rest-1.0&tabs=http

    https://learn.microsoft.com/en-us/graph/api/resources/licensedetails?view=graph-rest-1.0

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

  2. Rajat Vashistha-MSFT 1,310 Reputation points Microsoft External Staff
    2025-03-07T10:40:46.4033333+00:00

    Hi 28711978,

    Thanks for reaching out to Microsoft!

    To retrieve the consumed unit license and the total available license, you can use the following endpoint: GET https://graph.microsoft.com/v1.0/subscribedSkus

    List subscribedSkus

    User's image Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.