Skip to main content

Delete Document

Delete the specified document under the current RAG knowledge base. The service will attempt to delete the physical files, vector data, and database records.

Try It

DELETE/documents/documentshttps://api-platform.ope.ai

Authentication

Uses Bearer Token authentication.

  • Header: Authorization: Bearer <token>
  • Example: Authorization: Bearer sk-xxxxxx

Request Body (application/json)

FieldTypeRequiredDescriptionDefault / Range
doc_idstringYesThe ID of the document to delete-

Request Examples

curl -X DELETE "https://api-platform.ope.ai/documents/documents" \
-H "Authorization: Bearer $OPEAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"doc_id":"doc_1"}'

Response Example

{
"status": "deleted",
"doc_id": "doc_1"
}

Error Responses

Status CodeScenarioDescription
401Authentication failedAPI Key is missing, invalid, or has insufficient permissions
422Validation faileddoc_id is missing or in an incorrect format
500Deletion failedFailed to delete file, vector data, or database records