Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.moorcheh.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Returns status for a namespace delete started by delete_namespace. Poll until status is "completed" or "failed".

Method

client.delete_namespace_job_status(namespace_name: str, job_id: str) -> dict

API

GET /namespaces/{namespace_name}/delete-jobs/{job_id} — see Delete job status

Parameters

namespace_name
string
required
Namespace the delete job belongs to. Must match the namespace used when the job was started.
job_id
string
required
Job id returned from delete_namespace.

Example

import time
from moorcheh import MoorchehApiClient, MoorchehApiError

client = MoorchehApiClient("http://localhost:8080")
resp = client.delete_namespace("my-documents")
job_id = resp["job_id"]

while True:
    job = client.delete_namespace_job_status("my-documents", job_id)
    if job["status"] in ("completed", "failed"):
        break
    time.sleep(0.5)

if job["status"] == "failed":
    print(job.get("last_error"))

Returns

job_id
string
Id of the delete job.
namespace_name
string
Namespace being deleted.
status
string
Job state: "running", "completed", or "failed".
total_items
number
Number of items in the namespace when the delete started.
deleted_items
number
Number of items removed so far. Equals total_items when job status is "completed".
last_error
string | null
Error message when job status is "failed"; otherwise null.
started_at
string
ISO 8601 UTC timestamp when the job started.
updated_at
string
ISO 8601 UTC timestamp of the last job update.
finished_at
string | null
ISO 8601 UTC timestamp when the job finished; null while the job is "running".
message
string
Error description when the job cannot be found.
Example return value (running)
{
  "job_id": "job-682efd0be4484e49b7bf787466d6e9a4",
  "namespace_name": "my-documents",
  "status": "running",
  "total_items": 42,
  "deleted_items": 0,
  "last_error": None,
  "started_at": "2026-05-21T12:10:00.000Z",
  "updated_at": "2026-05-21T12:10:00.000Z",
  "finished_at": None,
}

Errors

Non-2xx responses raise MoorchehApiError.
from moorcheh import MoorchehApiError

try:
    job = client.delete_namespace_job_status("my-documents", job_id)
except MoorchehApiError as e:
    print(e.status_code, e.body)  # 404 if job not found
StatusCause
404Delete job not found, or job id does not belong to this namespace