Delete Documents from Collection
const url = 'https://dashboard.quantcdn.io/api/v3/organizations/example/ai/vector-db/collections/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/documents';const options = { method: 'DELETE', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"purgeAll":true,"documentIds":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"keys":["example"],"metadata":{"field":"example","values":["example"]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://dashboard.quantcdn.io/api/v3/organizations/example/ai/vector-db/collections/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/documents \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "purgeAll": true, "documentIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "keys": [ "example" ], "metadata": { "field": "example", "values": [ "example" ] } }'Delete documents from a collection. Supports three deletion modes:
*
* 1. Purge All - Set purgeAll: true to delete ALL documents in the collection
*
* 2. By Document IDs - Provide documentIds array with specific document UUIDs
*
* 3. By Metadata - Provide metadata object with field and values to delete documents where the metadata field matches any of the values
*
* Drupal Integration:
* When using with Drupal AI Search, use metadata deletion with:
* - field: 'drupal_entity_id' to delete all chunks for specific entities
* - field: 'drupal_long_id' to delete specific chunks
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organisation machine name
Collection UUID
Request Bodyrequired
Section titled “Request Bodyrequired”object
Delete ALL documents in collection
Delete specific documents by UUID
Delete documents by key
object
Metadata field name (e.g., ‘drupal_entity_id’)
Values to match (OR logic)
Examplegenerated
{ "purgeAll": true, "documentIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "keys": [ "example" ], "metadata": { "field": "example", "values": [ "example" ] }}Responses
Section titled “Responses”Documents deleted successfully
object
Examplegenerated
{ "message": "example", "collectionId": "example", "deletedCount": 1}Invalid request - must specify purgeAll, documentIds, or metadata
Access denied
Collection not found
Failed to delete documents
