# Use the Delete Document Data service

> :::note
To ensure improved control, only External Applications with the following scope can access this endpoint: `Du.Deletion.Api`. Make sure to add this scope to your application before authenticating.
:::

:::note
To ensure improved control, only External Applications with the following scope can access this endpoint: `Du.Deletion.Api`. Make sure to add this scope to your application before authenticating.
:::

You can use the DELETE API to remove all runtime data (excluding [Monitor](https://docs.uipath.com/document-understanding/automation-cloud/latest/USER-GUIDE/monitor) data) related to a given **documentId**.

This API allows you to clean up all associated data from a document without waiting for the automatic expiration.

## Deleting document data

To initiate the deletion of all data linked to a document, use the following call:

```
DELETE /projects/{projectId}/document/{documentId}/
```

:::note
Deletion operations are asynchronous, which means the update might not appear right away. Please allow a short time before confirming.
:::

```
curl -X 'DELETE' \
  '{AutomationCloudURL}/<Organization_Name>/<Tenant_Name>/du_/api/framework/projects/<Project_ID>/document/<Document_ID>/api-version=1.1' \
  -H 'accept: text/plain' \
  -H 'Content-Type: application/json' \
  -d '{
  "removeValidationDataFromStorage": true
}'
```

You can also use the following optional input parameter when making the deletion call:

```
removeValidationDataFromStorage: true or false (default)
```

The `removeValidationDataFromStorage` parameter controls whether the associated storage bucket files are also deleted:

* If set to **true**, the associated files from Orchestrator Storage Buckets are removed.

After the deletion call, a **202 Accepted** response message is displayed.

## Confirming deletion

To confirm the deletion, use the following call:

```
GET /projects/{projectId}/digitization/result/{documentId}
```

```
curl -X 'GET' \
  '{AutomationCloudURL}/<Organization_Name>/<Tenant_Name>/du_/api/framework/projects/<Project_ID>/digitization/result/<Document_ID>?api-version=1.1' \
  -H 'accept: text/plain'
```

Once the deletion is complete, a **404 Not Found** message is returned.
