Check Subscription Type for MSA Users via Graph API

Phuc Phan 20 Reputation points
2024-12-21T06:29:18.4766667+00:00

I'm trying to determine whether a Microsoft 365 user is part of any subscription (e.g., Microsoft 365 Family or Personal) or if they have a completely free account using the Graph API.

I tried using the /v1.0/me/licenseDetails API, but it returns a 404 error. Is there another way to achieve this?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,658 questions
{count} votes

Accepted answer
  1. CarlZhao-MSFT 43,801 Reputation points
    2024-12-23T06:18:02.2566667+00:00

    Hi @Phuc Phan

    After my test, it works fine for organizational accounts. But for personal accounts, it always returns 404 error. Not sure if this is an issue with the API itself, because according to the documentation, it should support personal accounts.

    I suggest you open a support ticket with Microsoft support team to confirm the cause of the issue.

    Hope this helps.

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

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Saranya Madhu-MSFT 840 Reputation points Microsoft Vendor
    2024-12-23T04:23:25.2666667+00:00

    Hi @Phuc Phan ,

    Thanks for reaching out to Microsoft!

    As per documentation, the signed-in user must be assigned a supported Microsoft Entra role or a least privileged role.

    You can use Graph API to list the users and add select parameter to get the assigned licenses.

    GET https://graph.microsoft.com/v1.0/users?$select=id,mail,assignedLicenses

    To get the list of commercial subscriptions that an organization has acquired.

    GET https://graph.microsoft.com/v1.0/subscribedSkus

    Service plan ID for licensing.

    Hope this helps.

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


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.