domain: forceDelete
Namespace: microsoft.graph
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.
Delete a domain using an asynchronous operation.
Before performing this operation, you must update or remove any references to Exchange as the provisioning service.
The following actions are performed as part of this operation:
Renames the UPN, EmailAddress, and ProxyAddress of users with references to the deleted domain.
Renames the EmailAddress of groups with references to the deleted domain.
Renames the identifierUris of applications with references to the deleted domain.
If the number of objects to be renamed is greater than 1,000, an error is returned.
If one of the applications to be renamed is a multitenant app, an error is returned.
After the domain deletion completes, API operations for the deleted domain return a 404 HTTP response code. To verify deletion of a domain, you can perform a get domain. If the domain was successfully deleted, a 404 HTTP response code is returned in the response.
This API is available in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ✅ | ✅ | ✅ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | Domain.ReadWrite.All | Not available. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Domain.ReadWrite.All | Not available. |
Important
In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. Domain Name Administrator is the least privileged role supported for this operation.
HTTP request
POST /domains/{id}/forceDelete
For {id}, specify the domain with its fully qualified domain name.
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Content-Type | application/json |
Request body
In the request body, provide a JSON object with the following parameters.
Parameter | Type | Description |
---|---|---|
disableUserAccounts | Boolean | Option to disable renamed user accounts. If a user account is disabled, the user isn't allowed to sign in.true (default) - User accounts renamed as part of this operation are disabled.false - User accounts renamed as part of this operation aren't disabled. |
Response
If successful, this method returns 200 OK
response code.
Example
Request
POST https://graph.microsoft.com/beta/domains/contoso.com/forceDelete
Content-type: application/json
{
"disableUserAccounts": true
}
Response
HTTP/1.1 200 OK