iQ Suite - Docs
SDK ReferenceDocument RAG

Delete Document

Remove a specific document from an index.

Description

The /index/delete-document endpoint allows you to remove a specific document from an existing index. This is useful for maintaining the accuracy and relevance of your indexed data.

HTTP Request

POST /index/delete-document

Authentication

All requests must include an Authorization header with a valid API key.

Headers

KeyValue
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/json

Request Body

  • index: The ID of the index from which the document will be deleted.
  • document: The ID of the document to delete.

JSON

FieldTypeDescription
indexstringThe ID of the index
documentstringThe ID of the document to delete

Request Example

from iqsuite import IQSuiteClient, AuthenticationError, APIError
 
client = IQSuiteClient(api_key="YOUR_API_KEY")
index_id = "index_1"
document_id = "doc_3"
 
try:
    response = client.delete_document(index_id, document_id)
    print(response)
except AuthenticationError:
    print("Invalid API key")
except APIError as e:
    print(f"API Error: {e}")

Response

Success

Status Code: 200 OK

Body:

{
   "message": "Document deleted."
}

On this page