Delete an item and optionally, its children in a Push source
Delete an item and optionally, its children in a Push source
Being able to delete a single item in a Push source, 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 API consumption limits, 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
Delete old itemsrequest.
Delete an item and optionally its children Push API request (highlighted) as it progresses through the Coveo indexing pipeline.Request template
US East region
DELETE https://api.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/sources/<MySourceId>/documents?deleteChildren=<true|false>&documentId=<MyItemURI> HTTP/1.1
Accept: application/json
Authorization: Bearer <MyAccessToken>
Canada region
DELETE https://api-ca.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/sources/<MySourceId>/documents?deleteChildren=<true|false>&documentId=<MyItemURI> HTTP/1.1
Accept: application/json
Authorization: Bearer <MyAccessToken>
Ireland region
DELETE https://api-eu.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/sources/<MySourceId>/documents?deleteChildren=<true|false>&documentId=<MyItemURI> HTTP/1.1
Accept: application/json
Authorization: Bearer <MyAccessToken>
Australia region
DELETE https://api-au.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/sources/<MySourceId>/documents?deleteChildren=<true|false>&documentId=<MyItemURI> HTTP/1.1
Accept: application/json
Authorization: Bearer <MyAccessToken>
Request parameters:
Parameters
In the request path:
-
Replace
<MyOrganizationId>with your organization ID. -
Replace
<MySourceId>with your Push source’s ID.
In the query string:
-
Set
deleteChildrentotrueto delete all items whose URLs begin with<MyItemURI>+/. For example, ifdocumentIdis set tofile://folder, itemsfile://folder/file1.txtandfile://folder/subfolder/file2.txtwould be deleted.Set
deleteChildrentofalseotherwise. -
Replace
<MyItemURI>with the URL-encoded URI 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 to your source.
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.
This doesn’t imply that the item was successfully deleted in the target Push source.
See About the Push API processing delay 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 |
Sample request
The following example shows how to delete an item and its children.
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