Ana içeriğe geç

Delete Document

Endpoint

DELETE /apiops/projects/{projectName}/knowledge-bases/{kbName}/documents/{documentId}/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
kbNamestringYesKnowledge base name (parent, resolved by name)
documentIdstringYesDocument id (documents are referenced by id, not name)

Query Parameters

None

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"deploymentResult": {
"success": true
}
}

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "Document id can not be empty!"
}

or

{
"status": "FAILURE",
"resultMessage": "Knowledge base (name: product-docs) was not found!"
}

Error Response (401 Unauthorized)

{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}

cURL Example

curl -X DELETE \
"https://demo.apinizer.com/apiops/projects/MyProject/knowledge-bases/product-docs/documents/6651b3c4e4b0c3a2d1f0aaaa/" \
-H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings

  • Id-Based (Deliberate Exception): The document is addressed by documentId, not by name. The parent knowledge base is resolved by kbName first.
  • Ownership Enforcement: The document is resolved by documentId AND knowledgeBaseId AND projectId before deletion, so a document id from another knowledge base or project cannot be deleted.
  • Vector Purge: Deleting a document also removes its indexed chunks from the VectorDB. This operation is irreversible.
  • Knowledge Base Preserved: Only the single document is removed; the knowledge base and its other documents are untouched. To remove the whole knowledge base, use Delete Knowledge Base.
  • Permissions: Requires AI_DEVELOPMENT + MANAGE permission in the project.