Delete a retrieval document

deleteRetrievalDocument(projectReference: ID!, retrievalDocumentId: ID!, input: DeleteRetrievalDocumentInput): Deletion!

Requires project.knowledge.write; API keys also need delete scope.

Arguments

ArgumentTypeRequiredDescription
projectReferenceID!YesProject UUID or slug.
retrievalDocumentIdID!Yes
inputDeleteRetrievalDocumentInputNo

Input fields

input

DeleteRetrievalDocumentInput

FieldTypeRequiredDescription
expectedRevisionStringNoDelete only this observed revision. A changed record is a conflict; a missing record is not_found. Delete the record before removing its chunks, as ragStore().removeDocument() does, so a concurrent refresh cannot publish through a still-visible record.

Response

Returns Deletion!. Open the type for its fields and nested types.

FieldTypeDescription
okBoolean!Always true: the record was deleted.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

query.graphql
mutation DeleteRetrievalDocument($projectReference: ID!, $retrievalDocumentId: ID!, $input: DeleteRetrievalDocumentInput) {  deleteRetrievalDocument(projectReference: $projectReference, retrievalDocumentId: $retrievalDocumentId, input: $input) {    ok  }}
variables.json
{  "projectReference": "00000000-0000-4000-8000-000000000001",  "retrievalDocumentId": "00000000-0000-4000-8000-000000000001"}