# namespace

The `namespace` command groups subcommands for interacting with namespaces.

### Examples <a href="#examples" id="examples"></a>

List all namespaces:

```shell-session
$ vault namespace list
```

List all namespaces with additional details such as namespace ID and custom metadata:

```shell-session
$ vault namespace list -detailed
```

Create a namespace at the path `ns1/` with no custom metadata:

```shell-session
$ vault namespace create ns1/
```

Create a namespace at the path `ns1/` with multiple custom metadata keys:

```shell-session
$ vault namespace create -custom-metadata=foo=abc -custom-metadata=bar=123 ns1/
```

Patch an existing namespace at the path `ns1/` to add custom metadata key `bar` and remove key `foo`

```shell-session
$ vault namespace patch -custom-metadata=bar=123 -remove-custom-metadata=foo ns1/
```

Delete the namespace at path `ns1/`:

```shell-session
$ vault namespace delete ns1/
```

Lookup the namespace information at path `ns1/`:

```shell-session
$ vault namespace lookup ns1/
```

Lock the API for the current namespace:

```shell-session
$ vault namespace lock
```

Lock the API for a descendant namespace at path `current/namespace/ns1/`:

```shell-session
$ vault namespace lock ns1/
```

Unlock the API for the current namespace:

```shell-session
$ vault namespace unlock -unlock-key <unlock key>
```

Unlock the API for a descendant namespace at path `current/namespacens1/`:

```shell-session
$ vault namespace unlock -unlock-key <unlock key> ns1/
```

### Usage <a href="#usage" id="usage"></a>

```
Usage: vault namespace <subcommand> [options] [args]

  This command groups subcommands for interacting with Vault namespaces.
  These set of subcommands operate on the context of the namespace that the
  current logged in token belongs to.

Subcommands:
    create   Create a new namespace
    delete   Delete an existing namespace
    list     List child namespaces
    lookup   Look up an existing namespace
    lock     Lock the API for a namespace
    unlock   Unlock the API for a namespace
```

For more information, examples, and usage about a subcommand, click on the name of the subcommand in the sidebar.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.enclaive.cloud/vault/cli/namespace.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
