Skip to main content
POST
/
namespaces
/
{namespace_name}
/
files
/
delete
Delete File Index
curl --request POST \
  --url http://localhost:8080/namespaces/{namespace_name}/files/delete \
  --header 'Content-Type: application/json' \
  --data '
{
  "path": "<string>",
  "file_id": "<string>"
}
'
{
  "status": "success",
  "message": "File delete started. Poll file job status for progress.",
  "job_id": "job-39e12e05109c45bb8f477edb1912964d",
  "file_id": "a1b2c3d4e5f67890",
  "namespace_name": "my-documents",
  "absolute_path": "/uploads/document.pdf"
}

Overview

Deletes all indexed chunks and summary chunks for one file, and removes its file registry entry. The PDF or document under ~/.moorcheh/uploads is not deleted. Provide exactly one of path or file_id.

Path parameters

namespace_name
string
required
Text namespace.

Body

path
string
Container path (e.g. /uploads/document.pdf). Must match the path used at upload.
file_id
string
File id from List files.
Direct API calls use container paths. The CLI accepts a host path under ~/.moorcheh/uploads and converts it automatically.

Request examples

# By container path
curl -X POST "http://localhost:8080/namespaces/my-documents/files/delete" \
  -H "Content-Type: application/json" \
  -d '{"path": "/uploads/document.pdf"}'

# By file_id
curl -X POST "http://localhost:8080/namespaces/my-documents/files/delete" \
  -H "Content-Type: application/json" \
  -d '{"file_id": "a1b2c3d4e5f67890"}'

Response fields

status
string
"success" when the delete job started.
message
string
Human-readable result.
job_id
string
Async job id. Poll with File job status (job_type: file_delete).
file_id
string
File id being deleted.
namespace_name
string
Target namespace.
absolute_path
string
Container path of the file being deleted.
{
  "status": "success",
  "message": "File delete started. Poll file job status for progress.",
  "job_id": "job-39e12e05109c45bb8f477edb1912964d",
  "file_id": "a1b2c3d4e5f67890",
  "namespace_name": "my-documents",
  "absolute_path": "/uploads/document.pdf"
}

Errors

HTTPCause
400Both or neither of path and file_id provided; invalid path
404Namespace or file not found