Skip to content

Delete Documents from Collection

DELETE
/api/v3/organizations/{organisation}/ai/vector-db/collections/{collectionId}/documents

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

Parameters

Path Parameters

organisation
required
string

Organisation machine name

collectionId
required
string format: uuid

Collection UUID

Request Body required

object
purgeAll

Delete ALL documents in collection

boolean
documentIds

Delete specific documents by UUID

Array<string>
metadata
object
field

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

string
values

Values to match (OR logic)

Array<string>

Responses

200

Documents deleted successfully

object
message
string
collectionId
string
deletedCount
integer

400

Invalid request - must specify purgeAll, documentIds, or metadata

403

Access denied

404

Collection not found

500

Failed to delete documents