Everything an AI agent can do with the Microsoft Entra ID API.

A reference guide for building AI agents: every method, how to authenticate, and the permissions each one needs.

Endpoints31
API versionv1.0
Last updated23 June 2026
Orientation

How the Microsoft Entra ID API works.

The Microsoft Entra ID API is how an app or AI agent works with an organization's directory: listing and creating users, adding and removing group members, registering applications, reading the sign-in logs, and assigning directory roles. Access is granted through an OAuth 2.0 token and a set of Graph permissions, where a delegated token is also bounded by the signed-in user's own roles and an app-only token applies across the tenant. Microsoft Entra ID can also push directory changes to a subscription instead of being polled.

31Endpoints
7Capability groups
16Read
15Write
13Permissions
Authentication
Microsoft Entra ID is reached through Microsoft Graph with an OAuth 2.0 bearer token. An app authenticates either as itself with application permissions, through the client credentials flow or a managed identity, for unattended work, or on behalf of a signed-in user with delegated permissions through the authorization code flow. There is no static API key. Most directory operations require administrator consent.
Permissions
Access is governed by Graph permissions, which come in two kinds. Delegated permissions, like User.Read.All or Group.ReadWrite.All, are bounded by both the granted scope and the signed-in user's own directory roles. Application permissions of the same names apply tenant-wide with no user. Many writes also require a specific Microsoft Entra role in delegated calls, like User Administrator to create a user, and granting an administrative directory role needs RoleManagement.ReadWrite.Directory.
Versioning
Microsoft Graph exposes Microsoft Entra ID through two named endpoints rather than dated version strings: the stable v1.0 used in production, and a separate beta endpoint for preview features that can change or be removed. New and changed methods are announced through a dated changelog, and breaking changes follow a published deprecation and retirement policy.
Data model
The API is resource-oriented JSON over HTTPS, served from graph.microsoft.com. Core directory objects, including user, group, application, servicePrincipal, and directoryRole, all inherit from directoryObject and are linked by navigation properties like a group's members or a service principal's appRoleAssignedTo. Sign-in and audit data live under auditLogs, and conditional access policies under identity/conditionalAccess. Graph can push object changes to a subscription instead of being polled.
Connect & authenticate

Connection & authentication methods.

How an app or AI agent connects to Microsoft Entra ID determines what it can reach. Access runs through Microsoft Graph, governed by an OAuth 2.0 token and the Graph permissions that token carries.

Ways to connect

Microsoft Graph REST API

Microsoft Entra ID is reached through Microsoft Graph at https://graph.microsoft.com. The stable endpoint is /v1.0 and a separate /beta endpoint carries preview features that should not be used in production. A call authenticates with an OAuth 2.0 bearer token.

Best forConnecting an app or AI agent to Microsoft Entra ID.
Governed byThe OAuth 2.0 token and the Graph permissions it carries.
Docs ↗

Change notifications (subscriptions)

An app creates a subscription on a resource like users or groups, and Microsoft Graph POSTs a lightweight notification to a registered URL when a matching object is created, updated, or deleted. The receiver validates a token Graph sends on setup and can request encrypted resource data.

Best forReceiving directory change events at an app or AI agent.
Governed byThe Graph permission for the subscribed resource and the validation token.
Docs ↗

Microsoft MCP Server for Enterprise (Model Context Protocol)

Microsoft's first-party MCP server at https://mcp.svc.cloud.microsoft/enterprise lets an AI agent query Microsoft Entra data in natural language. It is in public preview and covers read-only identity scenarios across users, groups, applications, and devices, exposing the tools microsoft_graph_suggest_queries, microsoft_graph_get, and microsoft_graph_list_properties. It honors the user's roles and the granted Graph scopes, and is limited to 100 calls per minute per user.

Best forConnecting an AI agent to Microsoft Entra ID through MCP.
Governed byThe user's roles and the OAuth scopes granted to the MCP client.
Docs ↗
Authentication

OAuth 2.0 client credentials (application permissions)

An app authenticates as itself with a client secret or certificate and acts with application permissions, which are app roles granted by an administrator and apply tenant-wide with no signed-in user. This is the route for unattended automation and background agents.

