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)
Tasks.ReadWrite
Group.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
Tasks.ReadWrite.All
Not available.
HTTP request
DELETE /planner/tasks/{id}
Request headers
Name
Description
Authorization
Bearer {token}. Required.
If-Match
Last known ETag value for the plannerTask to be deleted. Required.
Request body
Don't supply a request body for this method.
Response
If successful, this method returns 204 No Content response code. It doesn't return anything in the response body.
This method can return any of the HTTP status codes. The most common errors that apps should handle for this method are the 400, 403, 404, 409, and 412 responses. For more information about these errors, see Common Planner error conditions.
// 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.Planner.Tasks["{plannerTask-id}"].DeleteAsync((requestConfiguration) =>
{
requestConfiguration.Headers.Add("If-Match", "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc=\"");
});
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc planner tasks delete --planner-task-id {plannerTask-id} --if-match "W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc=""
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new PlannerTaskItemRequestBuilderDeleteRequestConfiguration();
$headers = [
'If-Match' => 'W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc="',
];
$requestConfiguration->headers = $headers;
$graphServiceClient->planner()->tasks()->byPlannerTaskId('plannerTask-id')->delete($requestConfiguration)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(credentials, scopes)
request_configuration = PlannerTaskItemRequestBuilder.PlannerTaskItemRequestBuilderDeleteRequestConfiguration()
request_configuration.headers.add("If-Match", "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc=\"")
await graph_client.planner.tasks.by_planner_task_id('plannerTask-id').delete(request_configuration = request_configuration)