Delete a namespace #
Delete an existing namespace.
Examples #
The following request delete the namespace called website:
DELETE /_namespace/website
Request #
DELETE /_namespace/<name>
/_ns/<name> is accepted as a shorter alias.
Path parameters #
<name>
(Required, string) The name of the namespace that you want to delete.
Response #
{ "acknowledged": true }
Trash semantics #
Deleting a namespace moves the WHOLE namespace into the trash: every
collection’s data directory is retained under <data_path>/trash/
together with a namespace-level restore snapshot (one snapshot per
collection — schemas, shard UUIDs, partition routing, placements). The
sweeper physically deletes it after trash.retention_secs.
Until then the namespace can be restored as a unit — with all of its collections — through the cluster trash APIs:
POST /_cluster/trash/<item>/verify # read-only shard-completeness check
POST /_cluster/trash/<item>/restore # brings back every collection