TokenApp-only bearer access token
Best forUnattended automation and background agents
Docs ↗

OAuth 2.0 authorization code (delegated permissions)

A user signs in and consents, and the app acts on their behalf with delegated permissions. The effective access is the overlap of the granted scope and what the signed-in user is allowed to do, so a delegated call is also bounded by the user's directory roles.

TokenDelegated bearer access token
Best forApps acting on behalf of a signed-in administrator
Docs ↗

Managed identity

An Azure-hosted workload gets an identity managed by the platform and acquires Graph tokens without a stored secret. It uses application permissions like the client credentials flow, with the credential handled by Azure rather than the app.

TokenApp-only bearer access token (no stored secret)
Best forAzure-hosted workloads avoiding stored secrets
Docs ↗
Capability map

What an AI agent can do in Microsoft Entra ID.

The Microsoft Entra ID API is split into areas an agent can act on, like users, groups, applications, service principals, directory roles, and sign-in logs. Each area has its own methods and its own Graph permissions, and writes in some areas change who can sign in or what they can reach.

Endpoint reference

Every Microsoft Entra ID API method.

Filter by method, access, or permission, or search any path. Select a row for version detail, rate limits, the related webhook event, and the source.

MethodEndpointWhat it doesAccessPermissionVersion

Users

List, read, create, update, and delete users in the directory.5

User.Read.All is the least-privilege permission to read every user's full profile; User.ReadBasic.All reads only a limited basic profile. Works as either a delegated permission (acting as a signed-in admin) or an application permission (acting as the app itself). A guest signed-in user cannot query the whole /users collection.

Acts onuser
Permission (capability)User.Read.All
VersionAvailable since the API’s base version
Webhook eventuser-changed
Rate limitStandard limits apply

A signed-in user reading their own profile needs only User.Read. Reading another user's full profile needs User.Read.All, delegated or application.

Acts onuser
Permission (capability)User.Read.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Creating a user needs User.ReadWrite.All. In a delegated call the signed-in user must also hold a Microsoft Entra role such as User Administrator.

Acts onuser
Permission (capability)User.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventuser-changed
Rate limitStandard limits apply

Some fields are sensitive, like accountEnabled, userPrincipalName, and passwordProfile, and only specific administrator roles can change them in a delegated call. A signed-in user updating their own basic profile needs only User.ReadWrite.

Acts onuser
Permission (capability)User.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventuser-changed
Rate limitStandard limits apply

A deleted user moves to the recycle bin and can be restored within 30 days. Deleting a user is a sensitive action restricted to specific administrator roles in delegated calls.

Acts onuser
Permission (capability)User.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventuser-changed
Rate limitStandard limits apply

Groups

List, read, create, update, and delete groups, and add, list, and remove their members.8

Group.Read.All reads every group. Delegated or application. A guest signed-in user cannot query the whole /groups collection.

Acts ongroup
Permission (capability)Group.Read.All
VersionAvailable since the API’s base version
Webhook eventgroup-changed
Rate limitStandard limits apply

Reads one group's properties. Delegated or application.

Acts ongroup
Permission (capability)Group.Read.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

All group-related writes need administrator consent. Dynamic membership rules need a Microsoft Entra ID P1 license per member.

Acts ongroup
Permission (capability)Group.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventgroup-changed
Rate limitStandard limits apply

The same PATCH on the group can add up to 20 members at once through members@odata.bind.

Acts ongroup
Permission (capability)Group.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventgroup-changed
Rate limitStandard limits apply

A deleted Microsoft 365 group can be restored within 30 days; security groups are removed permanently.

Acts ongroup
Permission (capability)Group.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventgroup-changed
Rate limitStandard limits apply

GroupMember.Read.All is the least-privilege permission to read membership; Group.Read.All also works. Delegated or application.

Acts ongroup member
Permission (capability)GroupMember.Read.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Adding a service principal member also needs Application.ReadWrite.All; adding a member to a role-assignable group also needs RoleManagement.ReadWrite.Directory. Up to 20 members can be added in one request through the PATCH form.

