Namespace: microsoft.graph.ediscovery
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 tag object.
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) |
eDiscovery.Read.All |
eDiscovery.ReadWrite.All |
| Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
| Application |
eDiscovery.Read.All |
eDiscovery.ReadWrite.All |
HTTP request
DELETE /compliance/ediscovery/cases/{caseId}/tags/{tagId}?forcedelete=true
Query parameters
In the request URL, provide the following required query parameter.
| Parameter |
Type |
Description |
| forcedelete |
Boolean |
If set to true, the tag and children are deleted, if false, and the tag has children, the delete fails. |
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 204 No Content response code.
Examples
Request
DELETE https://graph.microsoft.com/beta/compliance/ediscovery/cases/47746044-fd0b-4a30-acfc-5272b691ba5b/tags/9985bd266f2f459cbebc81522734b452?forcedelete=true
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Compliance.Ediscovery.Cases["{case-id}"].Tags["{tag-id}"].DeleteAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Forcedelete = "true";
});
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphcompliance "github.com/microsoftgraph/msgraph-beta-sdk-go/compliance"
//other-imports
)
requestForcedelete := "true"
requestParameters := &graphcompliance.EdiscoveryCasesItemTagsItemRequestBuilderDeleteQueryParameters{
Forcedelete: &requestForcedelete,
}
configuration := &graphcompliance.EdiscoveryCasesItemTagsItemRequestBuilderDeleteRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Compliance().Ediscovery().Cases().ByCaseId("case-id").Tags().ByTagId("tag-id").Delete(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.compliance().ediscovery().cases().byCaseId("{case-id}").tags().byTagId("{tag-id}").delete(requestConfiguration -> {
requestConfiguration.queryParameters.forcedelete = "true";
});
const options = {
authProvider,
};
const client = Client.init(options);
await client.api('/compliance/ediscovery/cases/47746044-fd0b-4a30-acfc-5272b691ba5b/tags/9985bd266f2f459cbebc81522734b452?forcedelete=true')
.version('beta')
.delete();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Compliance\Ediscovery\Cases\Item\Tags\Item\TagItemRequestBuilderDeleteRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new TagItemRequestBuilderDeleteRequestConfiguration();
$queryParameters = TagItemRequestBuilderDeleteRequestConfiguration::createQueryParameters();
$queryParameters->forcedelete = "true";
$requestConfiguration->queryParameters = $queryParameters;
$graphServiceClient->compliance()->ediscovery()->cases()->byCaseId('case-id')->tags()->byTagId('tag-id')->delete($requestConfiguration)->wait();
Import-Module Microsoft.Graph.Beta.Compliance
Remove-MgBetaComplianceEdiscoveryCaseTag -CaseId $caseId -TagId $tagId -Forcedelete true
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.compliance.ediscovery.cases.item.tags.item.tag_item_request_builder import TagItemRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = TagItemRequestBuilder.TagItemRequestBuilderDeleteQueryParameters(
forcedelete = "true",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
await graph_client.compliance.ediscovery.cases.by_case_id('case-id').tags.by_tag_id('tag-id').delete(request_configuration = request_configuration)
Response
HTTP/1.1 204 No Content