Skip to content

Delete Documents from Collection

DELETE
/api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/documents
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

organisation
required
string

Organisation machine name

collectionId
required
string format: uuid

Collection UUID

Media typeapplication/json
object
purgeAll

Delete ALL documents in collection

boolean
documentIds

Delete specific documents by UUID

Array<string>
keys

Delete documents by key

Array<string>
metadata
object
field

Metadata field name (e.g., ‘drupal_entity_id’)

string
values

Values to match (OR logic)

Array<string>
Examplegenerated
{
"purgeAll": true,
"documentIds": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
],
"keys": [
"example"
],
"metadata": {
"field": "example",
"values": [
"example"
]
}
}

Documents deleted successfully

Media typeapplication/json
object
message
string
collectionId
string
deletedCount
integer
Examplegenerated
{
"message": "example",
"collectionId": "example",
"deletedCount": 1
}

Invalid request - must specify purgeAll, documentIds, or metadata

Access denied

Collection not found

Failed to delete documents