Acts ongroup member
Permission (capability)GroupMember.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventgroup-changed
Rate limitStandard limits apply

Removing a member can revoke that principal's access to resources the group grants.

Acts ongroup member
Permission (capability)GroupMember.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventgroup-changed
Rate limitStandard limits apply

Applications

List, read, create, update, and delete the app registrations in the directory.5

Reads the app registrations. Delegated or application.

Acts onapplication
Permission (capability)Application.Read.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

The appId property is a supported alternate key, so an app can also be addressed by its application (client) ID.

Acts onapplication
Permission (capability)Application.Read.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Registering an app defines what it can request and how it authenticates, so this write is sensitive.

Acts onapplication
Permission (capability)Application.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Changing requiredResourceAccess here changes which permissions the app asks for.

Acts onapplication
Permission (capability)Application.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

A deleted application can be restored within 30 days from the directory recycle bin.

Acts onapplication
Permission (capability)Application.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Service principals

List, read, and create service principals, and list and grant app role assignments on them.5

A service principal is the local instance of an application or managed identity in this tenant. Delegated or application.

Acts onservice principal
Permission (capability)Application.Read.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Can also be addressed by appId as an alternate key.

Acts onservice principal
Permission (capability)Application.Read.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Creating a service principal makes an application usable in this tenant.

Acts onservice principal
Permission (capability)Application.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Shows who has been granted access to this app or service. Delegated or application.

Acts onapp role assignment
Permission (capability)Application.Read.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Also needs Application.Read.All. Granting an app role to a service principal is how application permissions are granted, so this write can give an app broad access to the directory.

Acts onapp role assignment
Permission (capability)AppRoleAssignment.ReadWrite.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Directory roles

List and read activated directory roles, list their members, and add a member to a role.4

Only activated roles are listed; a role must be activated from its template before it can be read or have members. Delegated or application.

Acts ondirectory role
Permission (capability)RoleManagement.Read.Directory
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Shows which users hold an administrative role, like Global Administrator. Delegated or application.

Acts ondirectory role
Permission (capability)RoleManagement.Read.Directory
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Adding a member grants that user the role's administrative privileges over the directory. Microsoft recommends the unified RBAC API for new work.

Acts ondirectory role
Permission (capability)RoleManagement.ReadWrite.Directory
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Only the Company Administrators role is active by default; other roles must be activated with the roleTemplateId before they can be read or assigned.

Acts ondirectory role
Permission (capability)RoleManagement.ReadWrite.Directory
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Sign-in & audit logs

Read the sign-in logs and the directory audit logs for the tenant.2

AuditLog.Read.All is the only supported permission, delegated or application. Reading the applied conditional access policies on a sign-in also needs Policy.Read.All. Only events within the default retention window are returned, and a time-range $filter is recommended.

Acts onsign-in
Permission (capability)AuditLog.Read.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Records directory changes like role assignments and group edits. Delegated or application; AuditLog.Read.All.

Acts onaudit event
Permission (capability)AuditLog.Read.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Conditional access policies

List and read the conditional access policies configured in the tenant.2

Policy.Read.All is the least-privilege permission, delegated or application. These policies decide who can sign in and under what conditions, like requiring multifactor authentication.

Acts onconditional access policy
Permission (capability)Policy.Read.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Reads one policy's full conditions and grant controls. Delegated or application.

Acts onconditional access policy
Permission (capability)Policy.Read.All
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply
No endpoints match those filters.
Webhooks

Webhook events.

Microsoft Entra ID can notify an app or AI agent when a directory object changes, like a user or group being created or updated, instead of the app repeatedly asking. A change-notification subscription sends a lightweight message to a registered URL when the chosen resource changes.

EventWhat it signalsTriggered by
users (created / updated / deleted)Fires when a user object is created, updated, or deleted, for an app subscribed to the users resource through change notifications./users
/users
/users/{id}
/users/{id}
groups (created / updated / deleted)Fires when a group is created, updated, or deleted, including membership changes, for an app subscribed to the groups resource through change notifications./groups
/groups
/groups/{id}
/groups/{id}
/groups/{id}/members/$ref
/groups/{id}/members/{memberId}/$ref
No events match that search.
Rate limits & pagination

