Skip to main content

Delete Documents API Definition

The Delete Documents API lets you delete a document from a corpus.


Check out our interactive API Playground that enables you to experiment with this REST endpoint. You can delete a file from a corpus directly from your browser or copy the curl for your command line.

Delete Document Request and Response

A request to delete a document from a corpus consists of three key pieces of information:

  • customer_id
  • corpus_id
  • document_id

The reply on successful deletion is {}.

REST Example

Delete Documents Endpoint Address

Vectara exposes a REST endpoint at the following URL to delete content from a corpus:

Delete Document Request and Response

"customerId": "123456789",
"corpusId": 1,
"documentId": "my_document.docx"

You get the following response:


To verify that the document no longer exists in the corpus, use the List Documents endpoint.

gRPC Example

You can find the Delete Document gRPC definition at common.proto.

The reply from the server consists of nothing yet. Note that while the operation is not completely synchronous (the document may still be returned in query results), the platform typically removes the document within a few seconds, though it may take longer for Growth accounts.

Java and Python Examples

The code snippet belows illustrates how to delete a document from a corpus in Java or Python. For information on how to get the call credentials and metadata, please consult The OAuth 2.0 documentation.

.withDeadlineAfter(30, TimeUnit.SECONDS) // Always set a deadline.

gRPC Status Codes

The server returns the following gRPC status codes:

  • INTERNAL: An internal error code indicates a failure inside the platform, and an immediate retry may not succeed.

  • UNAVAILABLE: The service is temporarily unavailable, and the operation should be retried, preferably with a backoff.


    The deletion operation is idempotent, so it is fine to re-apply.