Skip to main content

Setup

Put them in your environment or .env; Data APIs covers the other ways.

Notes

  • Calls act as the signed-in user behind the refresh token (delegated permissions): besides the app’s consented Graph permissions, that user needs an Entra role that can read the data (e.g. Global Reader or Reports Reader for reports and sign-ins).
  • Lists page with @odata.nextLink: call that full URL for the next page; $skip is not supported on directory objects.
  • Advanced queries ($search, $count, most $filter/$orderby on users, groups and members) need the ConsistencyLevel: eventual header and $count=true.
  • Usage reports answer 302 to a short-lived pre-signed CSV download, not JSON.
  • Throttled requests get 429 with a Retry-After header.

Endpoints

List users

Get a user

List a user’s licences

List groups

List group members

  • Not transitive: nested groups’ members are not expanded.

List licence subscriptions

Get Microsoft 365 active user detail

  • Answers 302 to a pre-signed CSV URL valid for a few minutes. Needs Reports.Read.All.

List sign-ins

  • Only events within Entra ID’s retention period are available. Needs AuditLog.Read.All.