Rate limits, pagination & request size.

Microsoft Graph limits how fast an app or AI agent can call, through throttling that varies by service and by whether the call reads or writes, and it returns a wait time when a client goes over.

Request rate

Microsoft Graph protects the service with throttling rather than a fixed published request budget, and the threshold varies by scenario, so a high volume of writes is throttled sooner than reads. Limits apply both per app across a single tenant and per app across all tenants, and a tenant-wide ceiling counts requests from every app together. When a threshold is crossed, Graph returns HTTP 429 Too Many Requests with a Retry-After header giving the seconds to wait. Requests inside a JSON batch are each metered separately, so one entry can be throttled while the batch itself returns 200. Service-specific numbers are published per workload, and large bulk extraction should use Microsoft Graph Data Connect instead of the REST API.

Pagination

List responses are paged. A page that has more results includes an @odata.nextLink property holding the full URL for the next page, which should be followed as given rather than built by hand, until no nextLink is returned. The page size is controlled with $top where the endpoint supports it. The sign-in logs default and cap each page at 1,000 objects and page through a $skiptoken carried on the nextLink.

Request size

Adding members to a group is capped at 20 per request through the members@odata.bind form. Sign-in and audit log reads are bounded by the Microsoft Entra retention window for that data rather than by a single payload size. Some user and group properties, like skills and allowExternalSenders, are stored outside the main directory and are not returned by default or tracked by change notifications.

Errors

Status codes & error handling.

The status codes an agent should handle, and what to do about each.

StatusCodeMeaningWhat to do
400badRequest / invalidRequestThe request is malformed or a property is invalid, like a missing required field or a member that is already in the group. A recently created group can also return this while it replicates across directory replicas.Read the error message, fix the request, and for the replication case wait a few seconds and retry.
401InvalidAuthenticationTokenThe access token is missing, expired, or invalid.Acquire a fresh token and send it in the Authorization header as a bearer token.
403Authorization_RequestDeniedThe token is valid but lacks the permission the call needs, or in a delegated call the signed-in user lacks the required Microsoft Entra role.Grant the missing Graph permission, get admin consent, or assign the signed-in user the required directory role.
404Request_ResourceNotFoundThe object does not exist, or the token cannot see it.Confirm the ID is correct and the caller has access to the resource.
429TooManyRequestsA throttling threshold was exceeded. Microsoft Graph returns 429 with a Retry-After header giving the seconds to wait, and the error code TooManyRequests with an innerError of 429.Wait the number of seconds in the Retry-After header, then retry; if no header is present, back off exponentially.
503serviceNotAvailableThe service is temporarily unavailable, which can also appear as a throttling response and may include a Retry-After header.Honor the Retry-After header if present, otherwise retry with exponential backoff.
Versioning & freshness

Version history.

Microsoft Graph serves Microsoft Entra ID through two named endpoints, the stable v1.0 used here and a separate beta, rather than dated version strings. New and changed methods are tracked through a dated changelog.

Version history

What changed, and when

Latest versionv1.0
v1.0Current version
Stable Microsoft Graph endpoint

Microsoft Entra ID is served through Microsoft Graph at the named v1.0 endpoint, the stable surface for production. A separate beta endpoint carries preview features that can change or be removed and should not be used in production. Rather than minting dated versions, Microsoft Graph announces new and changed methods through a dated changelog, and breaking changes follow a published deprecation and retirement policy.

What changed
  • v1.0 is the generally available, production endpoint for Microsoft Entra ID through Microsoft Graph.
  • A separate beta endpoint exposes preview capabilities not covered by the production service-level agreement.
  • Method-level additions and changes are tracked on the Microsoft Graph changelog rather than through version numbers.
Earlier
Azure AD Graph retirement

Microsoft Graph supersedes the older Azure AD Graph API, which has been retired, and Azure Active Directory was renamed Microsoft Entra ID. New integrations use Microsoft Graph at graph.microsoft.com with Microsoft Graph permission names.

