Delete document (DELETE)
Remove a document from your index.
DELETE
/api/v1/documentsDelete an indexed document.
Request body
| Parameter | Type | Description |
|---|---|---|
idrequired | string | Document ID to delete. |
Example
import { Etoile } from "@etoile-dev/client";
const etoile = new Etoile({
apiKey: process.env.ETOILE_API_KEY,
});
await etoile.delete("starry-night");const response = await fetch("https://etoile.dev/api/v1/documents", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.ETOILE_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
id: "starry-night",
}),
});curl -X DELETE "https://etoile.dev/api/v1/documents" \
-H "Authorization: Bearer $ETOILE_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "starry-night"
}'Response
{
"message": "Document deleted successfully.",
"id": "starry-night"
}Auth
Requires secret key.