> ## 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.

# Delete Job Status

> Poll namespace delete job progress using the Python client

## namespaces.delete\_job\_status

Returns status for a namespace delete started by [namespaces.delete](/on-prem/python-client/namespaces/delete). Poll until `status` is `"completed"` or `"failed"`.

```python theme={null}
client.namespaces.delete_job_status(namespace_name: str, job_id: str) -> dict[str, Any]
```

**API:** `GET /namespaces/{namespace_name}/delete-jobs/{job_id}` — see [Delete job status](/on-prem/api-references/namespaces/delete-job-status)

### Parameters

<ParamField body="namespace_name" type="str" required>
  Namespace the delete job belongs to.
</ParamField>

<ParamField body="job_id" type="str" required>
  Job id returned from [namespaces.delete](/on-prem/python-client/namespaces/delete).
</ParamField>

**Returns:** `dict[str, Any]` — job progress (`status`, timestamps, errors).

**Raises:** `MoorchehApiError` on non-2xx responses.

### Examples

```python Poll Delete Job theme={null}
import time
from moorcheh import MoorchehClient

with MoorchehClient("http://localhost:8080") as client:
    resp = client.namespaces.delete("my-documents")
    job_id = resp["job_id"]

    while True:
        job = client.namespaces.delete_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"))
```

### Error Handling

```python Error Handling Example theme={null}
from moorcheh import MoorchehClient, MoorchehApiError

with MoorchehClient("http://localhost:8080") as client:
    try:
        job = client.namespaces.delete_job_status("my-documents", job_id)
    except MoorchehApiError as e:
        print(e.status_code, e.body)  # 404 if job not found
```

## Related Operations

* [Delete Namespace](/on-prem/python-client/namespaces/delete) — start a delete job
* [API: Delete job status](/on-prem/api-references/namespaces/delete-job-status)
* [CLI: moorcheh namespace-delete-job-status](/on-prem/cli/namespaces/delete-job-status)