What changed
  • Azure Active Directory renamed to Microsoft Entra ID.
  • Azure AD Graph endpoint retired in favor of Microsoft Graph.
  • Directory operations consolidated under the Microsoft Graph v1.0 and beta endpoints.

An integration calls the v1.0 endpoint for production and beta only for previews.

Microsoft Graph changelog ↗
Questions

Microsoft Entra ID API, answered.

What's the difference between delegated and application permissions?+
Delegated permissions are used when an app acts on behalf of a signed-in user, and the effective access is the overlap of the granted scope and what that user is allowed to do, so it is also bounded by the user's directory roles. Application permissions are used when the app acts as itself with no user, through the client credentials flow or a managed identity, and apply across the whole tenant. The same permission name, like User.ReadWrite.All, exists in both forms, and an administrator must consent to it.
Is Microsoft Entra ID the same as Azure Active Directory?+
Yes. Azure Active Directory was renamed Microsoft Entra ID, and the same directory is managed through the Microsoft Graph API at graph.microsoft.com. The older Azure AD Graph endpoint is retired, so new integrations use Microsoft Graph. Permission names like User.Read.All and Group.ReadWrite.All are Microsoft Graph permissions.
How does throttling work and what do I do when I hit it?+
Microsoft Graph throttles to protect the service, and the threshold depends on the scenario, with writes throttled sooner than reads. Limits apply per app per tenant and per app across all tenants. When a limit is crossed, Graph returns HTTP 429 with a Retry-After header giving the seconds to wait. The right response is to wait that long and retry, or back off exponentially if no header is present, rather than retrying immediately.
Which permission do I need to manage users and groups?+
Reading every user needs User.Read.All and reading every group needs Group.Read.All. Creating, updating, or deleting users needs User.ReadWrite.All, and the same for groups needs Group.ReadWrite.All. Adding or removing group members needs GroupMember.ReadWrite.All, and reading membership needs GroupMember.Read.All. In delegated calls the signed-in user must also hold a supporting Microsoft Entra role, like User Administrator or Groups Administrator.
How do I read sign-in and audit logs, and how far back do they go?+
Listing sign-ins at /auditLogs/signIns and directory changes at /auditLogs/directoryAudits both need AuditLog.Read.All, delegated or application. Reading the conditional access policies applied to a sign-in additionally needs Policy.Read.All. Only events within the Microsoft Entra default retention window are available, and a time-range $filter is recommended to avoid timeouts on the sign-in logs.
Does Microsoft Entra ID have an official MCP server?+
Yes. The Microsoft MCP Server for Enterprise is a first-party server at https://mcp.svc.cloud.microsoft/enterprise that lets an AI agent query Entra data in natural language. It is in public preview and covers read-only identity scenarios across users, groups, applications, and devices. It runs read-only Graph calls through its microsoft_graph_get tool while honoring the user's roles and the granted scopes, and is limited to 100 calls per minute per user.
How do I get notified of directory changes instead of polling?+
Microsoft Graph change notifications let an app subscribe to a resource like users or groups and receive a POST to a registered URL when a matching object is created, updated, or deleted. The receiver validates a token Graph sends when the subscription is set up, and can opt in to receive encrypted resource data with the notification. This is the recommended alternative to repeatedly scanning the directory, which is more likely to be throttled.
Related

More security API guides for agents

What is Bollard AI?

Control what every AI agent can do in Microsoft Entra ID.

Bollard AI sits between a team's AI agents and Microsoft Entra ID. Grant each agent exactly the access it needs, read or write, resource by resource, and every call is checked and logged.

  • Set read, write, or full access per agent, never a shared directory app registration.
  • Denied by default, so an agent reaches only what has been explicitly allowed.
  • Every call recorded in plain English: who, what, where, and the decision.
Microsoft Entra ID
Joiner-Mover-Leaver Agent
Read users ResourceOffReadFull use
Add to groups ActionOffReadFull use
Assign directory roles ActionOffReadFull use
Read sign-in logs ResourceOffReadFull use
Per-agent access, set in Bollard AI, not in Microsoft Entra ID