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

> Permanently delete a namespace using the Python SDK

## namespaces.delete

Permanently deletes a namespace and all its contents. This action is irreversible.

### Parameters

<ParamField query="namespace_name" type="str" required>
  The exact name of the namespace to delete.
</ParamField>

**Returns:** `None`.

**Raises:** `NamespaceNotFound`, `AuthenticationError`, `APIError`.

### Example

```python Delete Namespace Example theme={null}
from moorcheh_sdk import MoorchehClient, NamespaceNotFound

with MoorchehClient() as client:
    try:
        client.namespaces.delete(namespace_name="my-temporary-namespace")
        print("Namespace deleted successfully")
    except NamespaceNotFound:
        print("Namespace was not found")
```

### Error Handling

```python Error Handling Example theme={null}
from moorcheh_sdk import MoorchehClient, NamespaceNotFound, APIError

with MoorchehClient() as client:
    namespace_to_delete = "my-old-namespace"
    
    try:
        client.namespaces.delete(namespace_to_delete)
        print(f"Successfully deleted namespace: {namespace_to_delete}")
    except NamespaceNotFound:
        print(f"Namespace '{namespace_to_delete}' does not exist")
    except APIError as e:
        print(f"API error occurred: {e}")
```

<Warning>
  Deleting a namespace permanently removes all data within it. This action cannot be undone.
</Warning>

## Important Notes

* Deletion is processed asynchronously and may take several minutes for large namespaces
* You can continue using other namespaces while deletion is in progress
* Storage quota is updated once deletion is complete
* Deleted namespace names become available for reuse after completion

## Best Practices

* **Backup Important Data**: Export or backup critical data before deletion
* **Verify Namespace Name**: Double-check the namespace name before deletion
* **Monitor Usage**: Use the list namespaces endpoint to confirm deletion completion
* **Plan Downtime**: Consider impact on applications using the namespace

## Use Cases

* **Data Cleanup**: Remove old or unused namespaces to free up storage
* **Project Completion**: Delete namespaces for completed projects
* **Resource Management**: Manage namespace limits by removing unused ones
* **Data Lifecycle**: Implement data retention policies

## Related Operations

* [List Namespaces](/python-sdk/namespaces/list) - View all namespaces before deletion
* [Create Namespace](/python-sdk/namespaces/create) - Create a new namespace
