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

# moorcheh namespace-delete

> Delete a namespace and all its items (async).

## Overview

Starts an asynchronous delete of a namespace and all items in it. **By default**, the CLI waits for the delete job to finish before exiting, so you can safely recreate the same namespace name right away. Use `--no-wait` to return immediately with a `job_id` and poll with [moorcheh namespace-delete-job-status](/on-prem/cli/namespaces/delete-job-status).

When the job completes, global item quota is freed for all removed items.

## Synopsis

```bash theme={null}
moorcheh namespace-delete --namespace-name NAME [--base-url URL] [--no-wait] [--poll-interval SECONDS] [--wait-timeout SECONDS]
```

## Options

| Flag | Required | Description |
| - | - | - |
| `--namespace-name` | Yes | Namespace to delete |
| `--base-url` | No | Default `http://localhost:8080` |
| `--no-wait` | No | Return as soon as delete is accepted (202 + `job_id`) |
| `--poll-interval` | No | Seconds between status polls when waiting (default `0.2`) |
| `--wait-timeout` | No | Max seconds to wait for completion (default `120`) |

## Examples

```bash theme={null}
moorcheh namespace-delete --namespace-name my-documents

moorcheh namespace-delete --namespace-name my-documents --base-url http://localhost:8081
```

## Output

Prints JSON from `DELETE /namespaces/{namespace_name}`:

<ResponseField name="status" type="string">
  `"success"` when the delete job was started; `"failure"` on error.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable result or error description.
</ResponseField>

<ResponseField name="namespace_name" type="string">
  Namespace being deleted.
</ResponseField>

<ResponseField name="job_id" type="string">
  Async delete job id — use with `namespace-delete-job-status`.
</ResponseField>

```json Example output theme={null}
{
  "status": "success",
  "message": "Namespace delete started. Poll delete job status for progress.",
  "namespace_name": "my-documents",
  "job_id": "job-682efd0be4484e49b7bf787466d6e9a4"
}
```

## Workflow

Default (wait until complete):

```bash theme={null}
moorcheh namespace-delete --namespace-name my-documents
moorcheh namespace-create --namespace-name my-documents --type text
```

Fire-and-forget (manual poll):

```bash theme={null}
moorcheh namespace-delete --namespace-name my-documents --no-wait
moorcheh namespace-delete-job-status --namespace-name my-documents --job-id <job_id>
```

Repeat the job-status command until `status` is `completed` or `failed`.

## Exit codes

| Code | Meaning |
| - | - |
| `0` | Delete finished (default wait) or delete job started (`--no-wait`) |
| `1` | API error (404, etc.) or delete job failed / timed out |

## Related

* [CLI: namespace-delete-job-status](/on-prem/cli/namespaces/delete-job-status)
* [API: Delete namespace](/on-prem/api-references/namespaces/delete)
* [Python: namespaces.delete()](/on-prem/python-client/namespaces/delete)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.