---
title: Delete an item and optionally, its children in a Push source
slug: '171'
canonical_url: https://docs.coveo.com/en/171/
collection: index-content
source_format: adoc
---
# Delete an item and optionally, its children in a Push source

:figure-caption!:

Being able to delete a single [item](https://docs.coveo.com/en/210.md) in a Push [source](https://docs.coveo.com/en/246.md), possibly along with its children, can be especially useful when you're testing the service or performing a very small content update.

Use the `Delete an item and optionally its children` request only to delete one item, or an item and its children.
To maximize efficiency and comply with [Push API quotas and constraints](https://docs.coveo.com/en/63.md), don't use this request repeatedly to delete many items in a Push source.
If this is what you need to do, you should either use:

* The [batch update requests](https://docs.coveo.com/en/90.md).

* The [`Delete old items`](https://docs.coveo.com/en/131.md) request.

**Sequence diagram illustrating the handling of a `Delete an item and optionally its children` Push API request (highlighted) as it progresses through the [Coveo indexing pipeline](https://docs.coveo.com/en/1893.md).**
![Sequence diagram for DELETE documents request](https://docs.coveo.com/en/assets/images/index-content/delete-documents-sequence-diagram.svg)

## Request template

> **Note**
>
> The Push API still uses region-specific endpoints.
> Use the endpoint that matches the primary deployment region of your Coveo organization.

**US East region**
<details><summary>Details</summary>

```http
DELETE https://api.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/sources/<MySourceId>/documents?deleteChildren=<true|false>&documentId=<MyDocumentId> HTTP/1.1

Accept: application/json
Authorization: Bearer <MyAccessToken>
```

</details>
**Canada region**
<details><summary>Details</summary>

```http
DELETE https://api-ca.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/sources/<MySourceId>/documents?deleteChildren=<true|false>&documentId=<MyDocumentId> HTTP/1.1

Accept: application/json
Authorization: Bearer <MyAccessToken>
```

</details>
**Ireland region**
<details><summary>Details</summary>

```http
DELETE https://api-eu.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/sources/<MySourceId>/documents?deleteChildren=<true|false>&documentId=<MyDocumentId> HTTP/1.1

Accept: application/json
Authorization: Bearer <MyAccessToken>
```

</details>
**Australia region**
<details><summary>Details</summary>

```http
DELETE https://api-au.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/sources/<MySourceId>/documents?deleteChildren=<true|false>&documentId=<MyDocumentId> HTTP/1.1

Accept: application/json
Authorization: Bearer <MyAccessToken>
```

</details>
**HIPAA region**
<details><summary>Details</summary>

```http
DELETE https://apihipaa.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/sources/<MySourceId>/documents?deleteChildren=<true|false>&documentId=<MyDocumentId> HTTP/1.1

Accept: application/json
Authorization: Bearer <MyAccessToken>
```

</details>
Request parameters:

**Parameters**
<details><summary>Details</summary>

In the request path:

* Replace `<MyOrganizationId>` with your [organization ID](https://docs.coveo.com/en/148.md).
* Replace `<MySourceId>` with your Push [source's ID](https://docs.coveo.com/en/3390.md#copy-a-source-name-or-id).

In the query string:

* Set `deleteChildren` to `true` to delete all items whose URLs begin with `<MyDocumentId>` + `/`.
For example, if `documentId` is set to `file://folder`, items `file://folder/file1.txt` and `file://folder/subfolder/file2.txt` would be deleted.
+
Set `deleteChildren` to `false` otherwise.

* Replace `<MyDocumentId>` with the URL-encoded [document ID](https://docs.coveo.com/en/78.md#query-parameters-delete) of the item to delete in the target Push source (for example, `file%3A%2F%2Ffolder%2FdummyItem.html`).

In the `Authorization` HTTP header:

* Replace `<MyAccessToken>` with a Push source API key that grants the [set of privileges required to push items](https://docs.coveo.com/en/1546.md#api-key) to your source.

</details>
Request body: None

Successful response: `202 Accepted`

A successful response (`202 Accepted`) indicates that the delete operation was successfully forwarded to the service and is now enqueued to be processed in the [Coveo indexing pipeline](https://docs.coveo.com/en/184.md).
This doesn't imply that the item was successfully deleted in the target Push source.
See [About the Push API processing delay](https://docs.coveo.com/en/32.md) for details.

> **Leading practice: Update the status of your Push source**
>
> If you set your Push source to an active status before, you should consider [setting it back to the `IDLE` status](https://docs.coveo.com/en/35.md) once this request has successfully returned, assuming you have no more requests to perform as part of this content update.

## Sample request

The following example shows how to delete an item and its children.

```http
DELETE https://api.cloud.coveo.com/push/v1/organizations/mycoveocloudv2organizationg8tp8wu3/sources/mycoveocloudv2organizationg8tp8wu3-rp5rxzbdz753uhndklv2ztkfgy/documents?deleteChildren=true&documentId=file%3A%2F%2Ffolder%2F HTTP/1.1
​
Authorization: Bearer **********-****-****-****-************
Accept: application/json
```