--- title: Delete old items in a Push source slug: '131' canonical_url: https://docs.coveo.com/en/131/ collection: index-content source_format: adoc --- # Delete old items in a Push source :figure-caption!: This article provides an overview of the `Delete old items` request. **Sequence diagram illustrating the handling of a `Delete old items` Push API request (highlighted) as it progresses through the [Coveo indexing pipeline](https://docs.coveo.com/en/1893/).** ![Sequence diagram showing Delete Old Items Push API request in the Coveo indexing pipeline | Coveo](https://docs.coveo.com/en/assets/images/index-content/delete-olderthan-sequence-diagram.svg) ## Request template **US East region** [%collapsible%open] #### [source,http,subs=attributes] ``` DELETE https://api.cloud.coveo.com/push/v1/organizations//sources//documents/olderthan?orderingId=&queueDelay= HTTP/1.1 ​ Accept: application/json Authorization: Bearer ``` #### .Canada region
Details [source,http,subs=attributes] ``` DELETE https://api-ca.cloud.coveo.com/push/v1/organizations//sources//documents/olderthan?orderingId=&queueDelay= HTTP/1.1 ​ Accept: application/json Authorization: Bearer ```
**Ireland region**
Details [source,http,subs=attributes] ``` DELETE https://api-eu.cloud.coveo.com/push/v1/organizations//sources//documents/olderthan?orderingId=&queueDelay= HTTP/1.1 ​ Accept: application/json Authorization: Bearer ```
**Australia region**
Details [source,http,subs=attributes] ``` DELETE https://api-au.cloud.coveo.com/push/v1/organizations//sources//documents/olderthan?orderingId=&queueDelay= HTTP/1.1 ​ Accept: application/json Authorization: Bearer ```
Request parameters: **Parameters**
Details In the request path: * Replace `` with your [organization ID](https://docs.coveo.com/en/148/). * Replace `` with the [ID](https://docs.coveo.com/en/3390#copy-a-source-name-or-id) of the target Push source. In the query string: * Replace `` with the `orderingId` value you want to use. Any item that was pushed by a request whose [`orderingId`](https://docs.coveo.com/en/147/) is lower ("older") than this value will be deleted from the target Push source. [IMPORTANT]
Unless you're setting your own `orderingId` values when pushing items, you should typically set the `orderingId` of a `Delete old items` request to the current number of milliseconds since the Unix epoch, without any offset. For example, let's say you're letting the Push API set its own `orderingId` values when you push content updates to your source. This means that each content update request you perform on that source has its `orderingId` automatically set to the current number of milliseconds since the Unix epoch, which is UTC-based. When performing a `Delete old items` request on that source, you retrieve the current Unix timestamp, but then mistakenly adjust it to Central European Standard Time (that is, UTC+1) before setting it as the `orderingId` value. As a result, the [indexing pipeline](https://docs.coveo.com/en/184/) will reject new pushed items for an hour after you perform the request. #### * Optionally, replace `` with the number of minutes you want the Push API to wait before enqueueing the `Delete old items` operation in the indexing pipeline. The default `queueDelay` value is `15` (minutes). This grace period is intended to give the indexing pipeline enough time to finish processing any previously enqueued operations that would affect the target Push source. Performing a `Delete old items` request with a low `queueDelay` value may have unexpected results (that is, some items you expect to be deleted could be added back into the target Push source _after_ the request is processed). In the `Authorization` HTTP header: * Replace `` with a Push source API key that grants the [set of privileges required to push items](https://docs.coveo.com/en/1546#api-key) to your source. ##### Request body: None Successful response: `202 Accepted` A successful response (`202 Accepted`) has no content, but it indicates that the operation was forwarded to the service. It will be enqueued to be processed by the indexing pipeline when the specified (or default) `queueDelay` has elapsed. This doesn't imply that the items were successfully deleted in the target Push source. See [About the Push API processing delay](https://docs.coveo.com/en/32/) for details. > **Leading practice: Update the status of your Push source** > > If you set your Push source to an active status before, and you have no further requests to perform as part of this content update, you should consider [setting it back to the `IDLE` status](https://docs.coveo.com/en/35/). ## Sample request The following example shows how to delete all items older than a specified `orderingId` value. ```http DELETE https://api.cloud.coveo.com/push/v1/organizations/mycoveocloudv2organizationg8tp8wu3/sources/mycoveocloudv2organization-rp5rxzbdz753uhndklv2ztkfgy/documents/olderthan?orderingId=1509711177594&queueDelay=1 HTTP/1.1 Accept: application/json Authorization: Bearer **********-****-****-****-************ ```