Delete Knowledge Base Collection
Delete the vector collection of the current RAG knowledge base along with all vector data in it. This operation will affect subsequent retrieval results, please call with caution.
Try It
DELETE
/database/collectionshttps://api-platform.ope.aiAuthentication
Uses Bearer Token authentication.
- Header:
Authorization: Bearer <token> - Example:
Authorization: Bearer sk-xxxxxx
Request Body (application/json)
The request body can just be an empty JSON object.
{}
Request Examples
- cURL
- JavaScript
curl -X DELETE "https://api-platform.ope.ai/database/collections" \
-H "Authorization: Bearer $OPEAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
const res = await fetch("https://api-platform.ope.ai/database/collections", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.OPEAI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
console.log(await res.json());
Response Example
{
"success": true
}
Error Responses
| Status Code | Scenario | Description |
|---|---|---|
401 | Authentication failed | API Key is missing, invalid, or has insufficient permissions |
422 | Validation failed | Request format is incorrect |
500 | Collection deletion failed | Vector database connection failed or collection deletion failed |