---
title: "Cancel a purge API task"
slug: "cancel-a-purge-api-task"
abstract: "How to cancel purge tasks with the xConnect purge Web API."
---
# Cancel a purge API task

You can use the [xConnect Web API](https://doc.sitecore.com/xp/en/developers/101/sitecore-experience-platform/web-api-for-xconnect-data-tools.html "Web API for xConnect Data Tools") to cancel a [purge](https://doc.sitecore.com/xp/en/developers/101/sitecore-experience-platform/xconnect-purging-tool.html "xConnect purging tool") task.

To cancel the task:

- Use the following PUT request and substitute the `{{TaskId}}` parameter with the ID of the ongoing registered task:

    ```text
    <instance>/sitecore/api/datatools/purge/tasks/{{TaskId}}/cancel
    ```

    > [!note]
    > The task cancellation is not an immediate process because the in-progress batch of contacts completes, and the task still purges the related data.